postfix mail hub/gateway? Possible to split users in the same domain?

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

postfix mail hub/gateway? Possible to split users in the same domain?

linux-45
Hello postfix experts,

I have one exchage server serving domain doom.com which now is
overloaded and has a lot of other problems. Our option is to move all
accounts on linux. Unfortunately, for the momment, this thing is not possible
because not all accounts which reside on exchange server can be moved on
linux (there are users which are using exchange feature like calendar,
meeting, etc). In this case, we designed a solution which contain 3 mx
servers (2 linux, plus the old one on M$)

First linuxbox should act as mailhub for other 2 mx servers behind it (the old
one exchange + another new one on linux).

We want that our linux mailhub to route mails for some accounts
([hidden email] ... [hidden email]) to exchange server and for other accounts
([hidden email] ... [hidden email]) to route emails to our new linuxbox
behind it.

I read about transport maps and relay maps, and seems that what i want is
possible, but i dont know how to configure our linux mailhub to do that.

For example, i would like to have someting like:

in transport_maps = hash:/etc/postfix/transport

and in /etc/postfix/transport to split and route emails:

#for user1 up to userk, forward to old_exchange_mta
[hidden email] smtp:old_exchange_mta.dom.com:25
[hidden email] smtp:old_exchange_mta.dom.com:25
...
[hidden email] smtp:mta_vechi_din_lan.dom.com:25

#for rest of our accounts (userk1 up to userkn), forward to new_linux_mta
[hidden email] smtp:new_linux_mta.com:25
[hidden email] smtp:new_linux_mta.com:25
...
[hidden email] smtp:new_linux_mta.com:25

Of course, sintax above seems to be invalid, transport maps accepting sintax
just for an entire domain (doom.com smtp:forward_mta:25). So my question is,
how can i do that and which postfix directive should be used in order to
route emails as explainded above? An example is wellcome too :-)


Thanks in advance,
Alx
Reply | Threaded
Open this post in threaded view
|

Re: postfix mail hub/gateway? Possible to split users in the same domain?

Wietse Venema
Alex:
> For example, i would like to have someting like:
>
> in transport_maps = hash:/etc/postfix/transport
>
> and in /etc/postfix/transport to split and route emails:
>
> #for user1 up to userk, forward to old_exchange_mta
> [hidden email] smtp:old_exchange_mta.dom.com:25
...
> #for rest of our accounts (userk1 up to userkn), forward to new_linux_mta
> [hidden email] smtp:new_linux_mta.com:25
...
>
> Of course, sintax above seems to be invalid, transport maps accepting sintax
> just for an entire domain (doom.com smtp:forward_mta:25).

As documented in the transports(5) manual page, this syntax is
valid since Postfix 2.0.

See http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall,
and use per-user transport map entries.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: postfix mail hub/gateway? Possible to split users in the same domain?

Sahil Tandon
In reply to this post by linux-45
Alex <[hidden email]> wrote:
 
[...]

> We want that our linux mailhub to route mails for some accounts
> ([hidden email] ... [hidden email]) to exchange server and for other
> accounts ([hidden email] ... [hidden email]) to route emails to our
> new linuxbox behind it.
>
> I read about transport maps and relay maps, and seems that what i want is
> possible, but i dont know how to configure our linux mailhub to do that.
>
> For example, i would like to have someting like:
>
> in transport_maps = hash:/etc/postfix/transport
>
> and in /etc/postfix/transport to split and route emails:
>
> #for user1 up to userk, forward to old_exchange_mta
> [hidden email] smtp:old_exchange_mta.dom.com:25
> [hidden email] smtp:old_exchange_mta.dom.com:25
> ...
> [hidden email] smtp:mta_vechi_din_lan.dom.com:25
>
> #for rest of our accounts (userk1 up to userkn), forward to new_linux_mta
> [hidden email] smtp:new_linux_mta.com:25
> [hidden email] smtp:new_linux_mta.com:25
> ...
> [hidden email] smtp:new_linux_mta.com:25
>
> Of course, sintax above seems to be invalid, transport maps accepting
> sintax just for an entire domain (doom.com smtp:forward_mta:25). So my
> question is, how can i do that and which postfix directive should be
> used in order to route emails as explainded above? An example is wellcome
> too :-)

Actually, "user@domain transport:nexthop" (as in your example above) is
acceptable transport syntax.  You may want to enclose your nexthop in
brackets (i.e. [new_linux_mta]) to avoid unnecessary MX lookups.  And you
needn't specify :25 as it is the default; simply smtp:[new_linux_mta.com]
should suffice.  For more information on transport maps, see the transport(5)
manual or http://www.postfix.org/transport.5.html.  

--
Sahil Tandon <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: postfix mail hub/gateway? Possible to split users in the same domain?

Ed Wildgoose-2
Sahil Tandon wrote:

> Alex <[hidden email]> wrote:
>  
> [...]
>
>  
>> We want that our linux mailhub to route mails for some accounts
>> ([hidden email] ... [hidden email]) to exchange server and for other
>> accounts ([hidden email] ... [hidden email]) to route emails to our
>> new linuxbox behind it.
>>
>> I read about transport maps and relay maps, and seems that what i want is
>> possible, but i dont know how to configure our linux mailhub to do that.
>>    

Also note that the transport map syntax is incredibly flexible and reads
all kinds of files including sql dbs, regexps and ldap.  You may find
that you can lookup your users in active directory, or a simple regexp
might split all your users, or a simple db... (or a text file!)

Good luck

Ed W
Reply | Threaded
Open this post in threaded view
|

Re: postfix mail hub/gateway? Possible to split users in the same domain?

linux-45
In reply to this post by Wietse Venema
> > #for rest of our accounts (userk1 up to userkn), forward to new_linux_mta
> > [hidden email] smtp:new_linux_mta.com:25
>
> ...
>
> > Of course, sintax above seems to be invalid, transport maps accepting
> > sintax just for an entire domain (doom.com smtp:forward_mta:25).
>
> As documented in the transports(5) manual page, this syntax is
> valid since Postfix 2.0.
>
> See http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall,
> and use per-user transport map entries.
>
>  Wietse

Thanks Wietse for clarification. I tried it on
postfix-2.3.3-2.el5.centos.mysql_pgsql before to post here but seems that i
was superficially and not performed any debug on my configuration thinking
that i am wrong when i used above sintax. Now i know for sure that i'm on the
right way...

Thanks again,
Alx
Reply | Threaded
Open this post in threaded view
|

Re: postfix mail hub/gateway? Possible to split users in the same domain?

linux-45
In reply to this post by Ed Wildgoose-2
On Saturday 05 July 2008 17:37, Ed W wrote:

> Sahil Tandon wrote:
> > Alex <[hidden email]> wrote:
> >
> > [...]
> >
> >> We want that our linux mailhub to route mails for some accounts
> >> ([hidden email] ... [hidden email]) to exchange server and for other
> >> accounts ([hidden email] ... [hidden email]) to route emails to our
> >> new linuxbox behind it.
> >>
> >> I read about transport maps and relay maps, and seems that what i want
> >> is possible, but i dont know how to configure our linux mailhub to do
> >> that.
>
> Also note that the transport map syntax is incredibly flexible and reads
> all kinds of files including sql dbs, regexps and ldap.  You may find
> that you can lookup your users in active directory, or a simple regexp
> might split all your users, or a simple db... (or a text file!)
>

Yes, i know... indeed, you read my mind. My intention is to use mysql as
backend and use a gui to manage sql accounts. I know that are some scripts
used to read via ldap from AD and sincronize our mailhub accounts with those
located on M$ exchange server. First, i want to be sure that i am on the
right way...

Thanks again to you and to Sahil for clarifications...

Regards,
Alx