X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/5c28a6614161480f04a1783bc7441bc90f50dfb9..90af4d50470f9e9b91720fa42f26673293297312:/procmail/get-msgid diff --git a/procmail/get-msgid b/procmail/get-msgid index 3c3bfe3..4a0d251 100644 --- a/procmail/get-msgid +++ b/procmail/get-msgid @@ -1,34 +1,34 @@ :0 -* ^Message-Id:[ ]*\/[^ ]+ +*$ ^Message-Id:$RE_EXTRACT_HEADER_VALUE { MSGID="$MATCH" } :0 -* MSGID ?? ^[ ]*$|^<>$ +* MSGID ?? ^$RE_SPACE*$|^<>$ { :0 - * ^Resent-Message-Id:[ ]*\/[^ ]+ + * ^Resent-Message-Id:$RE_EXTRACT_HEADER_VALUE { - LOG="get-msgid: lacking message-id, using resent-message-id...$NL" + LOGLATER="get-msgid: lacking message-id, using resent-message-id...$NL" :0 fw - |$FORMAIL -R Resent-Message-Id Message-Id + |$FORMAIL -R Resent-Message-ID Message-ID } :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 - * ^Message-Id:[ ]*\/[^ ]+ + * ^Message-Id:$RE_EXTRACT_HEADER_VALUE { 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>" } @@ -36,7 +36,8 @@ *$ 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" - MSGID="${MSGID}.MSGID-ADDED" + LOGLATER="get-msgid: missing message ID added by one of our mail relays$NL" + MSGID="<${MATCH}.MSGID-ADDED>" }