Tag Archives: config

Sync MailScanner and postfix config (simple script)

If you have multiple mail relays and are (like me) using postfix and MailScanner here is a (very) simple bash script to cynronize the configs. Just put it in your crontab.
SERVER=server.domain.tld
# Sync files for postfix
/usr/bin/rsync root@$SERVER:/etc/postfix/main.cf /etc/postfix/main.cf
/usr/bin/rsync root@$SERVER:/etc/postfix/relay_domains /etc/postfix/relay_domains
/usr/bin/rsync root@$SERVER:/etc/postfix/relay_recipients /etc/postfix/relay_recipients
/usr/bin/rsync root@$SERVER:/etc/postfix/sender_access /etc/postfix/sender_access
/usr/bin/rsync root@$SERVER:/etc/postfix/transport /etc/postfix/transport
/usr/bin/rsync root@$SERVER:/etc/postfix/virtual /etc/postfix/virtual
# postmap

/usr/sbin/postmap /etc/postfix/relay_domains
/usr/sbin/postmap /etc/postfix/relay_recipients
/usr/sbin/postmap /etc/postfix/sender_access
/usr/sbin/postmap /etc/postfix/transport
/usr/sbin/postmap /etc/postfix/virtual

# sync files [...]