]> git.madduck.net Git - etc/mailfilter.git/blobdiff - procmail/get-msgid

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

shift afternoon to 4pm
[etc/mailfilter.git] / procmail / get-msgid
index c1260ac8bd9a5639ac573c05e6ff9a3e2e40e90b..02b10b150d0fc46fadda71228f0aed2c3b1d668a 100644 (file)
@@ -1,34 +1,34 @@
 :0
 :0
-* ^Message-Id:[        ]*\/[^  ]+
+*$ ^Message-Id:$RE_SPACE*\/$RE_NOT_SPACE+
 { MSGID="$MATCH" }
 
 :0
 { MSGID="$MATCH" }
 
 :0
-* MSGID ?? ^[  ]*$|^<>$
+*$ MSGID ?? ^$RE_SPACE*$|^<>$
 {
   :0
 {
   :0
-  * ^Resent-Message-Id:[       ]*\/[^  ]+
+  *$ ^Resent-Message-Id:$RE_SPACE*\/$RE_NOT_SPACE+
   {
   {
-    LOG="get-msgid:   lacking message-id, using resent-message-id...$NL"
+    LOGLATER="get-msgid:   lacking message-id, using resent-message-id...$NL"
     :0 fw
     :0 fw
-    |$FORMAIL -R Resent-Message-Id Message-Id
+    |$FORMAIL -R Resent-Message-ID Message-ID
   }
 
   :0 E
   {
   }
 
   :0 E
   {
-    LOG="get-msgid:   lacking message-id, generating one...$NL"
+    LOGLATER="get-msgid:   lacking message-id, generating one...$NL"
     :0 fw
     |$FORMAIL -a Message-ID:
   }
 
   :0
     :0 fw
     |$FORMAIL -a Message-ID:
   }
 
   :0
-  * ^Message-Id:[      ]*\/[^  ]+
+  *$ ^Message-Id:$RE_EXTRACT_HEADER_VALUE
   { MSGID="$MATCH" }
 }
 
 :0
 * ! MSGID ?? ^<[^>]+>$
 {
   { MSGID="$MATCH" }
 }
 
 :0
 * ! MSGID ?? ^<[^>]+>$
 {
-  LOG="get-msgid:   message-id '$MSGID' not enclosed in <>, fixing it...$NL"
+  LOGLATER="get-msgid:   message-id '$MSGID' not enclosed in <>, fixing it...$NL"
   MSGID="<$MSGID>"
 }
 
   MSGID="<$MSGID>"
 }
 
 *$ MSGID ?? .+@$RE_MAILRELAYS>
 *$ !^Return-Path: .+@$RE_MAILRELAYS\>
 *$ !^Received: by $RE_MAILRELAYS \(postfix, from userid
 *$ MSGID ?? .+@$RE_MAILRELAYS>
 *$ !^Return-Path: .+@$RE_MAILRELAYS\>
 *$ !^Received: by $RE_MAILRELAYS \(postfix, from userid
+* MSGID ?? ^<\/[^>]+
 {
 {
-  LOG="get-msgid:   missing message ID added by one of our mail relays$NL"
-
-  :0 fw
-  |$SED -re "s/^([Mm]essage-[Ii][Dd]:[^@]+@$RE_MAILRELAYS)\>/\1.MSGID-ADDED/"
-
-  :0
-  * ^Message-Id:[      ]*\/[^  ]+
-  { MSGID="$MATCH" }
+  LOGLATER="get-msgid:   missing message ID added by one of our mail relays$NL"
+  MSGID="<${MATCH}.MSGID-ADDED>"
 }
 }