From: martin f. krafft Date: Mon, 27 Aug 2007 09:11:26 +0000 (+0200) Subject: generate (or use resent-)message-id if missing X-Git-Url: https://git.madduck.net/etc/mailfilter.git/commitdiff_plain/bc44168d4736169c38c92f94cb40e34fbb6e7ccf?ds=sidebyside generate (or use resent-)message-id if missing --- diff --git a/procmail/get-msgid b/procmail/get-msgid index 3639f51..c1260ac 100644 --- a/procmail/get-msgid +++ b/procmail/get-msgid @@ -5,15 +5,24 @@ :0 * MSGID ?? ^[ ]*$|^<>$ { - TMPFILE="`tempfile -p msgid`" - LOG="get-msgid: LACKING MSGID header, DUMPING to $TMPFILE (@$OURDATE)$NL" + :0 + * ^Resent-Message-Id:[ ]*\/[^ ]+ + { + LOG="get-msgid: lacking message-id, using resent-message-id...$NL" + :0 fw + |$FORMAIL -R Resent-Message-Id Message-Id + } - :0 ifw - |cat > $TMPFILE + :0 E + { + LOG="get-msgid: lacking message-id, generating one...$NL" + :0 fw + |$FORMAIL -a Message-ID: + } - EX_DEFER=75 - EXITCODE=$EX_DEFER - HOST + :0 + * ^Message-Id:[ ]*\/[^ ]+ + { MSGID="$MATCH" } } :0