Running with the --debug flag produces these two interesting lines:
Code:
internal date from 1: [31-Dec-2007 16:04:27 +4000]
internal date from 1: [""] (fixed)
compared to a good e-mail that produces:
Code:
internal date from 1: [18-Mar-2008 18:34:21 -0700]
internal date from 1: ["18-Mar-2008 18:34:21 -0700"] (fixed)
+4000 doesn't make sense as a time offset, and I still don't know where that comes from.
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:
broken:
Code:
From user@domain.com Mon Dec 31 16:04:27 2007
not broken:
Code:
From user@domain.com Tue Mar 18 18:34:21 2008
On the same system where I'm running imapsync, I have tried this tiny perl program:
Code:
#!/usr/bin/perl
require Date::Manip;
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");
print $dd;
print "\n\n";
which returns:
Code:
31-Dec-2007 16:04:27 -0700
Which is the correct answer (note -0700 vs +4000). So the date manipulations involved in imapsync seem to be working correctly.
This is the last roadblock I have come across in the process of migrating to Zimbra. Any help would be greatly appreciated.
Thanks.