CentOS6安装postfix并设置sasl的具体方法

1 . CentOS6默认安装了postfix.如果系统没有postfix,可以用以下命令安装。
[root@mail ~]# yum -y install postfix登录后复制
2 . 配置postfix的main.cf,配置smt

centos6安装postfix并设置sasl的具体方法

1 . CentOS6默认安装了postfix.如果系统没有postfix,可以用以下命令安装。

[root@mail ~]# yum -y install postfix

登录后复制
2 . 配置postfix的main.cf,配置smtp-auth采用dovecot的sasl功能。

[root@mail ~]# vi /etc/postfix/main.cf
# 第75行: 去掉注释,并设置主机名。
myhostname = mail.opsky.top
# 第83行: 去掉注释,并设置域名。
mydomain = opsky.top
# 第99行: 去掉注释。
myorigin = $mydomain
# 第116行: 
inet_interfaces = all
# 第119行: 如果只使用ipv4,那么设置如下。
inet_protocols = ipv4
# 第164行: 配置可接收邮件的域名。
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
# 第264行: 去掉注释,并设置本地网络号段.
mynetworks = 127.0.0.0/8, 10.0.0.0/24
# 第419行: 去掉注释,采用Maildir格式。
home_mailbox = Maildir/
# 第571行: 
smtpd_banner = $myhostname ESMTP
# 添加如下配置到文件末尾
# 一封邮件大小限制为10M
message_size_limit = 10485760
# 一个邮箱大小限制为1G
mailbox_size_limit = 1073741824
# 配置SMTP-Auth采用dovecot的sasl功能
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 ~]# /etc/rc.d/init.d/postfix start 
Starting postfix: [  OK  ]
[root@mail ~]# chkconfig postfix on

登录后复制
3 . 如果iptables在开启状态,那么设置iptables开放smtp的25端口。

[root@dlp ~]# iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT

登录后复制

以上就是CentOS6安装postfix并设置sasl的具体方法的详细内容,更多请关注叮当号网其它相关文章!

文章来自互联网,只做分享使用。发布者:木子,转转请注明出处:https://www.dingdanghao.com/article/351525.html

(0)
上一篇 2024-04-15 15:45
下一篇 2024-04-15 15:45

相关推荐

联系我们

在线咨询: QQ交谈

邮件:442814395@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信公众号