From 418b70b6d0f2fa1c2baaad5785912e7de417149b Mon Sep 17 00:00:00 2001 From: Matthias Saou Date: Apr 12 2009 15:18:17 +0000 Subject: - Update to 1.32. - Update init script to the new style. - Slightly update README-rpm instructions. --- diff --git a/.cvsignore b/.cvsignore index cab13a4..86aad99 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -postgrey-1.31.tar.gz +postgrey-1.32.tar.gz diff --git a/README-rpm b/README-rpm index bce1951..a06f52c 100644 --- a/README-rpm +++ b/README-rpm @@ -1,4 +1,4 @@ -Edit your configuration files: +To make use of postgrey, edit your configuration files: /etc/postfix/main.cf: @@ -10,10 +10,12 @@ Or if you like to use inet sockets (modify the IP if needed): /etc/sysconfig/postgrey: - OPTIONS="--inet=127.0.0.1:10023" + options="--inet=127.0.0.1:10023" /etc/postfix/main.cf: smtpd_recipient_restrictions = ... check_policy_service inet:127.0.0.1:10023, ... +And don't forget to activate the service on startup! + diff --git a/postgrey.init b/postgrey.init index c485df3..17f9f19 100755 --- a/postgrey.init +++ b/postgrey.init @@ -1,48 +1,56 @@ #!/bin/sh # -# chkconfig: - 79 31 -# description: Postfix Greylisting Policy Server -# -# processname: postgrey +# postgrey Postfix Greylisting Policy Server # +# chkconfig: - 79 31 +# description: Postfix Greylisting Policy Server + +### BEGIN INIT INFO +# Provides: postgrey +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Should-Start: +# Should-Stop: +# Default-Start: +# Default-Stop: 0 1 2 3 4 5 6 +# Short-Description: Postfix Greylisting Policy Server +# Description: Postgrey is a Postfix policy server implementing +# greylisting. When a request for delivery of a mail is +# received by Postfix via SMTP, the triplet CLIENT_IP / +# SENDER / RECIPIENT is built. If it is the first time +# that this triplet is seen, or if the triplet was first +# seen less than 5 minutes, then the mail gets rejected +# with a temporary error. +### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions -# Source networking configuration. -. /etc/sysconfig/network - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 +exec="/usr/sbin/postgrey" +prog="postgrey" +options="--unix=/var/spool/postfix/postgrey/socket" -prog=postgrey -postgrey=/usr/sbin/$prog -DBPATH=/var/spool/postfix/postgrey -SOCKET=$DBPATH/socket -OPTIONS="--unix=$SOCKET" +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog -# Source an auxiliary options file if we have one, and pick up OPTIONS, -if [ -r /etc/sysconfig/$prog ]; then - . /etc/sysconfig/$prog -fi - -[ -x $postgrey -a -d $DBPATH ] || exit 0 - -RETVAL=0 +lockfile=/var/lock/subsys/$prog start() { + [ -x $exec ] || exit 5 echo -n $"Starting $prog: " - daemon $postgrey -d $OPTIONS - RETVAL=$? + daemon $exec -d $options + retval=$? echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog + [ $retval -eq 0 ] && touch $lockfile + return $retval } + stop() { echo -n $"Stopping $prog: " - killproc $postgrey - RETVAL=$? + killproc $prog + retval=$? echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog + [ $retval -eq 0 ] && rm -f $lockfile + return $retval } restart() { @@ -52,34 +60,54 @@ restart() { reload() { echo -n $"Reloading $prog: " - killproc $postgrey -HUP - RETVAL=$? + killproc $prog -HUP + retval=$? echo + return $retval +} + +force_reload() { + restart +} + +rh_status() { + status $prog +} + +rh_status_q() { + rh_status &>/dev/null } - -# See how we were called. + + case "$1" in start) - start - ;; + rh_status_q && exit 0 + $1 + ;; stop) - stop - ;; + rh_status_q || exit 0 + $1 + ;; restart) - restart - ;; + $1 + ;; reload) - reload - ;; - condrestart) - [ -f /var/lock/subsys/$prog ] && restart - ;; + rh_status_q || exit 7 + $1 + ;; + force-reload) + force_reload + ;; status) - status $postgrey - ;; + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; *) - echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}" - exit 1 + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 esac +exit $? -exit $RETVAL diff --git a/postgrey.spec b/postgrey.spec index e1818e5..7943db7 100644 --- a/postgrey.spec +++ b/postgrey.spec @@ -2,8 +2,8 @@ Summary: Postfix Greylisting Policy Server Name: postgrey -Version: 1.31 -Release: 2%{?dist} +Version: 1.32 +Release: 1%{?dist} # File headers only state "GNU GPL", but the LICENSE sections state v2 and "any # later version" License: GPLv2+ @@ -112,7 +112,12 @@ fi %changelog -* Thu Feb 26 2009 Fedora Release Engineering - 1.31-2 +* Sun Apr 12 2009 Matthias Saou 1.32-1 +- Update to 1.32. +- Update init script to the new style. +- Slightly update README-rpm instructions. + +* Thu Feb 26 2009 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Thu May 22 2008 Matthias Saou 1.31-1 diff --git a/sources b/sources index ee4f7c8..03fa10b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b7a8a6fc9f1ad802c5a516a3be34bb29 postgrey-1.31.tar.gz +524a4e165bf997996f3bccade394712f postgrey-1.32.tar.gz