From: hickert Date: Wed, 26 Mar 2008 12:59:14 +0000 (+0000) Subject: Added mailqueue script X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f75a45cd7b7953a45ffad13538059fd13f289095;p=gosa.git Added mailqueue script git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@9994 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/contrib/scripts/mailqueue b/contrib/scripts/mailqueue new file mode 100755 index 000000000..be6c8726b --- /dev/null +++ b/contrib/scripts/mailqueue @@ -0,0 +1,47 @@ +#!/bin/sh + +# Are we root? +[ $UID -ne 0 ] && exit 1 + +# Assign parameters +[ $# -lt 3 ] && exit 2 +action=$1 +shift +id=$1 +shift + +# Servers are ignored by this script +servers=$* + +# Take actions +case "$action" in + query) + /usr/bin/mailq + ;; + + hold) + /usr/sbin/postsuper -h $id + ;; + + unhold) + /usr/sbin/postsuper -H $id + ;; + + requeue) + /usr/sbin/postsuper -r $id + ;; + + del) + /usr/sbin/postsuper -d $id + ;; + + header) + queue=$(postconf queue_directory | cut -d\ -f3-) + postcat -q $id | sed -n '/^\*\*\* MESSAGE CONTENTS/,/^$/p' | sed "s#^\*\*\* MESSAGE CONTENTS \(.*\)\*\*\*#Filename: $queue/\1#" + ;; + + *) exit 3 + ;; +esac + +echo "Ready"