Postfix virtual_alias 和 Recipient_delimiter 转发

Postfix virtual_alias 和 Recipient_delimiter 转发

请帮我设置 Postfix,我已将 Recipient_delimiter 设置为 .(点),并想使用以下规则转发电子邮件:

[email protected] -> [email protected]
[email protected] -> [email protected]
[email protected] -> [email protected]

等等。

但是当我发送电子邮件到[电子邮件保护],它转发到[电子邮件保护]

我怎样才能阻止这种行为?

主文件:

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = .
inet_interfaces = all
inet_protocols = all

virtual_alias_domains = example.com
virtual_alias_maps = hash:/etc/postfix/virtual
sender_canonical_maps = tcp:127.0.0.1:10001
sender_canonical_classes = envelope_sender
recipient_canonical_maps = tcp:127.0.0.1:10002
recipient_canonical_classes = envelope_recipient

虚拟的:

@example.com [email protected]

答案1

默认情况下,不匹配的扩展(即分隔符右侧的内容)将传播到规范和虚拟的右侧(请参阅文档)。因此,虚拟表达式的右侧会得到扩展,就像您看到的那样。

因此,如果是虚拟的,您应该在左侧指定完全匹配(即带有扩展名),或者propagate_unmatched_extensions通过在配置文件中明确指定来删除虚拟。

相关内容