[原创] 使用RedHat 8.0 RPM包快速设置Sendmail邮件认证
发表于:2007-05-25来源:作者:点击数:
标签:
RedHat8.0里的Sendmail基本上都已经与SASL配好了,所以想找一个快的方法设置邮件认证,用RedHat是不错的。本文档在篇末有几个参考文献,建议大家有空看看。 RPMPackagesfromRedhat8.0CDs: *sendmail-8.12.5-7 *sendmail-cf-8.12.5-7 *cyrus-sasl-2.1.7-2 *cy
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
NET
UNIX 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-E
XPN
250-VERB
250-8BIT
MIME
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 a
clearcase/" target="_blank" >ccepted 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/)
原文转自:http://www.ltesting.net
|