CentOS sendmail简单配置
1、安装Sendmail
#yum install sendmail sendmail-cf m4 m4-utils dovecot -y |
2、设置Sendmail服务的网络访问权限,其默认只允许本机访问
# vim /etc/mail/sendmail.mc DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl # m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf |
需要注意一下,我们可以看到配置文件中有一个sendmail.cf和sendmail.mc,其中sendmail.cf为真正的配置文件,使用宏语言编写晦涩难懂,我们要编辑的是sendmail.mc,然后采用m4工具生成sendmail.cf文件。
3、配置Sendmail邮件服务器域名
(1)修改Sendmail配置文件local-host-names
# vim /etc/mail/local-host-names jyt.com mail.jyt.com |
(2)在邮件服务器上添加MX记录
$TTL 86400 @ IN SOA localhost. root.localhost. ( 42 3H 15M 1W 1D ) IN NS dns.jyt.com. IN MX 5 mail.jyt.com. dns IN A 192.168.0.1 mail IN A 192.168.0.1 |
4、想要Sendmail当做邮件中转站我们还有一个小工作要完成
# cd /etc/mail # vim /etc/mail/access # makemap hash access.db < access |
将客户端的IP地址加入到access配置文件中
5、安装Dovecot,并对相应文件进行修改
(1)
# vim /etc/dovecot/dovecot.conf protocols = imap pop3 lmtp |
(2)
# vim etc/dovecot/conf.d/10-mail.conf mail_location = mbox:~/mail:INBOX=/var/mail/%u |
(3)
# vim /etc/dovecot/conf.d/10-ssl.conf ssl = no #ssl_cert = </etc/pki/dovecot/certs/dovecot.pem #ssl_key = </etc/pki/dovecot/private/dovecot.pem |
(4)
# vim /etc/dovecot/conf.d/10-auth.conf disable_plaintext_auth = no |
发表吐槽
你肿么看?
既然没有吐槽,那就赶紧抢沙发吧!