summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2009-11-16 19:31:18 +0100
committerFlorian Pritz <bluewind@xssn.at>2009-11-16 19:38:42 +0100
commitf7cf2c5f9206ce42b8cad94acefeda1caf476dd0 (patch)
tree69ba0a6e86a12fca37607bfbb1b616347e3dd351
parent4475726ac1437afeafa6b212688ff913683a9872 (diff)
downloadaur-packages-f7cf2c5f9206ce42b8cad94acefeda1caf476dd0.tar.gz
aur-packages-f7cf2c5f9206ce42b8cad94acefeda1caf476dd0.tar.xz
add spamass-milter
Signed-off-by: Florian Pritz <bluewind@xssn.at>
-rw-r--r--spamass-milter/PKGBUILD28
-rw-r--r--spamass-milter/rc-conf14
-rw-r--r--spamass-milter/rc-script71
3 files changed, 113 insertions, 0 deletions
diff --git a/spamass-milter/PKGBUILD b/spamass-milter/PKGBUILD
new file mode 100644
index 0000000..fd18bdb
--- /dev/null
+++ b/spamass-milter/PKGBUILD
@@ -0,0 +1,28 @@
+# Contributor: Florian "Bluewind" Pritz <flo@xssn.at>
+pkgname=spamass-milter
+pkgver=0.3.1
+pkgrel=1
+pkgdesc="Sendmail Milter that pipes incoming mail through SpamAssassin"
+arch=(i686 x86_64)
+url="http://savannah.nongnu.org/projects/spamass-milt/"
+license=('GPL')
+depends=(gcc-libs spamassassin)
+makedepends=(libmilter)
+backup=(etc/conf.d/spamass-milter.conf)
+source=(http://mirror.lihnidos.org/GNU/savannah/spamass-milt/$pkgname-$pkgver.tar.gz rc-conf rc-script)
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ ./configure --prefix=/usr
+ make || return 1
+ install -D -m755 spamass-milter $pkgdir/usr/bin/spamass-milter
+ install -D -m644 spamass-milter.1 $pkgdir/usr/share/man/man1/spamass-milter.1
+ install -D -m755 $srcdir/rc-script $pkgdir/etc/rc.d/spamass-milter
+ install -D -m644 $srcdir/rc-conf $pkgdir/etc/conf.d/spamass-milter.conf
+}
+
+# vim:set ts=2 sw=2 et:
+md5sums=('ca6bf6a9c88db74a6bfea41f499c0ba6'
+ '854d6d59737c2bed10e2e1bfcae7d5c6'
+ 'e15bf0676348dc261b310bec4660b885')
diff --git a/spamass-milter/rc-conf b/spamass-milter/rc-conf
new file mode 100644
index 0000000..d8c7b29
--- /dev/null
+++ b/spamass-milter/rc-conf
@@ -0,0 +1,14 @@
+# ARGS are passed directly to spamass-milter.
+# man spamass-milter for details
+
+# use nobody's ~/.spamassassin/user_prefs if mail has multiple recipients
+# ignore messages from localhost
+
+# this one is the right one for use a smtpd_milters
+# Reject emails with spamassassin scores > 7 : option -r 7
+# Do not modify Subject:, Content-Type: or body option -m
+ARGS="-u nobody -m -r 7 -i 127.0.0.1 -f -p /var/run/spamass.sock"
+
+SOCKET="/var/run/spamass.sock"
+SOCKETOWNER="postfix:postfix"
+SOCKETMODE="0660"
diff --git a/spamass-milter/rc-script b/spamass-milter/rc-script
new file mode 100644
index 0000000..bafc89a
--- /dev/null
+++ b/spamass-milter/rc-script
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+daemon_name=spamass-milter
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/$daemon_name.conf
+
+get_pid() {
+ pidof -o %PPID $daemon_name
+}
+
+case "$1" in
+ start)
+ stat_busy "Starting $daemon_name daemon"
+
+ PID=$(get_pid)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid
+ # RUN
+ $daemon_name $ARGS
+ #
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ sleep 1
+ chown $SOCKETOWNER $SOCKET
+ chmod $SOCKETMODE $SOCKET
+ echo $(get_pid) > /var/run/$daemon_name.pid
+ add_daemon $daemon_name
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping $daemon_name daemon"
+ PID=$(get_pid)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ rm -f /var/run/$daemon_name.pid &> /dev/null
+ rm_daemon $daemon_name
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+
+ status)
+ stat_busy "Checking $daemon_name status";
+ ck_status $daemon_name
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|restart|status}"
+esac
+
+exit 0