生成配置 m4 /etc/mail/sendmail.mc > /etc/sendmail.cf *************************** 若是出現:sendmail.mc:10: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory 說明須要安裝sendmail-cf yum install sendmail-cf ***************************
修改dovecot配置 vi /etc/dovecot.conf 去掉下面一行前面的# #protocols =imap imaps pop3 pop3s
添加域名 vi /etc/mail/local-host-names 添加域名如:dirtysea.com //每一個域名一行
修改認證方式 vi /usr/lib/sasl2/Sendmail.conf 裏面指明瞭:pwcheck_method=saslauthd,不作修改 vi /etc/sysconfig/saslauthd 找到第7行的:MECH= 改爲:MECH=shadow 保存 以下示列:
[root@mail]# cat /usr/lib/sasl2/Sendmail.conf pwcheck_method:saslauthd [root@mail]# cat /usr/lib/sasl2/smtpd.conf.rpmsave log_level: 3 pwcheck_method: saslauthd mech_list: PLAIN LOGIN [root@mail]# cat /etc/sysconfig/saslauthd # Directory in which to place saslauthd's listening socket, pid file, and so # on. This directory must already exist. SOCKETDIR=/var/run/saslauthd # Mechanism to use when checking passwords. Run "saslauthd -v" to get a list # of which mechanism your installation was compiled with the ablity to use. MECH=shadow # Additional flags to pass to saslauthd on the command line. See saslauthd(8) # for the list of accepted flags. FLAGS= [root@mail]#testsaslauthd -u test -p 123456 (驗證smtp) 0: OK "Success."
[root@centos5 mail]# telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 centos5 ESMTP Sendmail 8.13.8/8.13.8; Thu, 6 May 2010 06:21:29 +0800 helo localhost 250 centos5 Hello localhost.localdomain [127.0.0.1], pleased to meet you mail from:<> 250 2.1.0 <>... Sender ok rcpt to:<> (要測試向外發送郵件就填寫網絡上存在的郵件地址) 250 2.1.5 <>... Recipient ok data 354 Enter mail, end with "." on a line by itself From: alin To: alin Subject: Hello test . 250 2.0.0 o45MLTcH005157 Message accepted for delivery quit 221 2.0.0 centos5 closing connection Connection closed by foreign host.