如果收件人看起来像[email protected] (即 gmail.com 域和地址的用户名部分中超过 3 个点)?
header_checks可以用于此目的还是仅用于 INCOMING 邮件?
下面是我服务器上 Postfix 的当前配置(postconf -n
输出)(我使用 virtual_alias_domains 来接受在我的专用服务器上托管为 Apache 虚拟主机的几个 Drupal 站点的邮件,我想停止为假用户发送注册邮件):
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
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_generic_maps = hash:/etc/postfix/generic
unknown_local_recipient_reject_code = 550
virtual_alias_domains = videoskat.de balkan-preferans.de simplex.ru preferans.de larissa-farber.de bukvy.de
virtual_alias_maps = hash:/etc/postfix/virtual
更新:
感谢 Jenny D,以下似乎有效
/etc/postfix/header_checks:
/^To: \S+\.\S+\.\S+\.\[email protected]$/i DISCARD
/etc/postfix/main.cf:
header_checks = pcre:/etc/postfix/header_checks
可以做到 - 请参阅postfix 文档以了解如何以及在何处使用各种类型的过滤器。
不过,在这种情况下,我建议最好在注册点捕获无效订阅,例如,对任何匹配“@google.com 前三个点”的帐户使用某种验证码。