OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: source & destination based routing: When to decide where to go you need to go

From: Sandy Drobic (postfix-usersjapantest.homelinux.com)
Date: Mon Oct 02 2006 - 11:33:19 CDT


Fabio Pietrosanti wrote:
> Hi all,
>
> i am using postfix 2.3 doing source based routing with
> sender_dependent_relayhost_maps .
>
> I am using SQL table to do dynamic lookup and do routing based on source.
>
> I need to match in the sql query not only the Sender but also the
> Recipient because the database has to reply with the right smtp server
> by looking at the couple of From + To .
>
> Unfortunately the table in the sql statement allow me to only put a "%s"
> which match the Sender:
> sender_dependent_relayhost_maps =
> pgsql:/etc/postfix/virtual_source_based_transport.cf
>
> The query that's actually working is:
> "query = select fqdn from postfix_source_table where name = '%s';"
>
> I would like to make the routing decision be managed by something like that:
> "query = select fqdn from postfix_source_table where sender = '%sender'
> and recipient ='%recipient';"
>
> My postfix is managing emails which "ever" have only one recipient per
> email message so there's no chance to have more than one recipient.
>
> My problem is that i can make the routing decision only by matching both
> the sender and the recipient.
>
> There's a way to do that without having to write an smtp wrapper?
>
Depending on how many sender/recipient pairs you are doing this, you can
get away with using restriction classes. If that is too cumbersome, you
probably have to write a policy daemon for that.

Sandy
--
List replies only please!
Please address PMs to: news-reply2 () japantest (.) homelinux (.) com