Package: milter-greylist
Version: 4.3.4-2
Severity: wishlist
Tags: patch

To ease running milter-greylist with a chrooted postfix smtpd please allow 
changing
ownership and mode for the milter socket by the init script (idea was taken from
spamass-milter) - the attached patch does this by introducing two new variables
($SOCKETMODE and $SOCKETOWNER) in default file and using their values in the 
init
script.

-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages milter-greylist depends on:
ii  adduser              3.110               add and remove users and groups
ii  libc6                2.7-18              GNU C Library: Shared libraries
ii  libmilter1.0.1       8.14.3-5            Sendmail Mail Filter API (Milter)
ii  libspf2-2            1.2.5.dfsg-5+lenny1 library for validating mail sender

Versions of packages milter-greylist recommends:
ii  postfix                       2.5.5-1.1  High-performance mail transport ag

milter-greylist suggests no packages.

-- no debconf information
--- milter-greylist.init_ORIG   2009-11-03 20:41:21.000000000 +0100
+++ milter-greylist.init        2009-11-03 20:49:13.000000000 +0100
@@ -73,6 +73,13 @@
        echo -n "Starting $DESC: "
        start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \
            $NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS
+       sleep 1
+        if [ -n "$SOCKETMODE" ]; then
+            chmod $SOCKETMODE $SOCKET;
+        fi;
+        if [ -n "$SOCKETOWNER" ]; then
+            chown $SOCKETOWNER $SOCKET;
+        fi;
        echo "$NAME."
        ;;
 
@@ -88,7 +95,13 @@
            --retry 5 --oknodo
        start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \
            $NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS
-
+       sleep 1
+        if [ -n "$SOCKETMODE" ]; then
+            chmod $SOCKETMODE $SOCKET;
+        fi;
+        if [ -n "$SOCKETOWNER" ]; then
+            chown $SOCKETOWNER $SOCKET;
+        fi;
        echo "$NAME."
        ;;
 
@@ -106,7 +119,13 @@
            --retry 5 --oknodo
        start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \
            $NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS
-
+       sleep 1
+        if [ -n "$SOCKETMODE" ]; then
+            chmod $SOCKETMODE $SOCKET;
+        fi;
+        if [ -n "$SOCKETOWNER" ]; then
+            chown $SOCKETOWNER $SOCKET;
+        fi;
        echo "$NAME."
        ;;
 
--- milter-greylist.default_ORIG        2009-11-03 20:50:06.000000000 +0100
+++ milter-greylist.default     2009-11-03 21:02:17.000000000 +0100
@@ -14,3 +14,8 @@
 
 # Other options
 # OPTIONS=""
+
+# To allow postfix smtpd to connect to socket,
+# uncomment the following two lines
+# SOCKETOWNER="postfix:postfix"
+# SOCKETMODE="0660"

Reply via email to