I'd like to black list an entire .domain rather than example.com I'm trying @*.domain to catch the spammers for example .today, .buzz, etc. Will with work that way?
to block an entire TLD like .pro, .bid,.top, etc... create one -pcre file, in example reject_domains.pcre and put the desired tld domains inside: Code: # nano /etc/postfix/reject_domains.pcre /\.top$/ DISCARD /\.pro$/ DISCARD /\.business$/ DISCARD /\.br$/ REJECT Sorry, temporarily rejected TLD .BR because spam you can see the difference in the last line: if you wish to give an explanation to the sender for some temporary situation, then use REJECT, and at the end of that same line you can write some explanation about that specific domain. Save and exit. Now edit /etc/postfix/main.cf and search the smtpd_sender_restrictions section to include this line: Code: # nano /etc/postfix/main.cf smtpd_sender_restrictions = check_sender_access pcre:/etc/postfix/reject_domains.pcre Save and exit Restart postifx: Code: # service postfix restart that's all
For anyone who finds this and wants to follow, note that sender restrictions will usually have a lot more items that just the single one shown. Probably you can just insert this in the front of your existing list.