sendmail 在centos6設定

1.  Criterion

OS
CentOS6 Linux ms5.tc.edu.tw 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

2. Install
# yum install sendmail
# yum install m4
# yum install sendmail-cf

3. Settings for listen all ports
修改 /etc/mail/sendmail.mc 約116行,把127.0.0.1改為0.0.0.0

DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl

編碼
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

4. 重啟sendmail
# service sendmail restart

5. 查看是否有啟動
# netstat -at | grep smtp
tcp        0      0 *:smtp                      *:*                         LISTEN

6. 設定允許寄信網段,允許163.17.40.0/24
# vim /etc/mail/access
Connect:163.17.40                       RELAY

將access檔案內容寫入db檔案
#  makemap hash /etc/mail/access.db </etc/mail/access

設定網域名稱 vi /etc/mail/local-host-names
m5.tc.edu.tw
ms5.tc.edu.tw

備註

如有啟動失敗,檢查是否postfix已經開啟
# service postfix status

參考資料

1 http://marcustsai.blogspot.tw/2010/11/sendmail.html

完整連結 http://note.tc.edu.tw/846.html
arrow
arrow

    Johnson峰 發表在 痞客邦 留言(0) 人氣()