Postfix access
In this access_files.cfg example, we specify a Postfix access table (/etc/postfix/access). We have several different networks and wish to restrict mail to internal traffic only, hence all the #if ... #endif directives.
/////////////////////////////////////////////////////////////////////////////// // // access_files.cfg // /////////////////////////////////////////////////////////////////////////////// access path "/etc/postfix/access" mode 644 uid 0 gid 0 #if suse # ACCESS(5) ACCESS(5) # # NAME # access - format of Postfix access table # # SYNOPSIS # postmap /etc/postfix/access # [text omitted here for brevity] #endif 127.0.0.1 OK localhost.localdomain OK localhost OK #if mailserver earlymusichicago.org OK 192.168.4 OK 192.168.2 OK #else # if baksubnet 192.168.2 OK # endif # if earthlinksubnet 192.168.3 OK # endif # if roadrunnersubnet 192.168.4 OK # endif #endif ///////////////////////////////////////////////////////////////////////////////
On the piktmaster system, we would install the access file to the naples system with the command:
# piktc -iv +F access +H naples
Here is the resulting access file as installed on the naples system (on the backup and Road Runner subnets):
# ACCESS(5) ACCESS(5) # # NAME # access - format of Postfix access table # # SYNOPSIS # postmap /etc/postfix/access # [text omitted here for brevity] 127.0.0.1 OK localhost.localdomain OK localhost OK 192.168.2 OK 192.168.4 OK
For more examples, see Samples.