chiark / gitweb /
header unfolding
[modbot-mtm.git] / stump / bin / processRejected
index c2dbc5ea071619e723e90d5d6d2c134634076316..694d8e9195b1c5ca4314382e758ad6a70f786cdd 100755 (executable)
@@ -4,6 +4,8 @@
 # reply message, signs it with PGP and sends back to the author.
 #
 
+set -e
+
 # echo $0 invoked with arguments $@ 1>&2
 
 MESSAGE=$TMP/rejected.$$
@@ -23,9 +25,13 @@ reply() {
 
   if [ "x$REASON" = xdiscard ]; then return; fi
   (
+    eventheader="reject $REASON"
+    if [ "x$WEBSTUMP_MESSAGENUM" != x ]; then
+        eventheader="[$WEBSTUMP_MESSAGENUM] $eventheader"
+    fi
     cat $MESSAGE | formail -rt -I "Reply-To: $BOARD"   \
                               -I "Errors-To: $MUNGED_ADDRESS"   \
-        -I "X-Webstump-Event: reject $REASON" \
+        -I "X-Webstump-Event: $eventheader" \
        $MAILOUT_REJECT_FORMAIL_ARGS
     (
       echo "$EXPLANATION"