After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679041 - Incorrect date in Sent Items folder
Incorrect date in Sent Items folder
Status: RESOLVED FIXED
Product: evolution-mapi
Classification: Applications
Component: Mail
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: evolution-mapi-maint
evolution-mapi-maint
Depends on:
Blocks:
 
 
Reported: 2012-06-28 10:28 UTC by Gianluca Cecchi
Modified: 2012-07-11 10:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ema patch (2.09 KB, patch)
2012-07-02 10:15 UTC, Milan Crha
committed Details | Review

Description Gianluca Cecchi 2012-06-28 10:28:41 UTC
I'm using Fedora 17.
One strange thing happens, passing from evolution-mapi-3.4.1-3.fc17.x86_64 to (I presume) both evolution-mapi-3.4.3-1.fc17.x86_64 and evolution-mapi-3.4.3-2.fc17.x86_64

The "Date" column in "Sent Items" is 2 hours ahead ...

Suppose now we are at 15:00.
I send an e-mail from evolution mapi account and I go in sent items I see 17:00.

Another test is: connect with owa with firefox. Send an e-mail from owa (suppose 15:05).
In owa sent items time is ok.
I then go in evolution that in the mean time has syncronized and shows the same message with time 17:05..

Did anything change in locale from
Jun 11 21:48:02 Updated: evolution-mapi-3.4.2-1.fc17.x86_64

to
Jun 26 09:56:51 Updated: evolution-mapi-3.4.3-1.fc17.x86_64

Jun 26 14:55:59 Updated: evolution-mapi-3.4.3-2.fc17.x86_64
?

To let understand better:
suppose from evolution I send an e-mail to an Exchange Server distribution list and I'm a component of this DL.
As soon as I send the e-mail, I get it both in my inbox folder (a) and my sent items folder (b).
(a) item has the right value in "date" column
(b) item has an incorrect value in "date" column (2 hours ahead)
Comment 1 Milan Crha 2012-06-28 10:46:14 UTC
Thanks for a bug report. I can confirm it, as I can reproduce it too. I think it has something to do with UTC offset or something like that. I'll investigate further.
Comment 2 Milan Crha 2012-07-02 10:15:23 UTC
Created attachment 217817 [details] [review]
ema patch

for evolution-mapi;

The problem was with call to ctime(), which converts passed-in UTC time into local time and from it returns a string representation of the time. The difference between UTC and local time is indicated in the message list and Date header. Thinking of it, using ctime is an overhead, and simple assignment of an UTC time into received/sent times is sufficient.

Inbox folder didn't suffer of this, because there was used time encoded in PidTagTransportMessageHeaders property, where server/sender encoded time correctly. The Sent folder doesn't contain this property, thus there was used this "get time from MAPI properties" fallback code.
Comment 3 Milan Crha 2012-07-02 10:19:57 UTC
I forgot to add, the fix works only for newly received/recognized messages. To have it working fully one should vanish his/her local cache, which is located at:
  ~/.cache/evolution/mail/<uid-of-mapi-account>/

Created commit e570e7b in ema master (3.5.4+)
Created commit ec53ec7 in ema gnome-3-4 (3.4.4+)
Comment 4 Gianluca Cecchi 2012-07-04 07:56:58 UTC
let me know when pre-built packages for fedora 17 are going to be available to test this patch.
Or if I need to source compile...
Gianluca
Comment 5 Milan Crha 2012-07-04 10:33:09 UTC
I didn't plan to, but sure, it'll be better to test it. Here's [1] a scratch build with the patch included.

[1] http://koji.fedoraproject.org/koji/taskinfo?taskID=4217897
Comment 6 Gianluca Cecchi 2012-07-04 11:02:57 UTC
sorry for my ignorance. When you say scratch build it means you provide src.rpm and I have to build it? I don't find the rpm to directly install..
Comment 7 Milan Crha 2012-07-09 07:11:27 UTC
Scratch means it's not for updates, but can be downloaded. If you click on the build name of the arch you use, then at the bottom of that page are shown packages which you can download and install. As a scratch build these will be deleted from the server within few days.
Comment 8 Gianluca Cecchi 2012-07-09 08:27:32 UTC
I confirm that with the scratch build, so passing from
evolution-mapi-3.4.3-2.fc17.x86_64
to
evolution-mapi-3.4.3-5.1.fc17.x86_64
indeed fixes the sent items problem for me.
Tred to remove only 

~/.cache/evolution/mail/<uid-of-mapi-account>/folders/Mailbox\ -\ Cecchi\ Gianluca/sub/Posta\ inviata/cache/*

but doesn' work for older items.
Probably I need to remove all the contents under ~/.cache/evolution/mail/<uid-of-mapi-account> ?
But it is not so important...
Thanks and waiting for final fixes coming to Fedora
Comment 9 Milan Crha 2012-07-10 06:59:44 UTC
(In reply to comment #8)
> Tred to remove only 
> 
> ~/.cache/evolution/mail/<uid-of-mapi-account>/folders/Mailbox\ -\ Cecchi\
> Gianluca/sub/Posta\ inviata/cache/*
> 
> but doesn' work for older items.

The information you see in message list is stored in
   ~/.cache/evolution/mail/<uid-of-mapi-account>/folders.db
file. The actual messages are stored in cache you deleted. Thus, I guess, you see correct time in message itself, in preview panel, but incorrect time in message list.
Comment 10 Gianluca Cecchi 2012-07-11 10:28:21 UTC
You were correct. And after deleting folders.db and regenerating cache, the timestap is correct in messsage list too.
Thanks