diff options
Diffstat (limited to 'network')
-rw-r--r-- | network/amavisd-new/README | 10 | ||||
-rw-r--r-- | network/amavisd-new/README.SBo | 16 | ||||
-rw-r--r-- | network/amavisd-new/amavisd-new.SlackBuild | 36 | ||||
-rw-r--r-- | network/amavisd-new/amavisd-new.info | 8 | ||||
-rw-r--r-- | network/amavisd-new/amavisd-signer.patch | 17 | ||||
-rw-r--r-- | network/amavisd-new/doinst.sh | 22 | ||||
-rw-r--r-- | network/amavisd-new/rc.amavisd-new | 42 |
7 files changed, 110 insertions, 41 deletions
diff --git a/network/amavisd-new/README b/network/amavisd-new/README index 29e0a20246c75..28d1a87652722 100644 --- a/network/amavisd-new/README +++ b/network/amavisd-new/README @@ -4,10 +4,6 @@ or more content checkers: virus scanners, SpamAssassin and/or dkim signing. Please refer to README.SBo for detailed instructions and dependencies before running the build script. -Script and package changes introduced in version >= 2.6.6 -1. logrotate file is renamed amavisd-new. -2. rc script is renamed to rc.amavisd-new -3. logfile in the logrotate script is renamed to amavisd-new.log. Make sure - you change the logfile in the amavisd.conf file and rename the log file. - Look for, $LOGFILE directive in the configuration file. -4. Remember to update your rc.local and rc.local_shutdown scripts accordingly. +This requires: perl-Convert-TNEF, perl-Convert-UUlib, perl-Convert-BinHex, +perl-Archive-Zip, perl-IO-stringy, perl-MIME-tools, perl-Unix-Syslog, +perl-BerkeleyDB, perl-IO-Multiplex. diff --git a/network/amavisd-new/README.SBo b/network/amavisd-new/README.SBo index bf8b7c8aab88d..9e62de8f78858 100644 --- a/network/amavisd-new/README.SBo +++ b/network/amavisd-new/README.SBo @@ -45,6 +45,19 @@ perl-IO-stringy perl-MIME-tools perl-Unix-Syslog perl-BerkeleyDB +perl-IO-Multiplex + +SLACKBUILD CHANGELOG: +Script and package changes introduced in version >= 2.6.6 +1. logrotate file is renamed amavisd-new. +2. rc script is renamed to rc.amavisd-new +3. logfile in the logrotate script is renamed to amavisd-new.log. Make sure + you change the logfile in the amavisd.conf file and rename the log file. + Look for, $LOGFILE directive in the configuration file. +4. Remember to update your rc.local and rc.local_shutdown scripts accordingly. +5. With version 2.7, a new process amavisd-signer is spawned to take care + of dkim signing. Please read RELEASE_NOTES in the documentation. + SETUP: 1. Create amavis user/group, before running the script. @@ -54,7 +67,7 @@ SETUP: 2. Make sure you have write perms for amavis group to amavis home (in this case, /var/lib/amavis) -3. Create /var/log/amavisd-new.log file, change perms to allow write access +3. Create /var/log/amavisd.log file, change perms to allow write access to amavisd user/group. 4. Add amavis user to clamav group and set "AllowSupplementaryGroups yes" @@ -70,3 +83,4 @@ SETUP: 7. You can turn on debugging in log file with $sa_debug configuration variable in /etc/amavisd.conf. + diff --git a/network/amavisd-new/amavisd-new.SlackBuild b/network/amavisd-new/amavisd-new.SlackBuild index 2676af027ff49..7a8665d168ab3 100644 --- a/network/amavisd-new/amavisd-new.SlackBuild +++ b/network/amavisd-new/amavisd-new.SlackBuild @@ -3,7 +3,7 @@ # Slackware Package Build Script for amavisd-new # Home Page http://www.ijs.si/software/amavisd/ -# Copyright (c) 2009-2011, Nishant Limbachia, Hoffman Estates, IL, USA +# Copyright (c) 2009-2012, Nishant Limbachia, Hoffman Estates, IL, USA # <nishant _AT_ mnspace _DOT_ net> # All rights reserved. @@ -26,11 +26,12 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM="amavisd-new" -VERSION=${VERSION:-2.6.6} -ARCH="noarch" +VERSION=${VERSION:-2.7.1} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +ARCH="noarch" + CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM @@ -38,6 +39,20 @@ OUTPUT=${OUTPUT:-/tmp} set -e +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + # Create system user and group for amavisd-new if ! grep -q ^amavis: /etc/group ; then echo " Please add a dedicated group to run amavisd-new" @@ -64,11 +79,12 @@ QUARANTINE_DIR=${QUARANTINE_DIR:-$AMAVIS_HOME/quarantine} DOCS="AAAREADME.first INSTALL TODO amavisd*.conf* LDAP* RELEASE_NOTES LICENSE README_FILES test-messages" -rm -fr $TMP/$PRGNAM-$VERSION $PKG +rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP +rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* -cd $TMP/$PRGNAM-$VERSION +cd $PRGNAM-$VERSION chown -R root.root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ @@ -91,8 +107,11 @@ mkdir -p $PKG/$QUARANTINE_DIR/{clean,spam,banned,badh,virus} mkdir -p $PKG/usr/{sbin,doc/$PRGNAM-$VERSION} install -m 0755 -D amavisd $PKG/usr/sbin/$PRGNAM ( cd $PKG/usr/sbin; ln -sf $PRGNAM amavisd ) -install -m 0755 amavisd-agent amavisd-nanny amavisd-release \ - amavisd-snmp-subagent p0f-analyzer.pl $PKG/usr/sbin + +patch -p0 < $CWD/amavisd-signer.patch + +install -m 0755 amavisd-agent amavisd-nanny amavisd-release amavisd-signer \ + amavisd-snmp-subagent amavisd-submit p0f-analyzer.pl $PKG/usr/sbin install -m 0640 -D amavisd.conf $PKG/etc/amavisd.conf.new # change permissions @@ -100,7 +119,8 @@ chown $USER:$GROUP $PKG/etc/amavisd.conf.new chown -R $USER:$GROUP $PKG/$AMAVIS_HOME $PKG/var/run/amavis $PKG/$QUARANTINE_DIR chmod -R 0770 $PKG/$AMAVIS_HOME $PKG/var/run/amavis $PKG/$QUARANTINE_DIR -cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION +cp -r $DOCS $PKG/usr/doc/$PRGNAM-$VERSION +chmod -R +r $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild ### install rc script diff --git a/network/amavisd-new/amavisd-new.info b/network/amavisd-new/amavisd-new.info index 34906b3bde0a7..3efdf7510c7c0 100644 --- a/network/amavisd-new/amavisd-new.info +++ b/network/amavisd-new/amavisd-new.info @@ -1,10 +1,10 @@ PRGNAM="amavisd-new" -VERSION="2.6.6" +VERSION="2.7.1" HOMEPAGE="http://www.ijs.si/software/amavisd/" -DOWNLOAD="http://www.ijs.si/software/amavisd/amavisd-new-2.6.6.tar.gz" -MD5SUM="6bddb725115c2682110b82d41494df73" +DOWNLOAD="http://www.ijs.si/software/amavisd/amavisd-new-2.7.1.tar.gz" +MD5SUM="87cd516d1c6349a4389947fb949ff1a2" DOWNLOAD_x86_64="" MD5SUM_x86_64="" MAINTAINER="Nishant Limbachia" EMAIL="nishant@mnspace.net" -APPROVED="Niels Horn" +APPROVED="dsomero" diff --git a/network/amavisd-new/amavisd-signer.patch b/network/amavisd-new/amavisd-signer.patch new file mode 100644 index 0000000000000..a45110c8ad58b --- /dev/null +++ b/network/amavisd-new/amavisd-signer.patch @@ -0,0 +1,17 @@ +--- amavisd-signer.orig 2012-05-04 22:27:39.397598579 -0500 ++++ amavisd-signer 2012-05-04 22:28:55.609603047 -0500 +@@ -83,11 +83,11 @@ + # Please adjust the following settings as necessary: + # + +-$daemon_user = 'vscan'; +-$daemon_group = 'vscan'; ++$daemon_user = 'amavis'; ++$daemon_group = 'amavis'; + # $daemon_chroot_dir = '/var/amavis'; # chroot directory or undef + +-# $daemonize = 1; ++$daemonize = 1; + + $log_level = 2; # 0..5 + $syslog_facility = 'mail'; diff --git a/network/amavisd-new/doinst.sh b/network/amavisd-new/doinst.sh index 637ab6bc82604..ad648167ec14e 100644 --- a/network/amavisd-new/doinst.sh +++ b/network/amavisd-new/doinst.sh @@ -11,13 +11,17 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.amavisd.new: -if [ -e etc/rc.d/rc.amavisd-new ]; then - cp -a etc/rc.d/rc.amavisd-new etc/rc.d/rc.amavisd-new.new.incoming - cat etc/rc.d/rc.amavisd-new.new > etc/rc.d/rc.amavisd-new.new.incoming - mv etc/rc.d/rc.amavisd-new.new.incoming etc/rc.d/rc.amavisd-new.new -fi +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} -config etc/rc.d/rc.amavisd-new.new -config etc/amavisd.conf.new -config etc/logrotate.d/amavisd-new.new +preserve_perms etc/rc.d/rc.amavisd-new.new +preserve_perms etc/amavisd.conf.new +preserve_perms etc/logrotate.d/amavisd-new.new diff --git a/network/amavisd-new/rc.amavisd-new b/network/amavisd-new/rc.amavisd-new index 9d0de3dd68ca4..3410eb18c26e1 100644 --- a/network/amavisd-new/rc.amavisd-new +++ b/network/amavisd-new/rc.amavisd-new @@ -1,31 +1,42 @@ #!/bin/sh -# Copyright (c) 2008-2011, Nishant Limbachia, Hoffman Estates, IL, USA -# <nishant _AT_ mnspace _DOT_ net> -# /etc/rc.d/rc.amavisd -# start|stop|restart|status for amavisd-new -# For automatic start at boot up, call this script from rc.local +# Startup script for amavisd-new daemon for use on Slackware Linux x86|x86_64 + +# Copyright (c) 2008-2012, Nishant Limbachia, Hoffman Estates, IL, USA +# [nishant _AT_ mnspace _DOT_ net] +# Usage: /etc/rc.d/rc.amavisd-new start|stop|restart|reload|status +# For automatic startup at boot, call this script from rc.local PIDFILE=/var/run/amavis/amavisd.pid amavisd_start() { if [ -x /etc/rc.d/rc.amavisd-new ]; then + # start amavisd-signer first + echo "Starting amavisd-signer daemon" + /usr/sbin/amavisd-signer + if [ -f $PIDFILE ]; then echo "amavisd-new daemon running with PID: $(cat $PIDFILE)" - echo "try /etc/rc.d/rc.amavisd-new stop|restart" + echo "Or we may have a stale pid file from previous run" + echo "try /etc/rc.d/rc.amavisd-new stop|restart Or" + echo "remove the stale pid file and try starting again" echo "" exit 1 else echo "Starting amavisd-new daemon" - /usr/sbin/amavisd start + /usr/sbin/amavisd-new start fi fi } amavisd_stop() { + # stop amavisd-signer first + echo "Stopping amavisd-signer daemon" + pkill amavisd-signer + if [ -f $PIDFILE ]; then echo "Stopping amavisd-new daemon" - /usr/sbin/amavisd stop + /usr/sbin/amavisd-new stop else echo "amavisd-new daemon is not running" fi @@ -33,13 +44,17 @@ amavisd_stop() { amavisd_restart() { echo "Restarting amavisd-new daemon" - amavisd_stop - sleep 5 - amavisd_start + /usr/sbin/amavisd-new restart +} + +amavisd_reload() { + echo "Reloading amavisd-new daemon" + /usr/sbin/amavisd-new reload } amavisd_status() { echo "amavisd-new daemon running with PID: $(cat $PIDFILE)" + echo "amavisd-signer daemon running with PID: $(pgrep amavisd-signer)" } case "$1" in @@ -52,11 +67,14 @@ case "$1" in 'restart') amavisd_restart ;; +'reload') + amavisd_reload + ;; 'status') amavisd_status ;; *) - echo "USAGE: $0 start|stop|restart|status" + echo "USAGE: $0 start|stop|restart|reload|status" exit 1 ;; esac |