Multiple deliveries to different servers

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple deliveries to different servers

Gerald V. Livingston II-2
I currently use a postfix + amavis + spamassassin + clamav gateway
feeding to my primary postfix + courier mail server.

I'm going to move a domain or two over to google apps/gmail but I want
to keep the old servers online for a while.

Is there a write up somewhere that would explain how I can make two
copies of every incoming message get delivered? One copy into the amavis
pipe (which delivers to my internal server) and another, identical,
unfiltered copy out to an external google smtp server.

Thanks,

Gerald
Reply | Threaded
Open this post in threaded view
|

Re: Multiple deliveries to different servers

mouss-2
Gerald Livingston wrote:

> I currently use a postfix + amavis + spamassassin + clamav gateway
> feeding to my primary postfix + courier mail server.
>
> I'm going to move a domain or two over to google apps/gmail but I want
> to keep the old servers online for a while.
>
> Is there a write up somewhere that would explain how I can make two
> copies of every incoming message get delivered? One copy into the
> amavis pipe (which delivers to my internal server) and another,
> identical, unfiltered copy out to an external google smtp server.


use virtual_alias_maps:
[hidden email]      [hidden email], [hidden email]

(either use a script to generate this, or use mysql/....).


alternatively, use recipient_bcc_maps (with pcre for example).



Reply | Threaded
Open this post in threaded view
|

Re: Multiple deliveries to different servers

Gerald V. Livingston II-2
mouss wrote:

> Gerald Livingston wrote:
>> I currently use a postfix + amavis + spamassassin + clamav gateway
>> feeding to my primary postfix + courier mail server.
>>
>> I'm going to move a domain or two over to google apps/gmail but I want
>> to keep the old servers online for a while.
>>
>> Is there a write up somewhere that would explain how I can make two
>> copies of every incoming message get delivered? One copy into the
>> amavis pipe (which delivers to my internal server) and another,
>> identical, unfiltered copy out to an external google smtp server.
>
>
> use virtual_alias_maps:
> [hidden email]      [hidden email], [hidden email]
>
> (either use a script to generate this, or use mysql/....).
>
>
> alternatively, use recipient_bcc_maps (with pcre for example).

(mouss, sorry about sending this direct to you instead of to the list
earlier)

I'm already using MySQL to handle users.

aliases won't work. There are no "different" addresses

[hidden email] = [hidden email]

Same username/email address in both places. The messages really need to
look identical as they go to the final amavis and google pipes. No extra
bcc headers or anything else.

The idea is to leave the old server in place and still receiving as I
get customers to fix settings on their email clients and get them
adjusted to the new webmail interface.

The amavis gateway that I'm setting up is currently handling only a
single domain so I won't have to use pcre to determine WHICH messages to
send out twice -- it will be ALL messages that come in. I just need to
figure out how to make them go two places.

Gerald

Reply | Threaded
Open this post in threaded view
|

Re: Multiple deliveries to different servers

mouss-2
Gerald Livingston wrote:

> mouss wrote:
>> Gerald Livingston wrote:
>>> I currently use a postfix + amavis + spamassassin + clamav gateway
>>> feeding to my primary postfix + courier mail server.
>>>
>>> I'm going to move a domain or two over to google apps/gmail but I
>>> want to keep the old servers online for a while.
>>>
>>> Is there a write up somewhere that would explain how I can make two
>>> copies of every incoming message get delivered? One copy into the
>>> amavis pipe (which delivers to my internal server) and another,
>>> identical, unfiltered copy out to an external google smtp server.
>>
>>
>> use virtual_alias_maps:
>> [hidden email]      [hidden email], [hidden email]
>>
>> (either use a script to generate this, or use mysql/....).
>>
>>
>> alternatively, use recipient_bcc_maps (with pcre for example).
>
> (mouss, sorry about sending this direct to you instead of to the list
> earlier)
>
> I'm already using MySQL to handle users.
>
> aliases won't work. There are no "different" addresses
>
> [hidden email] = [hidden email]

virtual aliases do not rewrite the message. only the envelope recipient
is rewritten, and the envelope recipient is more or less invisible to
the recipient.

but if you insist on having the same envelope recipient, you can still
use generic to rewrite the recipient back to original form:
[hidden email]      [hidden email]

The idea is that virtual aliases are expanded before transports while
generic rewrite happens after transport.
>
> Same username/email address in both places. The messages really need
> to look identical as they go to the final amavis and google pipes. No
> extra bcc headers or anything else.

both virtual aliases and bcc options leave the message as it is. they
act on the envelope recipient. there is no bcc header or any header
rewrite.

BTW, do this after content filtering. there is no reason to duplicate
the message before the filter.

Since transports are based on the envelope recipient, you cannot
duplicate the message without rewriting the recipient and pass both
copies to postfix, because they will then be delivered to the same place.

an alternative is to write a "tee" proxy that directly sends a copy to
the remote site (bypassing postfix) while letting the local copy go
through postfix. but this requires work!

(yet another alternative is to setup a bsd box with ipfilter and use its
copyto feature. but this also requires some work).
>
> The idea is to leave the old server in place and still receiving as I
> get customers to fix settings on their email clients and get them
> adjusted to the new webmail interface.
>
> The amavis gateway that I'm setting up is currently handling only a
> single domain so I won't have to use pcre to determine WHICH messages
> to send out twice -- it will be ALL messages that come in. I just need
> to figure out how to make them go two places.

the pcre in the recipient bcc option allows you to have a single line to
do the bcc, instead of doing this in mysql or generating all the
mappings. do not do this with virtual aliases though (wildcard aliases
break recipient validation and lead to backscatter).