Le 29/11/2010 19:22, Stirling, Scott a écrit :
What I have not found and am for which I am requesting help, if
anyone has a pointer or experience in this area, is the ability
to combine the sender_dependent configuration with a recipient
condition. Is there a straightforward way to configure this?
Or do I need to script a custom filter? Or ...?
Postfix has no recipient-dependent (required here since a message
may have multiple recipients) mechanism of selecting the nexthop in a
sender dependent way.
Thanks, Victor. OK, good to know.
This requires a second internal delivery hop.
The first to separate out the recipients or senders that are
candidates
for bypassing Postini into a separate queue, and the second to route
appropriate mail from that queue, either to Postini or not, based
on the remaining criterion.
Sounds like one option would be to setup a separate Postfix instance and
relay to it in sendmail based on Sender (using something like this
sendmail mod, http://anfi.homeunix.net/sendmail/smarttab.html).
The final step is to include/exclude that incoming mail for delivery to
either Postini or not based on the recipient's address. Is
recipient-based alternate routing possible once the Sender aspect is
resolved with the additional internal hop? Any pointers?
it's much easier than that!
[two instances]
otherwise, follow Viktor suggestion and use two instances (run postfix
twice, with different configurations).
the first instance sender_dependent_... to route mail from
f...@sub.example.com to the second instance.
the second instance has a transport entry to route .bar.net to
smtp.abc.exaple.org, and a relay host to route the rest to postini postini.
[single instance]
if you want to play with a single instance, here is an ugly and UNTESTED
idea:
start 2 smtpd listeners: one on 25 (standard) and one one say 25001.
A) on the standard smtpd, use
check_sender_access hash:/etc/postfix/access_sender
== access_sender
f...@sub.example.com FILTER relay:[127.0.0.1]:25001
B) for the 25001 listener, setup a specific cleanup to rewrite the
recipient with a specific virtual_alias_maps:
/^(.*)@(.*\.bar\.net)$/ $...@deviate.$2
C) setup a transport entry
deviate.bar.net smtp:[smtp.abc.example.org]
D) create a generic entry to rewrite recipient address back:
/^(.*)@deviate\.(.*\.bar\.net)$/ $...@$2
yeah, a bit convoluted....