如何在 Postfix 中自动将收到的邮件密送至多个用户?

如何在 Postfix 中自动将收到的邮件密送至多个用户?

我正在尝试将一个虚拟电子邮件地址链接到两个不同的电子邮件地址:
[email protected]->[email protected][email protected]
这意味着发送到的邮件[email protected]也会被密送或转发到[email protected][email protected]

我在配置方面遇到了麻烦recipient_bbc_maps

# /etc/postfix/main.cf
recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc_map
# /etc/postfix/recipient_bbc_map
## This works
/^contact@example\.com$/ [email protected]

## This doesn't work
/^contact@example\.com$/ [email protected],[email protected]

该建议来自https://serverfault.com/a/183491,但它不起作用。Postfix
可以接收和发送消息,所以我知道到目前为止我的配置是好的。我做错了什么?

# /var/log/mail.log
postfix/qmgr[594770]: 309D64800B2: from=<[email protected]>, size=3250, nrcpt=2 (queue active)
postfix/local[594799]: 309D64800B2: to=<[email protected]>, relay=local, delay=0.02, delays=0.01/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
postfix/local[594799]: 309D64800B2: to=<[email protected], user2>, orig_to=<[email protected],[email protected]>, relay=none, delay=0.02, delays=0.01/0.01/0/0.01, dsn=5.1.3, status=bounced (bad address syntax)
postfix/qmgr[594770]: 309D64800B2: removed

答案1

错误信息非常清楚:

orig_to=<[email protected],[email protected]>
bad address syntax

您不能在 bcc-maps 中指定多个地址。

https://stackoverflow.com/questions/22537523/postfix-recipient-bcc-maps-multiple-recipients-how-to 解释如何解决此功能:

  • 创建虚拟地图以获取分发列表;
  • 发送密件抄送至 vmap

密件抄送将扩展到整个分发列表

#/etc/postfix/recipient_bcc_maps
[email protected]    [email protected]


#/etc/postfix/vmaps
[email protected]    [email protected],rcpt2.domain.tld,[email protected]

相关内容