背景,网站通常需要一个电子邮件服务器,用于认证邮件真实性,给用户发送通知,订阅邮件等等。
这个邮件系统只需要外发邮件,并不需要接收邮件,配置如下。
[root@netkiller postfix]# postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix 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 home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = ipv4 mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man milter_default_action = accept milter_protocol = 2 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mydomain = netkiller.cn myhostname = mail.netkiller.cn mynetworks = 203.88.18.17, 202.130.11.34, 147.89.27.78, 219.90.13.18 myorigin = $mydomain newaliases_path = /usr/bin/newaliases.postfix non_smtpd_milters = $smtpd_milters queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES sample_directory = /usr/share/doc/postfix-2.10.1/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_milters = inet:127.0.0.1:8891 unknown_local_recipient_reject_code = 550
EDM服务器建议配置
postconf -e "default_destination_concurrency_limit=5" postconf -e "queue_run_delay = 12h" postconf -e "maximal_queue_lifetime = 1d"
首先投递目的主机不能并发太多,发送失败的邮件一天只需要重发一次就可以,隔天是吧队列直接抛弃无需保留。
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。