Discussion:
block mail from domain
(too old to reply)
fugee ohu
2018-03-01 04:25:03 UTC
Permalink
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?
Molly Bloom
2018-06-06 10:34:10 UTC
Permalink
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.
fugee ohu
2018-10-24 15:18:26 UTC
Permalink
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
Pierre F.
2018-10-24 18:13:00 UTC
Permalink
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.
fugee ohu
2018-10-24 21:52:20 UTC
Permalink
Post by Pierre F.
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.
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.
Is sender_access not designed to restrict a domain extension? I realize it's weird to restrict by extension
fugee ohu
2018-10-24 22:21:36 UTC
Permalink
Post by Pierre F.
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.
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.
I placed that directive in sender_access and restarted postfix
fugee ohu
2018-10-25 07:35:52 UTC
Permalink
Post by Pierre F.
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.
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.
Trying it your way I'll let you know
fugee ohu
2018-10-26 17:17:43 UTC
Permalink
that didn't work, also i already have header_checks file

Loading...