/etc/network/if-down.d/postfix - Ubuntu 12.04 LTS (Precise Pangolin)

This is the default example configuration of postfix provided by Postfix. This config file was generated by Postfix running on Ubuntu 12.04.

It is located under: /etc/network/if-down.d/postfix

    #!/bin/sh -e

# Called when an interface disconnects
# Written by LaMont Jones <lamont@debian.org>

# start or reload Postfix as needed

# If /usr isn't mounted yet, silently bail.
if [ ! -d /usr/lib/postfix ]; then
	exit 0
fi

RUNNING=""
# If master is running, force a queue run to unload any mail that is
# hanging around.  Yes, sendmail is a symlink...
if [ -f /var/spool/postfix/pid/master.pid ]; then
	pid=$(sed 's/ //g' /var/spool/postfix/pid/master.pid)
	exe=$(ls -l /proc/$pid/exe 2>/dev/null | sed 's/.* //;s/.*\///')
	if [ "X$exe" = "Xmaster" ]; then
		RUNNING="y"
	fi
fi

if [ ! -x /sbin/resolvconf ]; then
	f=/etc/resolv.conf
	if ! cp $f $(postconf -h queue_directory)$f 2>/dev/null; then
		exit 0
	fi
	if [ -n "$RUNNING" ]; then
		/etc/init.d/postfix reload >/dev/null 2>&1
	fi
fi

exit 0

    
  

Config Details

Location
/etc/network/if-down.d/postfix
Operating system
Ubuntu 12.04 LTS (Precise Pangolin)
Length
34 lines
MD5 checksum
52275dc23864f3bfca412c7558e28fe6

Usage

Download the raw file with wget or curl

Wget

wget -O postfix.example http://exampleconfig.com/static/raw/postfix/ubuntu12.04/etc/network/if-down.d/postfix

cURL

curl http://exampleconfig.com/static/raw/postfix/ubuntu12.04/etc/network/if-down.d/postfix > postfix.example