Just wanted to add some knowlegde here from my own experience. I had the issue described in the first post where many of my older mail messages were all being imported as a single date ("01-Jun-2006" to be exact). I used the syncinternaldates like suggested but it was no luck. I did some investigation and it looks like my problem was on my old mail server's side (not zimbra yeah!) and it would report bad dates when fetching the time headers. However, even though the time headers (INTERNALDATE) were incorrect imapsync also parses each mail message header and I noticed the dates were correct on these. So I made a quick patch to imapsync that uses the date from the headers if the INTERNALDATE is reported incorrectly (or in my casd 01-June-2006 07:55). This might help someone else out of a jam.
*Must: apt-get install perl-Time-modules
*Code must change to enter your own problem date/change timezone
***Please use the code below at your own risk. Just a reference***
Code:
1329 my $key;
1 #!/usr/bin/perl -w
2
3 use Time::ParseDate;
4 use POSIX qw(strftime);
.
.
.
1330 if ($skipsize) {
1331 $key = "$m_md5";
1332 }else {
1333 $key = "$m_md5:$size";
1334 }
1335
+ 1336 if($idate =~ m/01\-Jun\-2006 07/ && $head->{Date}[0])
+ 1337 {
+ 1338 $idate = strftime('%d-%b-%Y %T -0700',localtime(Time::ParseDate::parsedate($head->{Date}[0])));
+ 1339 }
1340
1341 $s_hash->{"$key"}{'5'} = $m_md5;
1342 $s_hash->{"$key"}{'s'} = $size;
1343 $s_hash->{"$key"}{'D'} = $idate;
1344 $s_hash->{"$key"}{'F'} = $flags;
1345 $s_hash->{"$key"}{'m'} = $m_uid;