I am trying to test if my postfix access files are working properly (to block spammers) but I am getting different results based on if I create a regular expression access file or a hash access file.
Here is my regular expression access file:
/@spammer.com$/ DISCARD
Here is my hash access file:
spammer.com DISCARD
I am testing their validity using the postmap -vq
command but getting differing results.
Regexp:
$ postmap -vq [email protected] regexp:/etc/postfix/sender_access_regexp
postmap: name_mask: all
postmap: inet_addr_local: configured 4 IPv4 addresses
postmap: inet_addr_local: configured 4 IPv6 addresses
postmap: dict_open: regexp:/etc/postfix/sender_access_regexp
postmap: dict_regexp_lookup: /etc/postfix/sender_access_regexp: [email protected]
DISCARD
Hash:
$ postmap -vq [email protected] hash:/etc/postfix/sender_access
postmap: name_mask: all
postmap: inet_addr_local: configured 4 IPv4 addresses
postmap: inet_addr_local: configured 4 IPv6 addresses
postmap: Compiled against Berkeley DB: 5.3.28?
postmap: Run-time linked against Berkeley DB: 5.3.28?
postmap: dict_open: hash:/etc/postfix/sender_access
The regular expression access file reports a DISCARD
but the hash access file does not. Is my hash file not working, am I not validating the files correctly?