Running with the --debug flag produces these two interesting lines:
compared to a good e-mail that produces:
internal date from 1: [31-Dec-2007 16:04:27 +4000]
internal date from 1: [""] (fixed)
+4000 doesn't make sense as a time offset, and I still don't know where that comes from.
internal date from 1: [18-Mar-2008 18:34:21 -0700]
internal date from 1: ["18-Mar-2008 18:34:21 -0700"] (fixed)
In my understanding, the internal dates as derived from an mbox file come from the very first line of an e-mail that begins with "From ". In this example, those lines are as follows:
From firstname.lastname@example.org Mon Dec 31 16:04:27 2007
On the same system where I'm running imapsync, I have tried this tiny perl program:
From email@example.com Tue Mar 18 18:34:21 2008
Date::Manip->import(qw(ParseDate Date_Cmp UnixDate));
$a = 'Mon Dec 31 16:04:27 2007';
$d = ParseDate($a);
$dd = UnixDate($d, "%d-%b-%Y %H:%M:%S %z");
Which is the correct answer (note -0700 vs +4000). So the date manipulations involved in imapsync seem to be working correctly.
31-Dec-2007 16:04:27 -0700
This is the last roadblock I have come across in the process of migrating to Zimbra. Any help would be greatly appreciated.