Thank you it works fine !
Here is what I did (I'd like your confirmation on the first that I do
not make a mistake):
- added the virtual_mailbox_maps LDAP config to virtual_alias_maps as
well (thus generating $u...@abc.com -> $u...@abc.com alias, letting the
rule match)
- let only @abc.com @oldmx.abc.com rule in the virtual_alias file
- added the smtp_recipient_restriction rule
This way:
- Sending a mail to some...@abc.com delivers locally if the mail exists
- Forwards to some...@oldmx.abc.com rewriting recipient back to
some...@abc.com (smtp_generic_maps)
- Delivers locally on oldmx.abc.com if the mail exists
- Fails on abc.com with Recipient address rejected: User unknown (in
reply to RCPT TO command) if the mail does not exists on oldmx.abc.com
Regards
Jerome
Le 08/06/2023 à 22:12, Wietse Venema via Postfix-users a écrit :
J?r?me BECOT via Postfix-users:
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 ?
You will have to enumerate (all the the oldmx recipients), or (all
the abc recipients that should not be forwarded to oldmx).
1 - Enumerate virtual aliases for 'oldmx' users, as in my first response.
2 - All of the following: a) Enumerate all the abc users with 1:1
virtual aliases (u...@abc.com ->u...@abd.com), b) use one wildcard
virtual alias (@abc.com -> @oldmx.abc.com) that forwards everything
else to oldmx.abc.com, c) use smtp_generic_maps as in my first
response, and d) use reject_unverified_recipient to avoid accepting
non-existent recipients.
Wietse
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 emailtopostfix-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 topostfix-users-le...@postfix.org
_______________________________________________
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