aboutsummaryrefslogtreecommitdiff
path: root/network/postgrey/rc.postgrey
diff options
context:
space:
mode:
authorChristopher Walker <kris240376@gmail.com>2013-05-11 23:55:16 -0500
committerNiels Horn <niels.horn@slackbuilds.org>2013-05-12 22:20:58 -0300
commit64117deeb91046e006d9340f5fe3c06484512748 (patch)
tree85dc1124b2a207514271028649dbe756120c2963 /network/postgrey/rc.postgrey
parent64789a0f8bc143b7287cd1f4afe6929c324447a8 (diff)
network/postgrey: Added (Postfix Greylisting Policy Server)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/postgrey/rc.postgrey')
-rw-r--r--network/postgrey/rc.postgrey42
1 files changed, 42 insertions, 0 deletions
diff --git a/network/postgrey/rc.postgrey b/network/postgrey/rc.postgrey
new file mode 100644
index 0000000000000..d763884bfa7c2
--- /dev/null
+++ b/network/postgrey/rc.postgrey
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+PORT=10025
+PIDFILE=/var/run/postgrey/postgrey.pid
+USER=%POSTGREYUSR%
+GROUP=%POSTGREYGRP%
+HOST=mail.example.com
+
+postgrey_start() {
+ echo "Starting postgrey milter: /usr/bin/postgrey -d --inet=$PORT --pidfile=$PIDFILE --user=$USER --group=$GROUP --dbdir=/var/lib/postgrey --hostname=$HOST"
+ mkdir -p /var/run/postgrey
+ /usr/bin/postgrey -d \
+ --inet=$PORT \
+ --pidfile=/var/run/postgrey/postgrey.pid \
+ --user=$USER --group=$GROUP \
+ --dbdir=/var/lib/postgrey \
+ --hostname=$HOST
+}
+
+postgrey_stop() {
+ if [ -e $PIDFILE ]; then
+ echo "Stopping postgrey milter..."
+ kill $(cat $PIDFILE) 1>/dev/null
+ fi
+}
+
+case "$1" in
+'start')
+ postgrey_start
+ ;;
+'stop')
+ postgrey_stop
+ ;;
+'restart')
+ postgrey_stop
+ sleep 2
+ postgrey_start
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+ ;;
+esac