config sendmail:
apt-get install sendmail
vi /etc/mail/sendmail.mc
#添加以下两行,注意左引号为数字“1”左边的按键
#打开SMTP认证,不然外网不能够发信
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
#修改以下两行的127.0.0.1为0.0.0.0,意思是在任何IP都能发信
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=0.0.0.0')dnl
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=0.0.0.0')dnl
然后在把信任域名加入到local-host-names
vi /etc/mail/local-host-names
#添加你的域名,每行一个
d2qb.com
至此,sendmail的设置就完了,然后生成配置文件
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf