]> git.madduck.net Git - etc/mailfilter.git/blob - 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:

only check first 150 lines for X-Postponed header
[etc/mailfilter.git] / procmail / get-msgid
1 :0
2 *$ ^Message-Id:$RE_SPACE*\/$RE_NOT_SPACE+
3 { MSGID="$MATCH" }
4
5 :0
6 * MSGID ?? ^$RE_SPACE*$|^<>$
7 {
8   :0
9   * ^Resent-Message-Id:$RE_SPACE*\/$RE_NOT_SPACE+
10   {
11     LOGLATER="get-msgid:   lacking message-id, using resent-message-id...$NL"
12     :0 fw
13     |$FORMAIL -R Resent-Message-ID Message-ID
14   }
15
16   :0 E
17   {
18     LOGLATER="get-msgid:   lacking message-id, generating one...$NL"
19     :0 fw
20     |$FORMAIL -a Message-ID:
21   }
22
23   :0
24   * ^Message-Id:$RE_EXTRACT_HEADER_VALUE
25   { MSGID="$MATCH" }
26 }
27
28 :0
29 * ! MSGID ?? ^<[^>]+>$
30 {
31   LOGLATER="get-msgid:   message-id '$MSGID' not enclosed in <>, fixing it...$NL"
32   MSGID="<$MSGID>"
33 }
34
35 :0
36 *$ MSGID ?? .+@$RE_MAILRELAYS>
37 *$ !^Return-Path: .+@$RE_MAILRELAYS\>
38 *$ !^Received: by $RE_MAILRELAYS \(postfix, from userid
39 * MSGID ?? ^<\/[^>]+
40 {
41   LOGLATER="get-msgid:   missing message ID added by one of our mail relays$NL"
42   MSGID="<${MATCH}.MSGID-ADDED>"
43 }