After searching for many hours I cannot find a solution to a problem I have with a new Postfix server I'm deploying. I'm are in the process of decommissioning old on-prem Exchange servers which are used for STMP relay from internal systems and moving to Postfix 3.6.4.
One of our requirements to is archive all email to an external system. Currently in Exchange that is done with envelope journaling and works fine. With Postfix I added auto_bcc in main.cf and it works fine for emails with recipients in TO and CC fields but not BCC. When a recipient is in the BCC field the archiving system only shows the TO, and CC if present, addresses.
Here is a telnet test I ran:
EHLO internal.com
AUTH LOGIN
xxxxxxxxxxxx
xxxxxxxxxxxx
mail from:[email protected]
rcpt to:[email protected]
rcpt to:[email protected]
data
subject: bcc test
from:[email protected]
to:[email protected]
bcc:[email protected]
test
.
And the excerpt from mail.log for it:
Jun 23 11:10:01 postfixnj01 postfix/smtpd[240320]: input attribute value: 97EAA60BDC
Jun 23 11:10:01 postfixnj01 postfix/smtpd[240320]: 97EAA60BDC: client=unknown[xxx.xxx.xxx.xxx], sasl_method=LOGIN, [email protected]
Jun 23 11:13:06 postfixnj01 postfix/cleanup[240335]: 97EAA60BDC: message-id=<>
Jun 23 11:13:06 postfixnj01 postfix/smtpd[240320]: > unknown[xxx.xxx.xxx.xxx]: 250 2.0.0 Ok: queued as 97EAA60BDC
Jun 23 11:13:06 postfixnj01 postfix/qmgr[239735]: 97EAA60BDC: from=<[email protected]>, size=484, nrcpt=3 (queue active)
Jun 23 11:13:06 postfixnj01 postfix/smtp[240350]: 97EAA60BDC: to=<[email protected]>, relay=smtp.sendgrid.net[xxx.xxx.xxx.xxx]:587, delay=189, delays=188/0.01/0.32/0.05, dsn=2.0.0, status=sent (250 Ok: queued as xuBwFSO5RcOjf_e3depptQ)
Jun 23 11:13:06 postfixnj01 postfix/smtp[240350]: 97EAA60BDC: to=<[email protected]>, relay=smtp.sendgrid.net[xxx.xxx.xxx.xxx]:587, delay=189, delays=188/0.01/0.32/0.05, dsn=2.0.0, status=sent (250 Ok: queued as xuBwFSO5RcOjf_e3depptQ)
Jun 23 11:13:06 postfixnj01 postfix/smtp[240350]: 97EAA60BDC: to=<[email protected], relay=smtp.sendgrid.net[xxx.xxx.xxx.xxx]:587, delay=189, delays=188/0.01/0.32/0.05, dsn=2.0.0, status=sent (250 Ok: queued as xuBwFSO5RcOjf_e3depptQ)
Jun 23 11:13:06 postfixnj01 postfix/qmgr[239735]: 97EAA60BDC: removed
It shows both the TO and CC as TO recipients, along with the auto_bcc address.
When looking the archive system, I see two emails bit both have the TO recipient, [email protected], as the only recipient. No log of BCC at all.
In the SendGrid, which we are using for Internet mail relay, activity log I see three separate entries for this email, all to the correct recipients. This is only logging the headers though and not the content.
When running the same test with CC instead of BCC all works ok.
Is there a way to have postfix accurately log the BCC recipient using the auto_bcc feature? If not is there another feature that can achieve this?