Hello.
I need to test valid sender address.
I have created a rule in main.cf :
smtpd_sender_login_maps = pcre:/etc/postfix/sender_login_maps.pcre
smtpd_sender_restrictions =
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_sender_login_mismatch
THe file '/etc/postfix/sender_login_maps.pcre' contain :
/^[a-zA-Z0-9.-]+@troll-hathor.nwk$/ ${1}
When I try the regex in some internet site (Match an email address - Regex Tester/Debugger), I got a null result for a bad string
first.name@mon_domain.com@mon_domain.com
which return
NULL
and I got the initial string for a good string
first.name@mon_domain.com
which return :
first.name@mon_domain.com
When testing the rule with postfix, a bad string
sudo postmap -f -q first.name@mon_domain.com@mon_domain.com pcre:/etc/postfix/sender_login_maps.pcre
return :
first.name@mon_domain.com
A good string :
sudo postmap -f -q first.name@mon_domain.com pcre:/etc/postfix/sender_login_maps.pcre
return :
first.name
I am expecting a null string if the sender must be rejected.
It seems to be a rewrite functionality.
I want the mail rejected (not send if the sender is rejected)
Any help is welcome.