]> git.pld-linux.org Git - packages/eventum.git/commitdiff
- script to route mails/notes/drafts via qmail
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 24 Feb 2005 12:56:23 +0000 (12:56 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    eventum-router-qmail.sh -> 1.1

eventum-router-qmail.sh [new file with mode: 0644]

diff --git a/eventum-router-qmail.sh b/eventum-router-qmail.sh
new file mode 100644 (file)
index 0000000..9f45686
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+# $Id$
+#
+
+# qmail exit codes
+HARD=100
+SOFT=111
+OK=0
+
+case "$1" in
+drafts|emails|notes)
+       TYPE="$1"
+       shift
+;;
+*)
+       echo >&2 "Invalid type: $1"
+       exit $SOFT
+esac
+
+cd /usr/share/eventum
+/usr/bin/php4 -q route_$TYPE.php "$@" && exit $OK
+rc=$?
+
+# exit does are for postfix, based on /usr/include/sysexits.h
+#define EX_NOINPUT      66      /* cannot open input */
+#define EX_DATAERR      65      /* data format error */
+#define EX_NOPERM       77      /* permission denied */
+#define EX_CONFIG       78      /* configuration error */
+
+# all known exit codes (from source) are hard errors
+case $rc in
+78|77|65|66)
+       rc=$HARD
+       ;;
+*)
+       rc=$SOFT
+       ;;
+esac
+exit $rc
This page took 0.118847 seconds and 4 git commands to generate.