Am 18.10.2017 um 14:54 schrieb Tavolodo Bela: > Hello, > > I have a mail server running postfix, and another server running an email > archive software > which can talk smtp. > > Postfix is configured to pass a copy of each emails to the archive, using > always_bcc = someuser@archive > > When an email is received it's copied to the archive properly, so far, so > good. > > Now the problem: I have several customers and domains hosted on the mail > server. > When customer1 sends an email to customer2, then the email appears only in > customer2's > archive (it's a multitenant solution). > > I've managed to narrow the issue, and it seems that the problem is that the > archive identifies the customer with the rcpt to: (=envelope) address, eg. > > EHLO aaa.fu > MAIL FROM: <no-reply@...> > RCPT TO: <customer2@archive> > ... > > Thus the archive doesn't matches this email with customer1 as well. > > So my question is that is it possible that when customer1 sends an email to > customer2 > then to send a bcc email to customer1@archive address, and another to > customer3@achive > address? > > Thank you, > > Bela
try this (braindump, I'll post an update tomorrow if I'm wrong...) pcrefile: /^(.+)\@(.+)$/ someuser+$1_at_$2@archive transport_maps: archive smtp_to_archive: main.cf: recipient_bcc_maps = pcre:/path/to/pcrefile transport_maps = hash:/path/to/transport_maps smtp_to_archive_destination_recipient_limit = 1 master.cf smtp_to_archive unix - - - - - smtp -o syslog_name=postfix/to_archive with this setup message to multiple recipients are duplicated. Andreas