CIDR format table in Postfix doesn't work.

in postfix •  7 years ago 

postfix.jpg

Postfix supports CIDR tables but it is not required to run postmap command on /etc/postfix/network_table file. CIDR format is just a text format. It is not required to transform it to another format. To enable a CIDR table, create a file with the network enties which should be allowed or denied access to the mail server

cat /etc/postfix/network_table 

Rule order matters. Put more specific whitelist entries

before more general blacklist entries.

127.0.0.0/8 OK
10.0.0.0/24 OK
192.168.0.0/24 OK
172.16.0.0/24 REJECT

Add following lines in /etc/postfix/main.cf

mynetworks = cidr:/etc/postfix/network_table
smtpd_client_restrictions = cidr:/etc/postfix/network_tabl

Restart postfix service

service postfix restart

For more information on cidr_table consult the man page man cidr_table.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hodor HODOR

Great. Thanks for sharing. I vote for you and begin to follow you. And Resteemed...