2

Basically this is the setup I am currently using:

virtual_alias_maps
  x1 x2

recipient_bcc_maps
  x2 x3

When I send an e-mail to x1, I expect it to be forwarded to x2, and then copied to x3, but what happens instead is the email comes up to x2 and then it is not copied further to x3.

This happens because the recipient field of the forwarded email's header (original mail from:x1 -> rcpt to:x2) doesn't contain x2, so x2 cc table is not checked..

Did anyone had experience with a situation like the above?

Thanks, M F

2 Answers2

2

If anyone has a similar problem, I solved it by switching entirely from recipient_bcc_maps to virtual_alias_maps.

The config is:

main.cf
virtual_alias_maps = mysql:/etc/postfix/sqlconf/virtual_mailbox_maps.cf

virtual_mailbox_maps.cf
user            = vmail
password        = password
dbname          = mails
query           = SELECT concat(u.username,'@',u.domain) FROM users u WHERE u.username='%u' AND u.domain='%d' AND u.active='1' and u.type=0 UNION SELECT n.address FROM users u LEFT JOIN next n ON n.id = u.id WHERE u.username='%u' AND u.domain='%d' AND u.active='1';
hosts           = 127.0.0.1

Basically, if message should be forwarded then don't include current account, otherwise if it should be carbon copied, then include current account in the list of addresses where the message should be delivered

1

That's expected behavior because of how message headers are processed.

You would want to use this bcc map of you need original content for x1 to bcc x3, unless you want to use always_bcc if x3 is like an archive/abuse monitoring mailbox.

x1 x3
x2 x3 
Jacob Evans
  • 8,431