Overall goal:
Block specific emails with have "a name" included in their FROM envelope. Example: John <[email protected]>
Current situation:
I have successfully configured the main.cf
of Postfix to utilize check_sender_access
in smtpd_recipient_restrictions
.
I have created my own sender_access
file, used postmap on it, so it generates sender_access.db, which is used then by main.cf
.
My sender_access file looks like this:
[email protected] REJECT
[email protected] REJECT
This configuration does works as intended and rejects the email when somebody sends an inbound email with "clear" FROM envelope (Example: FROM: [email protected]
):
This configuration does not work and reject the email when the sender has set a "name" which appears in the FROM envelope (Example: FROM: John <[email protected]>
or FROM: Support <[email protected]>
):
The configuration "does not catch" the email address either when the "name" is the same as the email address (some default behavior in some MTA /mail transfer agents/):
What I have tried:
I have tried a sender_access file with the following formatting:
[email protected] REJECT
John <[email protected]> REJECT
"John <[email protected]>" REJECT
John REJECT
<[email protected]> REJECT
"[email protected]" REJECT
john@ REJECT
None of these have practically worked. The only thing which works is if I reject the entire domain:
example.com REJECT
My question:
I have been searching for two days now, tried many articles and finally decided to ask here. Does Postfix support blocking of senders with FROM in the format John <[email protected]>
?
Do I need to try some regex (interestingly, I didn't found any - one would think this is something commonsense?).
P.S: Perhaps something which always "catches" the email address inside the brackets in bold:
John <[email protected]>
Thank you!