There is a spamblock util for axMail. It’s handy to block spam.
Here can you get the program.
ftp://n1uro.ampr.org/pub/hamradio/linux-utils/spamblock-1.0.tar.gz
Read the INSTALL file carefully. If you do not have the line smtpd_client_restrictions in your main.cf you need to add it.
The complete rule is ….
smtpd_client_restrictions = check_client_access hash:/etc/postfix/access
Let test the program.
root@gw:/usr/local/src/spamblock# ./spamblock What ip or block do you wish to deny? 192.168.1.238 [info] Adding 192.168.1.238 to your postfix access file.... postfix/postfix-script: refreshing the Postfix mail system [ ok ] Block for: 192.168.1.238 is in place.
Now let test if you can send mail by postfix.
'pd2lt (@) zeelandnet.nl' op 7-12-2017 7:37 554 5.7.1 <test.packet-radio.net[192.168.1.238]>: Client host rejected: Access denied
Okay that just work quit well. Have a look in the file /etc/postfix/access
1.1.1.1 REJECT 2.2.2.2 REJECT 3.3.3.3 REJECT 192.168.1.238 REJECT
Delete the last line if you want to send e-mail. And “postfix reload”
For those running axMail-FAX, I have created an admin script I call spamblock. This creates a filter list within postfix of who you wish to connect to you and who NOT to connect to you. Especially this time of year spammers are at their worst trying to see you their grandmother to make a small coin... most of which is simply junk and abuse of bandwidth YOU pay for. Also, if you run axMail in a location who's rules are extremely strict about financial transactions on ham radio this will also help protect your users as well as yourself against unlawful communications. Instructions are in the INSTALL file. I strongly urge you to add blocks through whois lookups rather than single IPs as spammers tend to open up several servers within a data center so capturing their block protects you that much more. I'm of the mindset that any data center or block that has a spammer on it doesn't deserve the right to send me junk mail... and MY expense of bandwidth.