summaryrefslogtreecommitdiffstats
path: root/debian/ip-up.d
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 12:06:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 12:06:34 +0000
commitee6407728fa3cc43b32f69e88a4e0a5d28dc5235 (patch)
tree4e907e01937587036a967edc4b7aea8ba6f5df6e /debian/ip-up.d
parentAdding upstream version 3.5.24. (diff)
downloadpostfix-ee6407728fa3cc43b32f69e88a4e0a5d28dc5235.tar.xz
postfix-ee6407728fa3cc43b32f69e88a4e0a5d28dc5235.zip
Adding debian version 3.5.24-0+deb11u1.debian/3.5.24-0+deb11u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/ip-up.d')
-rw-r--r--debian/ip-up.d44
1 files changed, 44 insertions, 0 deletions
diff --git a/debian/ip-up.d b/debian/ip-up.d
new file mode 100644
index 0000000..49581b0
--- /dev/null
+++ b/debian/ip-up.d
@@ -0,0 +1,44 @@
+#!/bin/sh -e
+# Called when a new interface comes up
+# Written by LaMont Jones <lamont@debian.org>
+
+# don't bother to restart postfix when lo is configured.
+if [ "$IFACE" = "lo" ]; then
+ exit 0
+fi
+
+# 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
+
+# start or reload Postfix as needed
+if [ ! -x /sbin/resolvconf ]; then
+ f=/etc/resolv.conf
+ if ! cp $f $(postconf -hx queue_directory)$f 2>/dev/null; then
+ exit 0
+ fi
+ if [ -n "$RUNNING" ]; then
+ service postfix reload >/dev/null 2>&1
+ fi
+fi
+
+# If master is running, force a queue run to unload any mail that is
+# hanging around. Yes, sendmail is a symlink...
+if [ -n "$RUNNING" ]; then
+ if [ -x /usr/sbin/sendmail ]; then
+ # Don't propagate the exit code on failure; cf. #959864
+ /usr/sbin/sendmail -q >/dev/null 2>&1 || true
+ fi
+fi