]> git.madduck.net Git - etc/mailfilter.git/blob - procmail/logging

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:

do not fail if there is just a single message
[etc/mailfilter.git] / procmail / logging
1 LOGABSTRACT=no
2
3 MSGIDDIR=$PMVAR/msgid
4
5 :0
6 * MSGID ?? ^<\/[^>]+
7 {
8   THISLOGFILE_REL=`echo $MATCH | tr -d "'\"?[:cntrl:]" | tr ' /*$' '__+S'`%$OURDATE_SHORT
9   THISLOGFILE="$MSGIDDIR/$THISLOGFILE_REL"
10 }
11
12 MASTERLOGFILE="$LOGFILE"
13 LOGFILE="$THISLOGFILE"
14
15 LOG="==============================================================================$NL"
16
17 :0
18 * LOGLATER ?? .
19 { LOG="$LOGLATER" }
20
21 LOG="msgid:       $MSGID
22 logfile:     $THISLOGFILE_REL
23 date:        $DATE (@$OURDATE)
24 from:        $FROM
25 original-to: $ORIGINAL_TO
26 subject:     $SUBJECT$NL"
27
28 TRAP="DESTFILE=\"\${LASTFOLDER#$BASE/}\";
29       /usr/bin/lockfile -4 -r50 -l180 $PMVAR/lock;
30       trap \"echo >> '$THISLOGFILE';
31              /bin/cat '$THISLOGFILE' >> $MASTERLOGFILE;
32              /bin/rm -f $PMVAR/lock\" 0"
33
34 #VERBOSE=yes