chiark / gitweb /
Stronger imprecations against voting before seeing instructions
[modbot-mtm.git] / stump / bin / processRejected
index 212a8f7caa7499613c8093319694c3b445b8e0e4..460c25adf13888e3539c26e191760a401b14748d 100755 (executable)
@@ -1,9 +1,11 @@
-#!/bin/sh
+#!/bin/bash
 #
 # This script takes a raw article that is already rejected, creates a 
 # reply message, signs it with PGP and sends back to the author.
 #
 
+set -e
+
 # echo $0 invoked with arguments $@ 1>&2
 
 MESSAGE=$TMP/rejected.$$
@@ -26,8 +28,7 @@ reply() {
     cat $MESSAGE | formail -rt -I "Reply-To: $BOARD"   \
                               -I "Errors-To: $MUNGED_ADDRESS"   \
         -I "X-Webstump-Event: reject $REASON" \
-       -I 'Bcc: webstump+urcm-internal-log+mailout' \
-       -I 'Bcc: webstump+urcm-internal-reject-copy'
+       $MAILOUT_REJECT_FORMAIL_ARGS
     (
       echo "$EXPLANATION"
       echo
@@ -38,8 +39,8 @@ reply() {
 
       echo ""
       echo ============================================ Full text of your message follows
-      sed 's/^/> /; s/webstump+[-+/0-9a-z]*@chiark/webstump+?@chiark/' \
-         < $MESSAGE
+      sanitise_and_quote_email \
+         < $MESSAGE
     ) | gpg --clearsign --textmode --armor --batch --user "$PMUSER_APPROVAL" \
          --passphrase "$PMPASSWORD" 2>/dev/null \
   ) | sendmail -oi -t -f $MUNGED_ADDRESS