On Wed, Apr 29, 2015 at 03:23:20PM +1100, J?r?me Alet wrote:

> I've tried several combinations of your suggestions, but now
> unfortunately delivery doesn't work anymore (it used to, as explained
> previously) : newu...@backend2.example.com is always rejected as unknown
> in local recipient table.

You've not explained how you intend to manage mailboxes, or shown any
details of your configuration.  My advice was correspondingly sketchy.

If you want to use local(8) delivery, you need to list users in
local_recipient_maps and/or arrange for mailbox_transport or similar
if users don't have system accounts.

> This is because the real email address is newu...@example.com and not
> newu...@backend2.example.com

There's no such thing as a "real" email address.  There are only
routing rules that deliver mail to the right mail store.

> In my original message, to simplify my question I didn't mention that
> Backend2 also hosts 3 subdomains of example.com, and that the
> virtual_mailbox_maps is computed with an LDAP query, so of course
> newu...@backend2.example.com is not found in our LDAP directory...

You can adapt the LDAP query.  You made no mention of LDAP before.

The basic idea is to associate with each user a mailbox address in
addition to their primary email address.  Then match either.  You
may need to provision additional addresses in LDAP as you migrate
users.

> Now I understand I shouldn't have tried to simplify the original
> question because probably there were missing informations in it, sorry
> for this...

Indeed.

> So we're back to the drawing board, here's my actual configuration
> (before your suggestions), as-is (only domain names changed) :
> 
> Server1's transport :
> --- CUT ---
> # Not migrated yet :
> sub1.example.com                        relay:[backend1.example.com]
> sub2.example.com                        relay:[backend1.example.com]
> sub3.example.com                        relay:[backend1.example.com]
> example.com                             relay:[backend1.example.com]
> # Migrated mailboxes :
> newus...@sub1.example.com               relay:[backend2.example.com]
> newus...@sub2.example.com               relay:[backend2.example.com]
> newus...@sub3.example.com               relay:[backend2.example.com]
> newu...@example.com                     relay:[backend2.example.com]
> --- CUT ---

Well you're going out of your way to create a loop, in which mail for
us...@example.com is sent by the centrall mailhub to the mailstore
host, but you want that host to send such mail back to the mailhub.

The solution is to distinguish between mail to the virtual primary
domain, and mail to the underlying mailboxes.

This needs to be worked out in detailed, and tested with care.  Changes
in supporting tables may be required.

-- 
        Viktor.

Reply via email to