Making Postfix config changes on the fly

This example shows how to update the aliases path so we have this standard across all machines in a datacentre, this is a quick hack method. The correct way to fix this in a production would be to use a configuration management system like chef/puppet or cfengine.

    export PATH
## Show the existing aliases paths
    postconf | grep '^alias'
## Make the changes to
    postconf -e alias_maps='dbm:/etc/mail/aliases'
    postconf -e alias_database='dbm:/etc/mail/aliases'
## Make new aliases database
## Show aliases paths just to make sure things have been updated
    postconf | grep '^alias'
## send test email to self
    uname -a | mailx -s "`uname -n`" pcanham@`uname -n`