# service sendmail stop
#rpm -e sendmail-cf-8.13.8-8.el5.i386
# yum install postfix
[root@linux ~]# postfix check <==檢查 postfix 相關的檔案、權限等是否正確!
[root@linux ~]# postfix start <==開始 postfix 的執行
[root@linux ~]# postfix stop <==關閉 postfix
[root@linux ~]# postfix flush <==強制將目前正在郵件佇列的郵件寄出!
[root@linux ~]# postfix reload <==重新讀入設定檔,也就是 /etc/postfix/main.cf
vi /etc/postfix/main.cf
myhostname = xxx.xxx.xxx
myorigin = $myhostname
inet_interfaces = all
|
由於如果有重複設定項目時,會以最晚出現的設定值為準,所以當你設定為『inet_interfaces = all』時,請將 inet_interfaces =
localhost 那一行註解掉啊
vi /etc/dovecot.conf
protocols = pop3
listen = *
/etc/init.d/dovecot start
# vi /etc/postfix/main.cf
# 在本檔案最後面增加這些設定資料:
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
# 然後找到跟 relay 有關的設定項目,增加一段允許 SMTP 認證的字樣:
smtpd_recipient_restrictions =
permit_mynetworks
permit_sasl_authenticated
reject_unauth_destination
reject_rbl_client cbl.abuseat.org
reject_rbl_client bl.spamcop.net
reject_rbl_client cblless.anti-spam.org.cn
reject_rbl_client sbl-xbl.spamhaus.org
check_policy_service unix:/var/spool/postfix/postgrey/socket
[root@linux ~]# /etc/init.d/postfix restart
測試
[root@112-104-219-213
~]# telnet localhost 25
Trying
127.0.0.1...
Connected
to localhost.localdomain (127.0.0.1).
Escape
character is '^]'.
220
mg.twbbs.org ESMTP Postfix
ehlo
localhost
250-mg.twbbs.org
250-PIPELINING
250-SIZE
10240000
250-VRFY
250-ETRN
250-AUTH
PLAIN LOGIN
250-AUTH=PLAIN
LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN