If I get it, the virtual alias change to another domain then the smtp_generic_maps change back to the original domain ? It works fine.

I played with it and I'd like something generic because we don't have knowledge of all remaining adresses on the old mail.

I can set the smtp_generic like this:

@oldmx.abc.com @abc.com

But I can't do the same for the virtual alias (it changes email in all my local users to oldmx.abc.com and sends directly to the old server). Is there a solution to map any unknown user without providing emails in virtual aliases ?

Thank you

Le 07/06/2023 à 17:00, Wietse Venema via Postfix-users a écrit :
J?r?me BECOT via Postfix-users:
Hello,

I know that this may have been asked a few times, but I need some help:

I manage a server for the domain abc.org. The mx points to my server and
it is configured to:

- lookup virtual mailboxes and virtual aliases from LDAP
- send mails to dovecot

It works, but I'd like to handle recipients that does not exist in LDAP
(nor in Dovecot) and forward them to an older server, that used to own
the domain:

j...@abc.com  > exists in LDAP > delivered to Dovecot
jdaniel > does not exists in LDAP > forwarded to oldmx.abc.com

I have unsuccessfully tried to:

- add a hashed tranport map in virtual_transport_maps
- add it in transport_maps
That would fail with "User Unkonwn" errors.

You need a virtual alias:

/etc/postfix/main.cf:
     virtual_alias_maps = hash:/etc/postfix/virtual_alias

/etc/postfix/virtual_alias
     jdan...@abc.com  usern...@oldmx.abc.com

(or LDAP equivalent).

DO NOT add oldmx.abc.com to main.cf:virtual_alias_domains.

In the case that oldmx.abc.com rejects mail for
usern...@oldmx.abc.com, you also need:

/etc/postfix/main.cf:
     smtp_generic_maps = hash:/etc/postfix/smtp_generic

/etc/postfix/smtp_generic:
     usern...@oldmx.abc.com  usern...@abc.com

(or LDAP equivalent).

        Wietse
_______________________________________________
Postfix-users mailing list --postfix-users@postfix.org
To unsubscribe send an email topostfix-users-le...@postfix.org
--
*Jérôme BECOT*<https://www.deveryware.com>
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to