Having Postfix relay and deliver locally for one domain?

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

Having Postfix relay and deliver locally for one domain?

Juerg Reimann
Sorry if this has been asked a 1000 times (but I couldn't find a hint). I
need to relay the majority of users of one domain to another postfix host,
except two users. How would I accomplish this?

Like: [hidden email] and [hidden email] local, all other users relay
to another host.

Thanks!
Juerg

Reply | Threaded
Open this post in threaded view
|

Re: Having Postfix relay and deliver locally for one domain?

Erwan David
Le 07/04/2016 20:19, Juerg Reimann a écrit :

> Sorry if this has been asked a 1000 times (but I couldn't find a hint). I
> need to relay the majority of users of one domain to another postfix host,
> except two users. How would I accomplish this?
>
> Like: [hidden email] and [hidden email] local, all other users relay
> to another host.
>
> Thanks!
> Juerg
>
>
I would setup a local delivery domain (let's say local.example.com) and
use virtual aliases for those users

Reply | Threaded
Open this post in threaded view
|

Re: Having Postfix relay and deliver locally for one domain?

Jan Ceuleers
In reply to this post by Juerg Reimann
On 07/04/16 20:19, Juerg Reimann wrote:

> Sorry if this has been asked a 1000 times (but I couldn't find a hint). I
> need to relay the majority of users of one domain to another postfix host,
> except two users. How would I accomplish this?
>
> Like: [hidden email] and [hidden email] local, all other users relay
> to another host.
>
> Thanks!
> Juerg
>

In /etc/postfix/main.cf:

virtual_alias_maps = hash:/etc/postfix/virtual

In /etc/postfix/virtual:

[hidden email] user1
[hidden email] user2

in which the 2nd column contains the local users to which to deliver
these emails.

Once you've created /etc/postfix/virtual and whenever you subsequently
change it, execute postmap /etc/postfix/virtual .

HTH, Jan
Reply | Threaded
Open this post in threaded view
|

Re: Having Postfix relay and deliver locally for one domain?

Wietse Venema
Jan Ceuleers:
[ Charset windows-1252 converted... ]

> On 07/04/16 20:19, Juerg Reimann wrote:
> > Sorry if this has been asked a 1000 times (but I couldn't find a hint). I
> > need to relay the majority of users of one domain to another postfix host,
> > except two users. How would I accomplish this?
> >
> > Like: [hidden email] and [hidden email] local, all other users relay
> > to another host.
> >
> > Thanks!
> > Juerg
> >
>
> In /etc/postfix/main.cf:
>
> virtual_alias_maps = hash:/etc/postfix/virtual
>
> In /etc/postfix/virtual:
>
> [hidden email] user1
> [hidden email] user2

Better to specify a domain name: [hidden email], etc.

        Wietse

> in which the 2nd column contains the local users to which to deliver
> these emails.
>
> Once you've created /etc/postfix/virtual and whenever you subsequently
> change it, execute postmap /etc/postfix/virtual .
>
> HTH, Jan
>
Reply | Threaded
Open this post in threaded view
|

Re: Having Postfix relay and deliver locally for one domain?

chaouche yacine
In reply to this post by Juerg Reimann
I'm no postfix expert, but I'm thinking out loud if this can be done by specifying an alias for those emails ? the alias would redirect the mail to another domain and get it delivered through the transport map for that domain.


On Thursday, April 7, 2016 7:23 PM, Juerg Reimann <[hidden email]> wrote:


Sorry if this has been asked a 1000 times (but I couldn't find a hint). I
need to relay the majority of users of one domain to another postfix host,
except two users. How would I accomplish this?

Like: [hidden email] and [hidden email] local, all other users relay
to another host.

Thanks!
Juerg