On 2/21/2012 1:15 PM, Ed W wrote: > On 21/02/2012 18:41, Wietse Venema wrote: >> Martin Mielke: >>> mynetworks = hash:/etc/postfix/network_table >> ... >>> # postmap -q 1.2.3 /etc/postfix/network_table >>> OK >> ... >> Where does the POSTFIX documentation say that you can specify >> less than 4 octets in a mynetworks table? >> >> Wietse > > Perhaps it's just a typo on his side and he meant 1.2.3.4 as per his > question? > > The docs list a suggestion of a hash map for network_table: > http://www.postfix.org/postconf.5.html#mynetworks > > How would that actually work if you used a hashmap though? What > would the contents of the hash map actually look like..? > > I think you are saying that cidr map would make more sense here > anyway? Could/should the docs perhaps be updated to show that > suggestion? > > Thanks for postfix! > > Ed W
Unlike a client access table, a hash mynetworks table needs to list the entire IP, not just partial octects or a netmask. I think the docs are clear on the format required, but one must read carefully so as to not confuse the syntax with an access table, or with the supported plain text file format. # mynetworks hash table format # list each IP on its own line 2.3.4.4 Anything 2.3.4.5 Anything 2.3.4.6 Anything ... A cidr table makes more sense than a hash for mynetworks since you can list network/netmask rather than listing each individual IP. But for most sites (assuming localhost + a couple local network ranges), just listing the networks in-line in main.cf is easiest. -- Noel Jones