大网数据广告活动
服务器运维问答

How do I automatically BCC received mail to multiple users in Postfix?

· 52CE 我爱测

I am trying to link up a dummy email address to two different email addresses: [email omitted] -> [email omitted] and [email omitted] This would mean that mail sent to [email omitted] would also get BCC'd or forwarded to [email o…

问题原文

原帖链接 · Kārlis Čerņavskis · CC BY-SA 4.0

I am trying to link up a dummy email address to two different email addresses:
[email omitted] -> [email omitted] and [email omitted]
This would mean that mail sent to [email omitted] would also get BCC'd or forwarded to [email omitted] and [email omitted]

I am having trouble with the recipient_bbc_maps config:

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

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

The suggestion was taken from https://serverfault.com/a/183491, but it doesn't work.
Postfix can receive and send messages, so I know that my config is good so far. What am I doing wrong?

# /var/log/mail.log
postfix/qmgr[594770]: 309D64800B2: from=<[email omitted]>, size=3250, nrcpt=2 (queue active)
postfix/local[594799]: 309D64800B2: to=<[email omitted]>, 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 omitted], user2>, orig_to=<[email omitted],[email omitted]>, 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

已采纳解答

原帖链接 · Gaétan RYCKEBOER · CC BY-SA 4.0

The error message is pretty clear:

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

You cannot specify multiple addresses in a bcc-maps.

https://stackoverflow.com/questions/22537523/postfix-recipient-bcc-maps-multiple-recipients-how-to explains how to workaround this feature:

  • create a virtual map to have the distribution list ;
  • send BCC to the vmap

The Bcc will be expanded to the whole distribution list

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


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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-01-19)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。