postfix是一个流行的smtp服务器。smtp服务器默认端口是25(不采用ssl/tls加密的情况)。
下面介绍如何在CentOS6上安装postfix。
1 . CentOS6默认已经安装了postfix.如果系统没有postfix的话,可以采用如下命令安装它。
[root@mail ~]
2 . 配置postfix的main.cf,配置smtp-auth采用dovecot的sasl功能。
[root@mail ~]
myhostname = mail.opsky.top
mydomain = opsky.top
myorigin = $mydomain
inet_interfaces = all
inet_protocols = ipv4
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 127.0.0.0/8, 10.0.0.0/24
home_mailbox = Maildir/
smtpd_banner = $myhostname ESMTP
message_size_limit = 10485760
mailbox_size_limit = 1073741824
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
main.cf配置完毕后,启动postfix,并设置自动启动。
[root@mail ~]
Starting postfix: [ OK ]
[root@mail ~]
3 . 如果iptables在开启状态,那么设置iptables开放smtp的25端口。
[ ] - - - -- - -- -
本文由 CentOS中文站 - 专注Linux技术 作者:centos 发表,其版权均为 CentOS中文站 - 专注Linux技术 所有,文章内容系作者个人观点,不代表 CentOS中文站 - 专注Linux技术 对观点赞同或支持。如需转载,请注明文章来源。