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 460c25a..694d8e9 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 1ba50b7..37a4236 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>) {