chiark / gitweb /
Include the message number in X-Webstump-Event
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 20 Apr 2010 16:51:09 +0000 (17:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 20 Apr 2010 16:51:09 +0000 (17:51 +0100)
stump/bin/processRejected
xlog/bin/record

index 460c25adf13888e3539c26e191760a401b14748d..694d8e9195b1c5ca4314382e758ad6a70f786cdd 100755 (executable)
@@ -25,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"
index 1ba50b70ae543452a6e303297dbc9fcb0225a0e6..37a4236f2f820597e20329e505c9582c9f45420c 100755 (executable)
@@ -112,7 +112,10 @@ sub parse_mailout () {
            $message .= $line;
        }
        chomp;
-       $f{Event}= "notify $'" if m/^X-Webstump-Event:\s*/i; #';
+        if (m/^X-Webstump-Event:\s*(?:\[(\d+)\])?\s*/i) { #';
+            $f{Event}= "notify $'";
+            $f{MessageNum}= $1 if defined $1;
+        }
        last if m/^$/;
     }
     while (<STDIN>) {