From: "Sandy Drobic"
david rankin wrote: List, Sandy:
I'm trying to do this (from man 5 access):
EXAMPLE The following example uses an indexed file, so that the order of table entries does not matter. The example permits access by the client at address 1.2.3.4 but rejects all other clients in 1.2.3.0/24. Instead of "hash" lookup tables, some systems use "dbm". Use the command "post- conf -m" to find out what lookup tables Postfix supports on your sys- tem.
/etc/postfix/main.cf: smtpd_client_restrictions = check_client_access hash:/etc/postfix/access
/etc/postfix/access: 1.2.3 REJECT 1.2.3.4 OK
So I did this:
main.cf: smtpd_client_restrictions = check_client_access hash:/etc/postfix/client_check
[root@bonza postfix]# cat client_check 218 REJECT 221 REJECT
postmap client_check postfix reload
But for some reason, it does not work as expected. It does this:
[root@bonza postfix]# postmap -q 221 hash:client_check REJECT [root@bonza postfix]# postmap -q 221.1.1.1 hash:client_check [root@bonza postfix]# postmap -q 221.2.1.1 hash:client_check
AHAH! It does work as man 5 access says. HOWEVER, it does NOT work with
postmap -q. Go figure? Here is a log entry with the
hash:/etc/postfix/client_check
Jul 11 23:50:20 bonza postfix/smtpd[27538]: NOQUEUE: reject: RCPT from
unknown[218.12.90.19]: 554