Jeff Breidenbach said: > Solution sets that I see are: > > b1) ask mailme to do monthly sorts off of x-archive-with-date > headers primarily, received headers secondarily > b2) modify bounce.pl to generate x-archive-with-date based on > received headers.
Attached is b1), then. I've added some sanity checking for the date field so it should be pretty robust. With this implemented, it means that mailme expects bounce.pl (or equivalent) to set the x-archive-with-date field intelligently, and doesn't do any second guessing, which is how I think it should be. If it doesn't find x-archive-with-date, it looks for Received:, and if that's not set it falls over to Date:, which is the way Jeff's rcfile deals with dates too, so is consistent. So now mailme and rcfile agree that, if you're importing, you HAVE to set an intelligent x-archive-with-date field; else, they both use Received:, which goes by the clock on Jeff's server. I won't hack bounce.pl for fear of doing wrong, but yes I'm pretty sure I agree now that it should set x-archive-with-date from the original Recieved: fields if possible. Paul
--- mailme.jeff Sun Sep 5 14:08:19 1999 +++ mailme Sun Sep 5 15:25:07 1999 @@ -319,8 +319,26 @@ X14=`echo "$T" | grab "list-post"` # If indexing by month, we care about the date -DATE=`echo "$T" | grab "date"` -JUSTDATE=`echo $DATE | sed 's/^date: //i'` +# If importing, see if x-archive-with-date is set first. +# Use "Date:" as last resort because of mis-set clocks. +XDATE=`echo "$T" | grab "x-archive-with-date"` +[ ! "$XDATE" ] && XDATE=`echo "$T" | grab "received"` +[ ! "$XDATE" ] && XDATE=`echo "$T" | grab "date"` +if [ ! "$XDATE" ] +then + emergency_divert NODATE "Unable to find any date field." + exit -1 +fi +JUSTDATE=`echo "$XDATE" | sed -e 's/^date: //i' \ + -e 's/^x-archive-with-date: //i' \ + -e 's/^received: //i'` +date -d "$JUSTDATE" > /dev/null 2>&1 +ex=$? +if [ "$ex" != "0" ] +then + emergency_divert NODATE "Unable to find valid date field." + exit -1 +fi # Extract email addresses CHANCE=$(echo $TO $CC $X1 $X2 $X3 $X4 $X5 $X6 $X7 $X8 $X9 $X10 $X11 $X14 |\