--- /dev/null
+#!/bin/sh
+
+
+#set -x;
+set -e;
+for a in "$@"; do
+ if egrep -q '^Subject: Log.+successful' "$a"; then
+ RETURN_PATH=$(awk -F': ' '/^Return-Path:/{print $2}' "$a")
+ SUBJECT=$(awk -F': ' '/^Subject:/{print $2}' "$a")
+ KEY=9D05D0BE
+ TEMPDIR=$(mktemp -d)
+ cp "$a" "$TEMPDIR/reply"
+ buildd_script "$TEMPDIR/reply"
+ gpg --no-verbose --batch --quiet --default-key $KEY --armor --output $TEMPDIR/reply.signed --clearsign $TEMPDIR/reply >/dev/null 2>&1
+ mutt -e 'set content_type="text/plain; charset=utf-8; x-action=pgp-signed"' -s "Re: $SUBJECT" "$RETURN_PATH" < $TEMPDIR/reply.signed
+ rm -f $TEMPDIR/reply $TEMPDIR/reply.signed
+ rmdir $TEMPDIR
+ mv "${a}" "${a}RS";
+ if echo "$a"|grep -q 'new/'; then
+ rename 's{new/}{cur/}' "${a}RS";
+ else
+ mv "${a}RS" ../cur/"${a}RS";
+ fi;
+ echo "Handled '${SUBJECT}'";
+ fi
+done;
\ No newline at end of file