bcc emails to two addresses

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

bcc emails to two addresses

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
Reply | Threaded
Open this post in threaded view
|

Re: bcc emails to two addresses

Matus UHLAR - fantomas
On 18.10.17 14:54, Tavolodo Bela wrote:
>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?

Have you tried sender_bcc_maps and recipient_bcc_maps with different bcc
recipients for multiple customers?

--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
If Barbie is so popular, why do you have to buy her friends?
Reply | Threaded
Open this post in threaded view
|

Re: bcc emails to two addresses

A. Schulze
In reply to this post by Tavolodo Bela


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
Reply | Threaded
Open this post in threaded view
|

Re: bcc emails to two addresses

A. Schulze

A. Schulze:

> (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
>

it's simpler.
you do not need a separate transport to enforce destination_recipient_limit=1

pcrefile:
   /(.+)@(.+)/ someuser+${1}_at_${2}@archive
   /(.*)/      someuser+${1}@archive

main.cf:
   recipient_bcc_maps = pcre:/path/to/pcrefile

Andreas




Reply | Threaded
Open this post in threaded view
|

Re: bcc emails to two addresses

Matus UHLAR - fantomas
>A. Schulze:
>
>>(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

On 19.10.17 17:01, A. Schulze wrote:
>it's simpler.
>you do not need a separate transport to enforce destination_recipient_limit=1
>
>pcrefile:
>  /(.+)@(.+)/ someuser+${1}_at_${2}@archive
>  /(.*)/      someuser+${1}@archive
>
>main.cf:
>  recipient_bcc_maps = pcre:/path/to/pcrefile

does it need pcre at all?
I thought simply having different destination domains in recipient_bcc_maps
(hash: style map) should be enough...

--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Support bacteria - they're the only culture some people have.
Reply | Threaded
Open this post in threaded view
|

Re: bcc emails to two addresses

Tavolodo Bela
On 19.10.17 17:01, A. Schulze wrote:
it's simpler.
you do not need a separate transport to enforce destination_recipient_limit=1

pcrefile:
 /(.+)@(.+)/ someuser+${1}_at_${2}@archive
 /(.*)/      someuser+${1}@archive

main.cf:
 recipient_bcc_maps = pcre:/path/to/pcrefile


Thank you Andreas, I'll check your solution.

Bela