![如何在 Postfix 中自动将收到的邮件密送至多个用户?](https://linux22.com/image/774156/%E5%A6%82%E4%BD%95%E5%9C%A8%20Postfix%20%E4%B8%AD%E8%87%AA%E5%8A%A8%E5%B0%86%E6%94%B6%E5%88%B0%E7%9A%84%E9%82%AE%E4%BB%B6%E5%AF%86%E9%80%81%E8%87%B3%E5%A4%9A%E4%B8%AA%E7%94%A8%E6%88%B7%EF%BC%9F.png)
我正在尝试将一个虚拟电子邮件地址链接到两个不同的电子邮件地址:
[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]