我们的电子邮件域名托pipe在Google Apps(@ contoso.com)中,我们只使用Postfix作为电子邮件转寄给我们的内部服务以发送。
我们的Postfixconfiguration是相当简单的,它只是从一个开箱即用的Ubuntuconfiguration作为“互联网网站与Smarthost”稍微调整,我会postconf -n下面。
我遇到的问题是我将Postfix服务器放入负载均衡器,负载均衡器正在通过尝试成功发送电子邮件来检查服务器的可用性。 我真的不想收集任何这些电子邮件 – 而我所看到的经常使用的是发送邮件到/ dev / null这是我正在做的,但已经unsuccesfull。 我试图编辑我的/ etc / aliases文件,并试图做virtual_alias_maps,但没有得到它的工作 – 我知道这是可能的,但我的实现显然是不正确的。 现在我已经取消了我的尝试,只是在尝试之前做了这个,所以这里是我现在的configuration:
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no config_directory = /etc/postfix inet_interfaces = all inet_protocols = all mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 mydestination = mail.contoso.com, localhost.localdomain, localhost myhostname = mail.contoso.com mynetworks = 10.0.0.0/8 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname readme_directory = no recipient_delimiter = + relayhost = smtp-relay.gmail.com smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_helo_restrictions = warn_if_reject check_helo_access static:reject smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes
任何帮助得到这个工作,将不胜感激 – 记住这个Postfix服务器只用作邮件中继,负载平衡器试图发送电子邮件说,从[email protected]到(插入任何电子邮件地址在这里,例如: )[email protected]。 当Postfix服务器处理这个,而不是把这个消息中继到互联网,我想它发送到本地到/ dev / null。
提前致谢!
你应该在你的/ etc / alias文件中有这个:
devnull: /dev/null
所以发送给[email protected]的邮件被发送到/ dev / null。 如果你有虚拟域的设置,那么你将不得不在虚拟域映射中这样做:
<user>@contoso.com devnull
devnull是在/ etc / aliases文件中设置的用户。
确保在更新/ etc / aliases之后重build文件:
sudo newaliases