Wrong receive dates for imported messages in ActiveSync
I have problems with importing mails via webgui/roundcube. I succesfully imported ~500 mails, means all timestamps are correct in roundcube. After syncing the inbox to my android device all mails shows the receive date based on the import date. So all mails have the same date. I thought, this is based on the filsystem and the corresponding file dates. I did a
for i in $(ls -1 *.); do t=
egrep '^Date\:' $i | tr -d '[\r]' | head -1 | cut -d " " -f2-80; touch -d "$t" $i; done
to change the modify timestamp for each mail but this did not solve the problem. I don't understand why ActiveSync is using the import date and roundcube not. Is it possible to manipulate the dates?
For now I am not able to change this, hence the ActiveSync is useless.
ActiveSync protocol uses "received date" not "sent date". So, it uses IMAPs INTERNALDATE property not Date: header.
It would be possible to set INTERNALDATE to the timestamp specified in Date: header on messages import, but it's not implemented in Roundcube.
Why are you importing so many messages via Roundcube? Maybe something like imapsync would be better (should keep the old received date).
many Thanks for your fast repsonse. I switched from zimbra to kolab on the same machine. Therefore it was not possible to sync two imap folders / accounts. Before I reinstalled the system (centos) and installed kolab I did an export for each mail account. The export is a tar file which includes all imap folders with eml and meta file for every mail.
Could you please give more details on how to set the INTERNALDATE? Sry, but I am not so familiar in this area but scripting would not be the problem for me .
I don't know it's possible to script this. Probably using IMAP communication with APPEND commands that would be possible. I was talking about modification of Roundcube code to do this.
5th argument of save_message() method is internal date in IMAP format e.g. "17-Jul-1996 02:44:25 -0700". So, you'd need to extract the date from Date: header and use it as 5th argument.
ok, many thanks for that hint!
I have just seen, that imapsync is payware. Is there free software for syncing imap folders, do you know something similar?
Perhaps you should give the free imapsync a try.
Looks quite promising.