On Thu, 20 Dec 2018 at 11:19, d tbsky <tbs...@gmail.com> wrote: > Dominic Raferd <domi...@timedicer.co.uk> > > > > On Thu, 20 Dec 2018 at 09:22, d tbsky <tbs...@gmail.com> wrote: > >> > >> hi: > >> I want to bcc all mails for archive purpose. one kind of mail is > like below: > >> > >> outside user (a...@gmail.com) mail to -> postfix alias with settings > >> to forward outside (myal...@example.com) -> forward to outside user > >> (b...@gmail.com) > >> > >> "always_bcc" and "recipient_bcc_maps" won't capture mails to " > b...@gmail.com". > >> > >> "sender_bcc_maps" could capture the mail, but the whole mail didn't > >> have any header information about "b...@gmail.com". > >> > >> can I write "sender_bcc_maps" to reveal the information about " > b...@gmail.com"? > >> or there are other method I can use to record the mail and envelope > >> information? > > > > > > In the scenario you describe I believe always_bcc should capture the > email: i.e. where email originates from outside and is relayed to outside. > It works for me. > > "always_bcc" will only capture mail from a...@gmail.com -> > myal...@example.com, but not myal...@example.com -> b...@gmail.com. > although it is the same mail. > but seems "always_bcc" didn't capture it, it won't know the > information about b...@gmail.com and reveal it at email header or other > place I think. > "sender_bcc_maps" will capture from myal...@example.com -> > b...@gmail.com, but I don't know how to let "sender_bcc_maps" reveal > "b...@gmail.com" in header or some other method to me. >
The incoming email is saved by always_bcc, why is it important to save it again when it is relayed (still I presume with the same 'To:' header, but different envelope recipient) to gsmtp? You can find some information about the relay transaction in the mail log (smtp). Example: 2018-12-20 11:27:56 streamingbats postfix/smtp[25382]: 3241861963: to=< annbridgeha...@gmail.com>, orig_to=<a...@streamingbats.co.uk>, relay= gmail-smtp-in.l.google.com[108.177.15.26]:25, delay=0.86, delays=0.06/0.02/0.26/0.52, dsn=2.0.0, status=sent (250 2.0.0 OK 1545305276 i15si6765428wrp.144 - gsmtp)