RedHat 8.0里的Sendmail基本上都已经与SASL配好了,所以想找一个快的方法设置邮件认证,用RedHat是不错的。本文档在篇末有几个参考文献,建议大家有空看看。
RPM Packages from Redhat 8.0 CDs:
* sendmail-8.12.5-7
* sendmail-cf-8.12.5-7
* cyrus-sasl-2.1.7-2
* cyrus-sasl-md5-2.1.7-2
* cyrus-sasl-plain-2.1.7-2
* cyrus-sasl-devel-2.1.7-2
****************************
Installation:
* Install all RPM Packages
ldconfig -p | grep sasl # make sure SASL is in shared-library path
* Check to be sure that sendmail includes SASL support: sendmail -d0.1 -bv root | grep SASL
NETUNIX NEWDB NIS PIPELINING SASL SCANF STARTTLS TCPWRAPPERS
* Add the following line to /usr/lib/sasl/Sendmail.conf
pwcheck_method:shadow #authenticated against passwd
* cd /usr/share/sendmail-cf/cf and modify sendmail.mc. Add the following 2 lines:
define(`confAUTH_MECHANISMS', `LOGIN PLAIN GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5')dnl
TRUST_AUTH_MECH(`LOGIN PLAIN GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5')dnl
* ./Build sendmail.cf
* cp sendmail.cf /etc/mail
* /etc/init.d/sendmail restart
****************************
Verification:
hermes@cf $ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 hermes ESMTP Sendmail 8.12.5/8.12.5; Sun, 17 Aug 2003 17:58:22 -0400
EHLO localhost
250-hermes Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH LOGIN PLAIN DIGEST-MD5 CRAM-MD5 # Make sure AUTH & LOGIN PLAIN are in place.
250-DELIVERBY
250 HELP
AUTH LOGIN
334 VXNlcm5hbWU6
bmVpbHM= # Your Base64 encoded username. Refer to http://makcoder.sourceforge.net/demo/base64.php for a quick conversion.
334 UGFzc3dvcmQ6
cFuZz0ACA0 # Your Base64 encoded password
235 2.0.0 OK Authenticated
MAIL FROM: someone@anything.com
250 2.1.0 someone@anything.com... Sender ok
RCPT TO: neilsu@domain.com
250 2.1.5 neilsu@domain.com... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
just a test
.
250 2.0.0 h7HNRZ1K003211 Message accepted for delivery
quit
221 2.0.0 hermes closing connection
Connection closed by foreign host.
NOTES: Only emails from domains which are NOT in relay lists will be required for SMTP AUTH (such as roaming users). It is generally a BAD IDEA to turn SMTP AUTH for all users.
****************************
Reference:
* SMTP AUTH in sendmail 8.10-8.12 (http://www.sendmail.org/~ca/email/auth.html)
* How to set up SMTP AUTH (http://www.jonfullmer.com/smtpauth/)
* Pavel's Sendmail Help (http://www.asp.ogi.edu/people/paja/linux/sendmail/)
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/
领测软件测试网最新更新
关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073