postfix 配置示例

yum install postfix

cat /etc/postfix/main.cf

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mta1.xxxx.com
mydomain = xxxx.com
myorigin = $mydomain
inet_interfaces = all
inet_protocols = ipv4
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
mynetworks = 10.10.10.10, 127.0.0.1
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
smtpd_banner = StartSSL ESMTP Server
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
broken_sasl_auth_clients = yes
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_security_options = noanonymous
message_size_limit = 5242880

yum install cyrus-sasl* #提供smtp的虚拟账户和密码服务
#sasldb2包含在saslauthd当中 就不要再问为什么没有安装sasldb2的shell代码了
#当前mta查看
alternatives --display mta
#设置mta
/usr/sbin/alternatives --set mta /usr/sbin/sendmail.postfix
#再次查看mta
alternatives --display mta
#输出结果最后一行会有类似如下的提示:mta即设置完毕
#Current `best' version is /usr/sbin/sendmail.postfix.

猜你喜欢

转载自blog.51cto.com/13718151/2107321