環境:
CentOS 5.5
Kernel 2.6.18-128.el5
套件:
Postfix(SMTP)
Saslauthd(SMTP AUTH)
dovecot(POP3)
一.
查看是否已安裝有sendmail(移除sendmail)
[root@CentOS ~]# rpm -qa |grep sendmail
sendmail-cf-8.13.8-8.el5
sendmail-8.13.8-8.el5
[root@CentOS ~]# rpm -e sendmail
error: Failed dependencies:
/usr/sbin/sendmail is needed by (installed) redhat-lsb-3.1-12.3.EL.el5.centos.i386
smtpdaemon is needed by (installed) mdadm-2.6.9-3.el5.i386
smtpdaemon is needed by (installed) fetchmail-6.3.6-1.1.el5_3.1.i386
smtpdaemon is needed by (installed) mutt-1.4.2.2-3.0.2.el5.i386
[root@CentOS ~]#rpm -e --nodeps sendmail
二.
安裝Postfix(yum)
[root@CentOS etc]# yum install postfix
.......
設定/etc/postfix/main.cf
[root@CentOS etc]#vi /etc/postfix/main.cf
-------------------修改部分------------------
myhostname = mail.XD.com #Postfix郵件主機名稱
mydomain = XD.com #Domain名稱
myorigin = $mydomain #發信端機
inet_interfaces = all
mydestination=$mydomain #可以讓client MUA接收的目的地位置(#信件的目的網域符合將信收下來)
mynetworks = 127.0.0.0/8 #可以Relay的條件
-------------------------------------------------
判斷是否已安裝sasl認證
[root@CentOS etc]# rpm -qa |grep sasl
cyrus-sasl-2.1.22-5.el5_4.3
cyrus-sasl-lib-2.1.22-5.el5_4.3
cyrus-sasl-plain-2.1.22-5.el5_4.3
若已安裝sasl後繼續設定psotfix main.cf
[root@CentOS etc]#vi /etc/postfix/main.cf
-------------------------新增部分-------------------------------
smtpd_sasl_auth_enable=yes
smtpd_sasl_security_options=noanonymous
broken_sasl_auth_clients=yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sender_restrictions = permit_mynetworks,permit_sasl_authenticated,reject
#因為permit_mynetworks為localhost,smtpd_sender_restrictions可以越來設定內部寄件者進行SMTP認證,smtpd_client_restrictions也可達成
--------------------------------------------------------------------
檢查是否安裝dovecot(POP3 IMAP)
[root@CentOS sasl2]# rpm -qa |grep dovecot
dovecot-1.0.7-7.el5
若已安裝進行修改dovecot設定檔
[root@CentOS sasl2]#vi /etc/dovecot.conf
-------------------------------修改部分-------------------------
protocols = imap imaps pop3 pop3s #拿掉# 註解
--------------------------------------------------------------------
啟動dovecot
[root@CentOS sasl2]# service dovecot start
Starting Dovecot Imap: [ OK ]
啟動sasl認證
[root@CentOS sasl2]# service saslauthd start
Starting saslauthd: [ OK ]
啟動Postfix
[root@CentOS sasl2]# service postfix start
Starting postfix: [ OK ]
參考:
http://www.spps.tp.edu.tw/documents/memo/postfix/postfix.htm
沒有留言:
張貼留言