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
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