我有一个邮件服务器,它具有主要的MXlogging,这个邮件服务器处理所有的邮件收件箱和邮件进出邮箱。
我设置了第二个邮件服务器,它没有MXlogging,但仅充当服务器发送邮件,没有接收邮件。 这第二台服务器只是从一个网站发送邮件,这个网站在几个节点之间进行负载平衡,只有networking服务器节点有权从第二台邮件服务器发送邮件。
以上所有的工作都很好,我现在的问题是,当有人填写了网站上的联系表格,我发送邮件给提交表格的用户,我也发送表格的内容到一个信息邮件,所以网站是example.com,我发送一封邮件到[email protected],这里的问题是发送到[email protected]的电子邮件在本地服务器上处理,我希望它从第二个外部发送出去像任何其他邮件的邮件服务器。
邮件服务器是mail2.example.com 。
希望这是有道理的。
main.cf
myhostname = mail2.example.com mydomain = example.com myorigin = $mydomain mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain local_recipient_maps = unix:passwd.byname $alias_maps # Custom changes message_size_limit = 10485760 mailbox_size_limit = 0 always_add_missing_headers = yes # Server smtpd_tls_loglevel = 1 smtpd_tls_security_level = may smtpd_tls_cert_file = /etc/letsencrypt/live/mail2.example.com/fullchain.pem smtpd_tls_key_file = /etc/letsencrypt/live/mail2.example.com/privkey.pem smtpd_tls_CApath = /etc/letsencrypt/live/mail2.example.com smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3 smtpd_tls_protocols = !SSLv2,!SSLv3 smtpd_tls_mandatory_ciphers = high smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_tls_eecdh_grade = strong # Client smtp_tls_loglevel = 1 smtp_tls_security_level = may smtp_tls_cert_file = /etc/letsencrypt/live/mail2.example.com/fullchain.pem smtp_tls_key_file = /etc/letsencrypt/live/mail2.example.com/privkey.pem smtp_tls_CApath = /etc/letsencrypt/live/mail2.example.com smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtp_tls_mandatory_exclude_ciphers = MD5 , DES, ADH, RC4, SRP, 3DES, eNULL smtp_tls_mandatory_protocols = !SSLv2, !SSLv3 smtp_tls_protocols = !SSLv2,!SSLv3 smtp_tls_mandatory_ciphers = high
不像mc0e了解这个问题,似乎你没有设置辅助MX。 相反,您希望服务器( mail2 )像处理其他域一样处理example.com 。
解决scheme要简单得多:只需从您的mydestination移除$mydomain (即example.com ),即可:
mydestination = $myhostname, localhost.$mydomain, localhost
实际上,在replacevariables之后,与之相同:
mydestination = mail2.example.com, localhost.example.com, localhost
这也是mydestination的默认设置,所以删除整行也有相同的效果。
您错过了MX中继function的所有相关内容,所以我将引用您的权威来源:将Postfixconfiguration为远程站点的主要或备用MX主机 。