On 2023-11-17 Колесников Александр via Postfix-users wrote: > I'm testing a new server. This is part of the config: > > master.cf: > ~~~~ > > 127.0.0.1:27 inet n - n - - smtpd > -o syslog_name=postfix/$service_name > -o smtpd_delay_reject=no > -o > smtpd_sender_restrictions=pcre:/etc/postfix/senders_cgp.pcre,reject_non_fqdn_sender,reject > > ~~~~~ > > /etc/postfix/senders_cgp.pcre: > > /^\S+\@domain\.com$/ OK > /^\S+\@host\.domain\.com$/ OK > /^<>$/ OK > /.*/ reject [...] > /etc/postfix > telnet localhost 27 > Connected to localhost. > Escape character is '^]'. > 220 domain.com ESMTP Postfix [...] > mail from: w.w > 250 2.1.0 Ok > rset > 250 2.0.0 Ok > mail from: w@w.w > 554 5.7.1 <w@w.w>: Sender address rejected: Access denied [...] > Connection closed by foreign host. > > Why does postfix accept mail from an incorrect sender address similar to > "w.w"? > What am I doing wrong?
You seem to assume that "mail from: w.w" would refer to the domain "w.w", but it actually specifies a localpart "w.w". Postfix then appends its own domain ($myorigin, presumably "domain.com") to this localpart. Hence the sender address effectively becomes "w...@domain.com", which is allowed. As a side note: Please avoid making up arbitrary domain names for examples. There are official domains reserved specifically for this purpose. See RFC 2606[1] for details. [1]: <https://www.rfc-editor.org/rfc/rfc2606.html> Regards Ansgar Wiechers -- "Abstractions save us time working, but they don't save us time learning." --Joel Spolsky _______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org