Mailinglist Archive: opensuse (4498 mails)

< Previous Next >
Re: [SLE] How do I block certain senders in Postfix?
  • From: Sandy Drobic <suse-linux-e@xxxxxxxxxxxxxxxxxxxxxxx>
  • Date: Wed, 1 Nov 2006 19:47:10 +0000 (UTC)
  • Message-id: <4548F99F.7080909@xxxxxxxxxxxxxxxxxxxxxxx>
Jim Flanagan wrote:
Sandy Drobic wrote:
Jim Flanagan wrote:

/etc/postfix/client_blacklist: 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 or

I did as you indicated above, and that seems to be working fine. Would
it also be correct to reject a block of IP numbers in the format of It this correct?

No, you can't do that in Postfix. Postfix can handle ip address ranges only in certain ways.

hash: Hash tables can only match the whole string
regexp/pcre: Lots of ways to match string parts, but not ip specific
cidr Match against address classes in cidr notation

So either use a pcre map like:
/1\.2\.3/ 554 blacklisted ip range

Little correction here:
/^1\.2\.3/ 554 blacklisted ip range

Otherwise you might also catch any address ending in xxx.1.2.3 with that expression.

or use a cidr map like: 554 blacklisted ip range

With a cidr map you need to describe the address ranges in cidr notation, in neccessary, break down the desired ip range into several cidr notations.


Thanks Sandy,

Will read up on IP nomenclature and proceed with this. Many thanks for the great help.

For this case the cidr notation is the most appropriate.


List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com

< Previous Next >