Post by fugee ohu Post by Molly Bloom Post by fugee ohu
I wanna block all mail from domain .xyz so I added sender_checks hash to RECIPIENT restrictions and set .xyz REJECT but I continued to receive mail from the domain so I changed it to *.xyz REJECT and I still get mail from the domain Is my syntax wrong? Was I right to place it in recipient_restrictions?
I'm a newbie so please don't laugh at me too much. I think in this context you are the recipient, so maybe you should put restrictions on the senders.
Probably you have solved your problem already, could you answer me back and tell me the solution?
Thx in advance.
My understanding is that these are recipient_restrictions which refer to the sender_access file but I havne't solved this problem yet If I use a full domain like gmail.com then it works but I haven't been able to block from let's say all .xyz extensions I don't know if I'm supposed to use *.xyz or what
Not sure if that's the best way to do it but I've blocked various senders using wildcards with regex and Postfix' header_checks.
To block all .xyz domains, you could add the following line in a header_checks file:
/^From:.*\@.*\.xyz/ REJECT Your message is probably spam
and call it in main.cf with the following:
header_checks = regexp:/etc/postfix/header_checks
(assuming you created that file in /etc/postfix/header_checks)
Now, please consider that you might receive, one day, non-spam emails from a domain .xyz and you'll be rejecting it as a result of this rule.