Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SMTPD Client Restrictions hash vs. cidr

Status
Not open for further replies.

isbellb1

IS-IT--Management
Sep 23, 2005
1
US
I'm running Postfix mail_version = 2.2.5 over RedHat Enterprise 3

I've recently had the need to create a blocked list based on a range of IP's. Currently I'm using a hash file to add single IP's and domain names I want to block. I've not been able to add ranges of IP's.

i.e. 1.2.3.4/25
or
1.2.3.4 thru 1.2.3.10

What I did was create a .cidr file with a /25 inside that I want to block. Now I have 2 lists to maintain, which i'd like to avoid.

My question is, can I block ranges of ip's in hash files without having to list all the addresses.


Here is the relevant part of the main.cf

smtpd_client_restrictions =
check_client_access hash:/etc/postfix/blocked_hosts.hash,
check_client_access cidr:/etc/postfix/blocked_hosts.cidr,
permit_mynetworks,
permit

inside blocked_hosts.hash

1.2.3.4 553 Blocked
domain.com 553 Blocked


inside blocked_hosts.cidr

1.2.3.4/25 REJECT


Any advice would be appreciated.


Baraq Isbell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top