From cec7fa6b3df885a566bb3a68c4311be126b61b6f Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 14 Jul 2009 09:43:30 +0200 Subject: [PATCH 1/1] ensure that logfile filenames are < 255 --- procmail/logging | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/procmail/logging b/procmail/logging index d6fc083..7068e4d 100644 --- a/procmail/logging +++ b/procmail/logging @@ -5,8 +5,23 @@ MSGIDDIR=$PMVAR/msgid :0 * MSGID ?? ^<\/[^>]+ { - THISLOGFILE_REL=`echo $MATCH | tr -d "'\"?[:cntrl:]" | tr ' /*$' '__+S'`%$OURDATE_SHORT + MSGID_NAME=`echo $MATCH | tr -d "'\"?[:cntrl:]" | tr ' /*$' '__+S'` + + #VERBOSE=yes + # check if filename > 228 characters and if so, then shorten it to prevent + # hitting filesystem limit after we append the timestamp + :0 + * MSGID_NAME ?? ^..................................................................................................................................................................................................................................... + { + HASH=`echo $MSGID_NAME | md5sum | cut -d' ' -f1` + MSGID_NAME=`echo $MSGID_NAME | cut -c-196`$HASH + } + + THISLOGFILE_REL=$MSGID_NAME%$OURDATE_SHORT THISLOGFILE="$MSGIDDIR/$THISLOGFILE_REL" + + MSGID_NAME + #VERBOSE=no } MASTERLOGFILE="$LOGFILE" @@ -31,4 +46,4 @@ TRAP="DESTFILE=\"\${LASTFOLDER#$BASE/}\"; /bin/cat '$THISLOGFILE' >> $MASTERLOGFILE; /bin/rm -f $PMVAR/lock\" 0" -#VERBOSE=yes +THISLOGFILE_REL -- 2.39.5