Thanks for the proposals, the main problem is accounts names and domains could be totally different. I'm reconsidering this approach to add only selected accounts to able to cross domains, simplifing automation and increasing security. Although it requires more config for client.

Thanks a lot.

El 5/5/22 a las 15:23, Wietse Venema escribió:
V?ctor Rubiella Monfort:
Hello,

I'm working on a map for restrict MAIL_FROM declared on mail based on
sasl user authenticated.

For example if we want that all accounts for domain @domain1.com can
define MAIL_FROM @domain1.com and @domain2.com accounts:

@[email protected] [email protected] [email protected] [email protected] @[email protected] [email protected] [email protected] [email protected]
Perhaps you can use reject_sender_login_mismatch with

main.cf:
     smtpd_sender_login_maps = pcre:$config_directory/sender-login.pcre

sender-login.pcre
     /^(.+)@domain1\.example$/  [email protected] [email protected]
     /^(.+)@domain2\.example$/  [email protected] [email protected]

Assuming that the usernames are the same in different domains.

        Wietse

Reply via email to