From: martin f. krafft Date: Mon, 3 Mar 2008 12:38:09 +0000 (+0100) Subject: allow early scripts to properly log X-Git-Url: https://git.madduck.net/etc/mailfilter.git/commitdiff_plain/122f13badd406cf378fb4f57197d27ddebb4d15b?ds=inline allow early scripts to properly log --- diff --git a/procmail/defines b/procmail/defines index 55508cb..1c55b63 100644 --- a/procmail/defines +++ b/procmail/defines @@ -150,7 +150,7 @@ INCLUDERC=$PMDIR/get-msgid { ORIGINAL_TO="$MATCH" } :0 E * ^Received: -{ LOG="NO ORIGINAL_TO: $MSGID" } +{ LOGLATER="NO ORIGINAL_TO: $MSGID" } :0 *$ ^X-Trained-As:$RE_EXTRACT_HEADER_VALUE diff --git a/procmail/get-msgid b/procmail/get-msgid index 50fbef4..61eca10 100644 --- a/procmail/get-msgid +++ b/procmail/get-msgid @@ -8,14 +8,14 @@ :0 * ^Resent-Message-Id:[ ]*\/[^ ]+ { - 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 } :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: } @@ -28,7 +28,7 @@ :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>" } @@ -38,6 +38,6 @@ *$ !^Received: by $RE_MAILRELAYS \(postfix, from userid * MSGID ?? ^<\/[^>]+ { - LOG="get-msgid: missing message ID added by one of our mail relays$NL" + LOGLATER="get-msgid: missing message ID added by one of our mail relays$NL" MSGID="<${MATCH}.MSGID-ADDED>" } diff --git a/procmail/logging b/procmail/logging index a1e199a..d6fc083 100644 --- a/procmail/logging +++ b/procmail/logging @@ -12,8 +12,13 @@ MSGIDDIR=$PMVAR/msgid MASTERLOGFILE="$LOGFILE" LOGFILE="$THISLOGFILE" -LOG="============================================================================== -msgid: $MSGID +LOG="==============================================================================$NL" + +:0 +* LOGLATER ?? . +{ LOG="$LOGLATER" } + +LOG="msgid: $MSGID logfile: $THISLOGFILE_REL date: $DATE (@$OURDATE) from: $FROM