Relay using both transport and sender_dependent_relayhost_maps

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

Relay using both transport and sender_dependent_relayhost_maps

Pete-25
Hi,

i've sent this email previouly today but since i didn't get it i
assume i didn't do things right. If it's duplicated i'm sorry.

I need to implement a mecanism which will route mail based on source
domain and destination domain.

The specific need is for routing mail for two diferent fax servers
from two companies sharing the same mail server (but diferent email
domains) based on the sender domain, using a single mail relay

If mail comes from user@domain_aaaa and destination fax_x@domain_cccc relay to
host X, if mail comes from user@domain_bbbb and destination fax__y@domain_cccc
relay to host Y.

I have transport rules and sender_dependent_relayhost_maps, just don't
know how to create a rule that will tie these together, without
affecting all other relay and
smtp transport rules.

Can someone give some hints on how to do this ?

Thanks
--
Pete
Reply | Threaded
Open this post in threaded view
|

Re: Relay using both transport and sender_dependent_relayhost_maps

Wietse Venema
Pete:

> Hi,
>
> i've sent this email previouly today but since i didn't get it i
> assume i didn't do things right. If it's duplicated i'm sorry.
>
> I need to implement a mecanism which will route mail based on source
> domain and destination domain.
>
> The specific need is for routing mail for two diferent fax servers
> from two companies sharing the same mail server (but diferent email
> domains) based on the sender domain, using a single mail relay
>
> If mail comes from user@domain_aaaa and destination fax_x@domain_cccc relay to
> host X, if mail comes from user@domain_bbbb and destination fax__y@domain_cccc
> relay to host Y.

And what about different users or destinations? You covered only
a few of the possibilities.

src\dst fax_x fax__y other
domain_aaaa  X        ?      ?
domain_bbbb       ?        Y      ?
other             ?        ?      ?

        Wietse

> I have transport rules and sender_dependent_relayhost_maps, just don't
> know how to create a rule that will tie these together, without
> affecting all other relay and
> smtp transport rules.
>
> Can someone give some hints on how to do this ?
>
> Thanks
> --
> Pete
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Relay using both transport and sender_dependent_relayhost_maps

Wietse Venema
Wietse Venema:

> Pete:
> > Hi,
> >
> > i've sent this email previouly today but since i didn't get it i
> > assume i didn't do things right. If it's duplicated i'm sorry.
> >
> > I need to implement a mecanism which will route mail based on source
> > domain and destination domain.
> >
> > The specific need is for routing mail for two diferent fax servers
> > from two companies sharing the same mail server (but diferent email
> > domains) based on the sender domain, using a single mail relay
> >
> > If mail comes from user@domain_aaaa and destination fax_x@domain_cccc relay to
> > host X, if mail comes from user@domain_bbbb and destination fax__y@domain_cccc
> > relay to host Y.
>
> And what about different users or destinations? You covered only
> a few of the possibilities.
>
> src\dst       fax_x   fax__y  other
> domain_aaaa       X        ?      ?
> domain_bbbb       ?        Y      ?
> other             ?        ?      ?

According to private email, that description was not correct.

All users, regardless of their source domain, specify FAX destinations
as phone-number@fixed-domain-name, where the fixed-domain-name is the
same for everyone.

This is not supported in Postfix.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Relay using both transport and sender_dependent_relayhost_maps

Pete-25
I was thinking about an alternative solution to this problem and
thought about a not so elegant solution that i'de like to share with
you and obtain your comment.

Postfix allows for the sender_dependent_relayhost_maps, using that
feature i could setup a new mail relay with the porpuse of holding
these rules.

Acording to destination domain (phone-number@fixed-domain-name)
transport rules, the present relay would relay to the new one that
would relay to the fax servers according to the sender rules.

Not an elegant solution but faster to implement while i have'nt
another solution.

I included a copy of the email i've previously sent you to share with
other that might encounter this type of need.

Thanks for your quick reply.
Pete

--------------------------------------------

Other destinations would need to be handled by transport
(/etc/postfix/transport) as usual.

I'm sorry i forgot one important information.

Fax has a special domain (@fax.com), mails to fax are sent in the
form of [hidden email].

The rule needed would be something like:

src                    dst                         next hop
@domain_aaaa     @fax.com           smtp:faxserver1
@domain_bbbb     @fax.com           smtp:faxserver2
                           @otherdomain1    smtp:someotherserver1
                           @otherdomain2    smtp:someotherserver2
                            *                         smtp:internet_relay_server

This is a would be /etc/postfix/transport map where src and dst would
be "and" not "or" for this case.

faxserver1, faxserver2, someotherserver1, someotherserver2,
internet_relay_server are hosts that would be resolved by DNS servers
(in this case internal DNS not internet) or configured by IP address.

Thanks
Pete

On Thu, Jun 5, 2008 at 1:09 AM, Wietse Venema <[hidden email]> wrote:

> Wietse Venema:
>> Pete:
>> > Hi,
>> >
>> > i've sent this email previouly today but since i didn't get it i
>> > assume i didn't do things right. If it's duplicated i'm sorry.
>> >
>> > I need to implement a mecanism which will route mail based on source
>> > domain and destination domain.
>> >
>> > The specific need is for routing mail for two diferent fax servers
>> > from two companies sharing the same mail server (but diferent email
>> > domains) based on the sender domain, using a single mail relay
>> >
>> > If mail comes from user@domain_aaaa and destination fax_x@domain_cccc relay to
>> > host X, if mail comes from user@domain_bbbb and destination fax__y@domain_cccc
>> > relay to host Y.
>>
>> And what about different users or destinations? You covered only
>> a few of the possibilities.
>>
>> src\dst       fax_x   fax__y  other
>> domain_aaaa       X        ?      ?
>> domain_bbbb       ?        Y      ?
>> other             ?        ?      ?
>
> According to private email, that description was not correct.
>
> All users, regardless of their source domain, specify FAX destinations
> as phone-number@fixed-domain-name, where the fixed-domain-name is the
> same for everyone.
>
> This is not supported in Postfix.
>
>        Wietse
>



--
Pete
Reply | Threaded
Open this post in threaded view
|

Re: Relay using both transport and sender_dependent_relayhost_maps

mouss-2
Pete wrote:

> I was thinking about an alternative solution to this problem and
> thought about a not so elegant solution that i'de like to share with
> you and obtain your comment.
>
> Postfix allows for the sender_dependent_relayhost_maps, using that
> feature i could setup a new mail relay with the porpuse of holding
> these rules.
>
> Acording to destination domain (phone-number@fixed-domain-name)
> transport rules, the present relay would relay to the new one that
> would relay to the fax servers according to the sender rules.
>
> Not an elegant solution but faster to implement while i have'nt
> another solution.
>
> I included a copy of the email i've previously sent you to share with
> other that might encounter this type of need.
>
> Thanks for your quick reply.
> Pete
>
> --------------------------------------------
>
> Other destinations would need to be handled by transport
> (/etc/postfix/transport) as usual.
>
> I'm sorry i forgot one important information.
>
> Fax has a special domain (@fax.com), mails to fax are sent in the
> form of [hidden email].
>
> The rule needed would be something like:
>
> src                    dst                         next hop
> @domain_aaaa     @fax.com           smtp:faxserver1
> @domain_bbbb     @fax.com           smtp:faxserver2
>                            @otherdomain1    smtp:someotherserver1
>                            @otherdomain2    smtp:someotherserver2
>                             *                         smtp:internet_relay_server
>
> This is a would be /etc/postfix/transport map where src and dst would
> be "and" not "or" for this case.
>
> faxserver1, faxserver2, someotherserver1, someotherserver2,
> internet_relay_server are hosts that would be resolved by DNS servers
> (in this case internal DNS not internet) or configured by IP address.
>  

you can run an instance to handle @fax.example domain. your current
instance would relay all @fax.example to this new instance using
transport_maps. then in the "fax" instance, use sender dependent relayhost.

an alternative is to write a content_filter that rewrites the recipient
(@fax.com) based on sender. for example, if sender is in domain_aaaa and
recipient is in @fax.com, the recipient address would be changed to
@domain_aaaa.fax.com. then transport_maps are enough to redirect to the
right server. you can use generic to rewrite the recipient to its
original form.
Reply | Threaded
Open this post in threaded view
|

Re: Relay using both transport and sender_dependent_relayhost_maps

Wietse Venema
In reply to this post by Pete-25
Pete:
> I was thinking about an alternative solution to this problem and
> thought about a not so elegant solution that i'de like to share with
> you and obtain your comment.
>
> Postfix allows for the sender_dependent_relayhost_maps, using that
> feature i could setup a new mail relay with the porpuse of holding
> these rules.

You would need a machine that receives all mail for the shared
faxdomain, configure the fax machines as relay_domains, and then
use sender_dependent_relayhost_maps there.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Relay using both transport and sender_dependent_relayhost_maps

Pete-25
Thank you and mouss,

I guess i'll take the alternative o setting up a new server.

For the requirements we have a virtual machine will do the job, setup
linux, post fix and the sender _dependent-.relayhost_maps.

This will give me time to figure out how to setup another instance of
postfix on the same physical host.

Thanks
Pete

On Thu, Jun 5, 2008 at 4:34 PM, Wietse Venema <[hidden email]> wrote:

> Pete:
>> I was thinking about an alternative solution to this problem and
>> thought about a not so elegant solution that i'de like to share with
>> you and obtain your comment.
>>
>> Postfix allows for the sender_dependent_relayhost_maps, using that
>> feature i could setup a new mail relay with the porpuse of holding
>> these rules.
>
> You would need a machine that receives all mail for the shared
> faxdomain, configure the fax machines as relay_domains, and then
> use sender_dependent_relayhost_maps there.
>
>        Wietse
>



--
Pete