Sandy Drobic wrote:
Jim Flanagan wrote:
Further to my post a few weeks or so ago, how do I block emails from being accepted by postfix. The emails in particular are from one of 2 different IP addresses. I suppose I could block only those 2, or perhaps the entire range if need be.
I read a bit on this in the docs, but am unsure if I should make a "hash" for it, or use canonical, and if so, how.
It doesn't really matter what type of lookup table you are using as long as your version of postfix knows how to handle the type.
"postconf -m" shows all supported lookup table types.
I do have a hash for check_recipient_access which is working great. But I don't know how to block a particular IP address for a sender.
Careful, "sender" in Postfix terms is the sender address in the smtp envelope in the MAIL FROM command. If you want to check the hostname or ip address of the sending server, use check_client_access.
I'm running Suse 10.0, mostly standard postfix. Many thanks for any pointers.
check_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_client_access hash:/etc/postfix/client_blacklist
/etc/postfix/client_blacklist: 1.2.3.4 554 rejected host due to amount of spam!
This example does not work if the sending client is in $mynetworks. Execute "postmap hash:/etc/postfix/client_blacklist" each time you edit the source file /etc/postfix/client_blacklist. Execute "postfix reload" each time you edit main.cf or master.cf.
Sandy Thanks Sandy,
I'll try this and report back. many thanks for the good advice. Jim Flanagan