首先需要在内网搭建一台DNS服务器
$TTL 86400
@ IN SOA mx1985.com. root.mx1985.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS mx1985.com.
IN MX 10 mail.mx1985.com.
mx1985.com. IN A 192.168.1.206
mail.mx1985.com. IN A 192.168.1.207
配置邮件服务器的环境
HOSTNAME=mail.mx1985.com
nameserver 192.168.1.206
安装sendmail-cf
yum install sendmail-cf
打开监听的端口
vi /etc/mail/sendmail.mc
DAEMON_OPTIONS(`Port=smtp,Addr=192.168.1.207, Name=MTA')dnl
编译设置文件
M4 sendmail.mc > sendmail.cf
设置接收邮件的主机名
vi /etc/mail/local-host-names
mail.mx1985.com
mx1985.com
设置组邮件
vi /etc/aliases
# Person who should get root's mail
root: mio
然后可以测试一下
telnet 192.168.1.207 25
helo mail.mx1985.com
mail from:mio@mx1985.com
rcpt to:mio2@mx1985.com
data aaaa
aaaaa
.
quit
建立用户认证
设置配置文件
vi /etc/mail/sendmail.mc
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
编译设置文件
M4 sendmail.mc > sendmail.cf
设置sasl2配置
vi /usr/lib/sasl2/smtpd.conf
pwcheck_method: saslauthd
设置saalauthd
vi /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=pam
可以发现绕了一大圈 他用的pam进行身份认证
Chkconfig saslauthd on
Sertvice saslauthd start
配置收信
安装dovecot
yum install dovecot
配置dovecot
vi /etc/dovecot.conf
protocols = imap imaps pop3 pop3s
chkconfig dovecot on
Service docecot start
试验下
上一篇:PHPCMS V9内容模块PC标签调用说明 下一篇:快递查询API