用sendmail和cyrus-imapd架设邮件系统
环境是RHEL4.3,很多包都是现成的RPM,因此安装过程略去。要确保saslauthd,sendmail,cyrus-imapd,cyrus-imapd-utils,m4都成功安装了。将saslauthd,sendmail,cyrus-imapd都设置为开机服务。
新建一个用户cyrus,设置其密码,作为imap的管理密码。用saslpasswd -c cyrus设置sasl密码。
用su切换到cyrus用户,执行:/usr/lib/cyrus-imapd/mkimap
利用cyradm -u cyrus localhost添加邮箱。参考http://book.51cto.com/art/200801/64958.htm
测试系统用户:telnet localhost 110
telnet localhost 110the login:user testuserpass testYou should see:+OK Name is a valid mailbox+OK Mailbox locked and ready
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnldefine(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confLOCAL_MAILER', `cyrus')MAILER(`cyrus')
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
define(`QUEUE_DIR',`/var/spool/mqueue/q*')
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# mail testuser@localhostSubject: testtest.
Delivery to the following recipient failed permanently:aaa@eden.orgTechnical details of permanent failure:Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 530 530 5.7.0 Authentication required (state 13).
DAEMON_OPTIONS(`Port=25, Name=MTA, M=E’)dnl