config files in /etc/postfix
logs in /var/log/maillot

postfix reload		# after doing changes to config files
postfix flush 		# churn thru the mail backlog ==? postqueue -f
mailq			# check the mailq  == postqueue -p
postsuper -d 6DF3D6A444 # remove a specific mail in the queue with the specified id
postsuper -d deferred   # remove all deferred mail (but not other errors).   CAREFUL!
postsuper -d ALL        # remove all queue mail (all those shown by mailq).  VERY CAREFUL!

postconf -d    # show default param for postfix 
postconf -d  | grep mydomain
postconf -d  | grep myhost 

postconf -n 		# to find out what settings are overruled by your , show what postfix parsed/took out of config file
postconf mail_version	# To find out what Postfix version you have, execute the command 

address rewritting bible :)

mascarade is to hide some early portion of the domain name, 
eg strip to

	# change domain address in both sender and recipient
	# main for username to first.last, 
	# but should be able to specify domain as in eg of sender-canonical
	# postmap ./canonical
	# postmap -q "string" ./canonical # ??
	# eg:

/etc/postfix/sender-canonical		# sender only, need to enable clause in  
	# eg content:
	# eg content 2:

/etc/postfix/recipient-canonical	# eg:	root
	eg2:    root

after update to the file, recreate hash (or dbm) as:
sudo postmap /etc/postfix/sender-canonical

Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what lookup tables Postfix supports, use the command "postconf -m".

Execute the command "postmap /etc/postfix/relay_recipient" whenever you change the relay_recipients table.
	eg of relay-canonical (tailing x means "checked" to allow domain to relay):         x

	# added additional domain on 2020.0718, 
        # but not likely needed, as all email, even those to, were forwarded to onward smtp server    x          x       x

Execute the command "postmap /etc/postfix/transport" whenever you change the transport table.

Example for cluster head node (which act as relay host for all compute nodes):

mydestination = $mydomain, $myhostname, localhost.$mydomain
mynetworks =,,
inet_interfaces = all
append_dot_mydomain = no
sender_canonical_maps = hash:/etc/postfix/sender-canonical
recipient_canonical_maps = hash:/etc/postfix/recipient-canonical
relayhost =
mydomain =
myorigin =

Example for node sending mail to be relayed. SASL auth is turned off, ok only for private network with no possible outside access.
mydestination = $mydomain, $myhostname, localhost.$mydomain   
relayhost =
mydomain = gretadev 
mynetworks = 
smtp_sasl_auth_enable = no
smtp_use_tls = no                # DOE special anyway :p


interesting command and script to delete deferred mail.

Copyright info about this work

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike2.5 License. Pocket Sys Admin Survival Guide: for content that I wrote, (CC) some rights reserved. 2005,2012 Tin Ho [ tin6150 (at) ]
Some contents are "cached" here for easy reference. Sources include man pages, vendor documents, online references, discussion groups, etc. Copyright of those are obviously those of the vendor and original authors. I am merely caching them here for quick reference and avoid broken URL problems.

Where is PSG hosted these days?