From c7266fb65a48efe8db3985dea9271ee94b3cd69b Mon Sep 17 00:00:00 2001 From: don Date: Sat, 14 Feb 2009 02:13:32 +0000 Subject: [PATCH] * Document that using the -x option requires being in the smmsp group (closes: #515158) * Deal with inet:999 sockets (closes: #514749) - handle them more sanely in the init script - document how to deal with them in README.Debian and /etc/spamass-milter/default --- debian/README.Debian | 17 ++++++++++++++++- debian/changelog | 11 +++++++++++ debian/spamass-milter.default | 8 ++++++-- debian/spamass-milter.init | 15 +++++++++++---- 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/debian/README.Debian b/debian/README.Debian index 16d50d5..ab43cc0 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -37,6 +37,13 @@ See http://www.sendmail.com/partner/resources/development/milter_api/installatio and http://www.sendmail.org/m4/adding_mailfilters.html#INPUT_MAIL_FILTER for more information on milters. +If you are using the alias expansion method, -x, you will need to add +spamass-milter to the smmsp group using: + + adduser spamass-milter smmsp; + +This does not need to be done unless you are using alias expansion. + -------------------------------------------------------------- Integrating spamass-milter into your postfix installation -------------------------------------------------------------- @@ -89,6 +96,14 @@ if you're running postfix. RUNAS controls the user which spamass-milter runs as; defaults to spamass-milter. +If you want to use an inet socket for spamass-milter (like inet:9999), +then you'll need to make the following configuration changes in +/etc/default/spamass-milter: + +SOCKET="inet:9999" +SOCKETMODE="" +SOCKETOWNER="" + ------------------------------------------------------------- Debugging spamass-milter ------------------------------------------------------------- @@ -118,4 +133,4 @@ q and send the results along with your bug report using reportbug. - -- Don Armstrong , Tue, 20 Jan 2009 19:39:51 -0800 + -- Don Armstrong , Fri, 13 Feb 2009 18:06:39 -0800 diff --git a/debian/changelog b/debian/changelog index 689e70b..af904ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +spamass-milter (0.3.1-9) unstable; urgency=low + + * Document that using the -x option requires being in the smmsp group + (closes: #515158) + * Deal with inet:999 sockets (closes: #514749) + - handle them more sanely in the init script + - document how to deal with them in README.Debian and + /etc/spamass-milter/default + + -- Don Armstrong Fri, 13 Feb 2009 18:13:04 -0800 + spamass-milter (0.3.1-8) unstable; urgency=low * Update the documentation in README.Debian to indicate that a different diff --git a/debian/spamass-milter.default b/debian/spamass-milter.default index a2c49e0..afb56f9 100644 --- a/debian/spamass-milter.default +++ b/debian/spamass-milter.default @@ -3,8 +3,12 @@ # OPTIONS are passed directly to spamass-milter. # man spamass-milter for details -# Default, use the nobody user as the default user, ignore messages -# from localhost +# Non-standard configuration notes: +# See README.Debian if you use the -x option with sendmail +# You should not pass the -d option in OPTIONS; use SOCKET for that. + +# Default, use the spamass-milter user as the default user, ignore +# messages from localhost OPTIONS="-u spamass-milter -i 127.0.0.1" # Reject emails with spamassassin scores > 15. diff --git a/debian/spamass-milter.init b/debian/spamass-milter.init index f875cd4..907f97f 100644 --- a/debian/spamass-milter.init +++ b/debian/spamass-milter.init @@ -98,21 +98,28 @@ start() { chown "$RUNAS" $(dirname $PIDFILE); fi; fi; - if [ ! -d $(dirname $SOCKET) ]; then + # if the dirname is '.', then it's some kind of odd socket, like + # an inet socket. Don't create the directory in such a case + if [ $(dirname $SOCKET) != "." ] && [ ! -d $(dirname $SOCKET) ]; then mkdir -p $(dirname $SOCKET); if [ -n "$SOCKETOWNER" ]; then chown "$RUNAS" $(dirname $SOCKET); fi; fi; - if [ -n "$RUNAS" ] && [ -d $(dirname $PIDFILE) ] && [ "$(stat -c '%U' $(dirname $PIDFILE))" != "$RUNAS" ]; then + if [ -n "$RUNAS" ] && [ -d $(dirname $PIDFILE) ] && + [ "$(stat -c '%U' $(dirname $PIDFILE))" != "$RUNAS" ]; then echo "WARNING: $NAME will run as user $RUNAS but $(dirname $PIDFILE) is not owned by $RUNAS"; echo "Either delete this directory or chown it appropriately. Startup attempts may fail."; fi; - if [ -n "$RUNAS" ] && [ -d $(dirname $SOCKET) ] && [ "$(stat -c '%U' $(dirname $SOCKET))" != "$RUNAS" ]; then + if [ -n "$RUNAS" ] && [ $(dirname $SOCKET) != "." ] && + [ -d $(dirname $SOCKET) ] && + [ "$(stat -c '%U' $(dirname $SOCKET))" != "$RUNAS" ]; then echo "WARNING: $NAME will run as user $RUNAS but $(dirname $SOCKET) is not owned by $RUNAS"; echo "Either delete this directory or chown it appropriately. Startup attempts may fail."; fi; - /bin/rm -f $SOCKET + if [ $(dirname $SOCKET) != "." ]; then + /bin/rm -f $SOCKET + fi; start-stop-daemon --start -p $PIDFILE $CHUID --exec $DAEMON -- -P $PIDFILE -f -p $SOCKET $OPTIONS sleep 1s if [ -n "$SOCKETMODE" ]; then -- 2.39.2