In the current blacklist table it is possible to add domains, but not a TLD by itself (doesn't work)
As stated here: https://serverfault.com/questions/72864 ... fix/728658
Is it needed to install postfix-pcre in order to filter for TLD in sender restrictions?
I need to stop anything coming from *.online or *.click
These are all spam mail for us.
postfix-pcre?
- shawniverson
- Posts: 3644
- Joined: 13 Jan 2014 23:30
- Location: Indianapolis, Indiana USA
- Contact:
Re: postfix-pcre?
That is one way to do it.
Another way is to create custom spamassassin rules that assign a high score for those TLDs.
Another way is to create custom spamassassin rules that assign a high score for those TLDs.
Re: postfix-pcre?
Ah, never thought of that!
Might be the better option.
Will dig into that and see how it is done.
Tnx!
Might be the better option.
Will dig into that and see how it is done.
Tnx!
Re: postfix-pcre?
Created a file:/etc/mail/spamassassin/z_TLD.cf
# add points if the From address is not a valid host in a listed TLD
header LOCAL_FROM_TLD From !~ /@[a-z0-9\-\.]+\.(com|org|net|nl|uk)/i
describe LOCAL_FROM_TLD From address is not a valid host in a listed TLD
score LOCAL_FROM_TLD 4.5
This is now working fine. It ads 4.5 to spamscore whenever it is not a .com/.net/.org/etc...
From here we can tweak it further.
# add points if the From address is not a valid host in a listed TLD
header LOCAL_FROM_TLD From !~ /@[a-z0-9\-\.]+\.(com|org|net|nl|uk)/i
describe LOCAL_FROM_TLD From address is not a valid host in a listed TLD
score LOCAL_FROM_TLD 4.5
This is now working fine. It ads 4.5 to spamscore whenever it is not a .com/.net/.org/etc...
From here we can tweak it further.
Re: postfix-pcre?
Had to change it as the regex wasn't working properly.
Created a file:/etc/mail/spamassassin/z_TLD.cf
Created a file:/etc/mail/spamassassin/z_TLD.cf
Code: Select all
# add points if the From address is not a valid host in a listed TLD
header LOCAL_FROM_TLD From !~ /@.{1,}\.(com|eu|nl|net|nu|co\.uk)/i
describe LOCAL_FROM_TLD Sender is not a valid host in approved TLD list
score LOCAL_FROM_TLD 6