У меня есть CentOS 6.4 в mediatemple.net, мне нужно отправить письмо на Gmail, Hotmail и т. д.
Я попытался установить postfix, sendmail, dovecot, cyrus, procmail, spamassassin и т.д., И даже не работает, потому что при тестировании почта никогда не удаляется и не выдает ошибку.
Я мог бы сказать, когда я устанавливаю SMTP-сервер, POP3, IMAP, который может отправлять почту в Gmail, Hotmail, Live, Яндекс, Yahoo и т.д.
Установка:
# yum install sendmail*
# yum install cyrus*
# yum install dovecot
# yum install procmail
# yum install spamassassin
Настройте Sendmail:
# nano /etc/mail/sendmail.mc
define(`confLOG_LEVEL', `20')dnl
define(`confAUTH_OPTIONS', `A p')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confCACERT_PATH', `/etc/pki/tls/certs')dnl
define(`confCACERT', `/etc/pki/tls/certs/ca-bundle.crt')dnl
define(`confSERVER_CERT', `/etc/pki/tls/certs/sendmail.pem')dnl
define(`confSERVER_KEY', `/etc/pki/tls/certs/sendmail.pem')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
dnl FEATURE(`accept_unresolvable_domains')dnl
INPUT_MAIL_FILTER(`spamassassin', `S=unix:/var/run/spamassassin/spamass-milter.sock, F=, T=C:15m;S:4m;R:4m;E:10m')dnl
define(`confMILTER_MACROS_CONNECT',`t, b, j, _, {daemon_name}, {if_name}, {if_addr}')dnl
define(`confMILTER_MACROS_HELO',`s, {tls_version}, {cipher}, {cipher_bits}, {cert_subject}, {cert_issuer}')dnl
# nano /etc/mail/local-host-names
*
Настройте Devcot:
# nano /etc/dovecot.conf
protocols = imap imaps pop3 pop3s
ssl_cert_file = /etc/pki/tls/certs/sendmail.pem
ssl_key_file = /etc/pki/tls/certs/sendmail.pem
ssl_ca_file = /etc/pki/tls/certs/sendmail.pem
verbose_ssl = yes
# chkconfig dovecot on
Настройте SpamAssassin:
# cd /etc/mail/spamassassin
# mv local.cf local.cf.orig
# nano local.cf
required_score 5.0
rewrite_header subject [SPAM]
report_safe 1
use_bayes 1
use_bayes_rules 1
bayes_auto_learn 1
skip_rbl_checks 0
# chkconfig spamassassin on
# cd /usr/src
# wget http://www.voztovoice.org/tmp/spamass-milter-0.3.1.tar.gz
# tar -xf spamass-milter-0.3.1.tar.gz
# cd spamass-milter-0.3.1
# yum install gcc ncurses ncurses-devel make gcc-c++ libtermcap libtermcap-devel zlib zlib-devel libtool
# ./configure
# make
# make install
# cd contrib
# nano spamass-milter-redhat.rc
SM_SOCKET=/var/run/spamassassin/spamass-milter.sock
[ -x /usr/local/sbin/spamass-milter ] || exit 0
PATH=$PATH:/usr/local/sbin
# cp spamass-milter-redhat.rc /etc/init.d/spamass-milter
# cd /etc/init.d
# chmod +x spamass-milter
# chkconfig --level 2345 spamass-milter on
# nano /etc/sysconfig/spamass-milter
SOCKET=/var/run/spamassassin/spamass-milter.sock
EXTRA_FLAGS="-r 15"
# reboot
Логи и тесты
# nano /var/log/maillog
# yum install telnet
# telnet
telnet> o localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 ejemplo.org ESMTP Sendmail 8.13.8/8.13.8; Tue, 13 Oct 2009 15:20:59 GMT
ehlo root.com
250-example.org Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5
250-STARTTLS
250-DELIVERBY
250 HELP
quit
# spamassassin -t < /usr/share/doc/spamassassin-3.3.1/sample-nonspam.txt | grep X-Spam
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on ejemplo.org
X-Spam-Level:
X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=no version=3.2.5
spamassassin -t < /usr/share/doc/spamassassin-3.3.1/sample-spam.txt | grep X-Spam
X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on astercurso.com
X-Spam-Level: **************************************************
X-Spam-Status: Yes, score=1000.0 required=5.0 tests=GTUBE,NO_RECEIVED,