From: don <don@8f7917da-ec0b-0410-a553-b9b0e350d17e>
Date: Fri, 13 Oct 2006 23:16:10 +0000 (+0000)
Subject: auto detect postfix installs
X-Git-Tag: debian/0.4.0-1~84
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=dede31818538268c78498b3b9ba53f39049b08be;p=deb_pkgs%2Fspamass-milter.git

auto detect postfix installs
---

diff --git a/debian/spamass-milter.default b/debian/spamass-milter.default
index 85cfd62..972cacd 100644
--- a/debian/spamass-milter.default
+++ b/debian/spamass-milter.default
@@ -13,7 +13,12 @@ OPTIONS="-u nobody -i 127.0.0.1"
 # Do not modify Subject:, Content-Type: or body.
 #OPTIONS="-m"
 
-# If you are using postfix, you probably want to uncomment the following
+######################################
+# If /usr/sbin/postfix is executable, the following are set by
+# default. You can override them by uncommenting and changing them
+# here.
+######################################
 # SOCKET="/var/spool/postfix/spamass/spamass.sock"
-# RUNAS="postfix"
-# PIDFILE="/var/spool/postfix/spamass/spamass.pid"
\ No newline at end of file
+# RUNAS="postfix:postfix"
+# PIDFILE="/var/spool/postfix/spamass/spamass.pid"
+######################################
\ No newline at end of file
diff --git a/debian/spamass-milter.init b/debian/spamass-milter.init
index deb05e6..5396f64 100644
--- a/debian/spamass-milter.init
+++ b/debian/spamass-milter.init
@@ -44,6 +44,14 @@ CHUID=""
 
 test -x $DAEMON || exit 0
 
+# If /usr/sbin/postfix exists, set up the defaults for a postfix install
+# These can be overridden in /etc/default/spamass-milter
+if [ -x /usr/sbin/posfix ]; then
+    SOCKET="/var/spool/postfix/spamass/spamass.sock"
+    RUNAS="postfix:postfix"
+    PIDFILE="/var/spool/postfix/spamass/spamass.pid"
+fi;
+
 if [ -r $DEFAULT ]; then
     . $DEFAULT;
 fi;