From f75a45cd7b7953a45ffad13538059fd13f289095 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 26 Mar 2008 12:59:14 +0000 Subject: [PATCH] Added mailqueue script git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@9994 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/scripts/mailqueue | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 contrib/scripts/mailqueue 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" -- 2.30.2