首頁  >  文章  >  系統教程  >  CentOS6安裝postfix並設定sasl的具體方法

CentOS6安裝postfix並設定sasl的具體方法

王林
王林轉載
2024-04-15 14:30:01573瀏覽

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的具體方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:linuxprobe.com。如有侵權,請聯絡admin@php.cn刪除