On Wed, Apr 29, 2015 at 11:18:47AM +1100, J?r?me Alet wrote:

> For a few users only, we are planning to have, in addition to
> the setup above :
> 
>   Internet ==> MX ==> Server1 ==> Backend2
>   Internet <== Server1 <== Backend2
> 
> Where Backend2 is a Debian Wheezy machine hosting Postfix 2.9.6
> 
> So we've modified our transports on Server1 to read something like :
> 
>   example.com           relay:[Backend1-IP]
>   newu...@example.com   relay:[Backend2-IP]
>   ...

Replace this (on Server1) with a rewriting configuration:

    virtual:
        newu...@example.com     newu...@backend2.example.com

    transport:
        example.com             relay:[backend1.example.com]
        backend1.example.com    relay
        backend2.example.com    relay

> In particular we want that messages from "newu...@example.com" (migrated
> to Backend2) to "any...@example.com" (not migrated yet from Backend1 to
> Backend2) still pass through Server1. In fact, even a message from
> "newu...@example.com" to "newu...@example.com" should still pass through
> Server1.
> 
> Unfortunately Postfix on Backend2 tries to deliver such messages
> locally, instead of forwarding them to Server1 first.

On "Backend2":

    main.cf:
        mydomain = example.com
        myorigin = $mydomain
        relayhost = [server1.example.com]

        # Uncomment one of the below.  Set the other to what remains
        # after removing $myhostname:
        #
        # mydestination = $myhostname, localhost, localhost.$mydomain
        # virtual_mailbox_domains = $myhostname

Mail to the domain goes to the smarthost, and from there dispatched
to the right account (via rewriting).


> On Backend2 mydestination is defined as :
> 
>    mydestination = example.com, backend2.example.com,
>                    localhost.localdomain, localhost

Looks like you're using local(8) delivery, I'd like to strongly
urge you to go with virtual(8) (or similar, e.g. Dovecot IMAP)
delivery for a new installation.  Avoid local(8) mailboxes.  Use
local(8) only for mailing lists large enough to need owner-aliases.

-- 
        Viktor.

Reply via email to