GNOME Bugzilla – Bug 578287
MAPI now sort of works, but some information is garbled and hangs occur
Last modified: 2009-06-10 03:48:33 UTC
Please describe the problem: I'm following evo's svn/trunk development, and after several months of it not working (partly because of some symbolic link issues in openchange's install) got MAPI to work again (yesterday). I see my remote folders and their contents (and some old mail that was sitting there looked right). Today I tried testing the account by sending myself an e-mail (from a non-mapi account to the mapi account, which is served on another host). The mail arrived, but the header was garbled (the body was fine). What I should have seen was: From: David Ronis <David.Ronis@McGill.CA> Reply-to: ronis@ronispc.chem.mcgill.ca To: associatechair.chemistry@mcgill.ca Subject: TEST Date: Tue, 07 Apr 2009 14:53:49 -0400 123 What I got was stuff like: From: h?f <h?f> Subject: mapi_SPropValue_array_named (the copy of the message in my sent folder is ok). I just tried a 2nd test. The test went out fine, but now evo has stalled in fetching the mail from the mapi account (pressing cancel and/or cancel all doesn't help). I've pasted a backtrace (by attaching gdb to the evo process) below. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information: (gdb) thread apply all bt full
+ Trace 214262
Thread 3 (Thread 0xab40fb90 (LWP 18849))
Thread 2 (Thread 0xa7386b90 (LWP 18858))
Actually, things are a bit worse than I just reported. Evo seems hung, I can't close the window, even with the window-kill button on the border. One other bit of information: I had deleted the 1st e-mail before sending the 2nd. Funny thing is that it never appeared in the trash on the local machine or MAPI account.
One final obseration (for now). The information on the message list (preview) looks right.
*** Bug 581595 has been marked as a duplicate of this bug. ***
I just upgraded to the svn/trunk of svn and retried the test. The message is no longer garbled. However, deleting it (which I presume should result in the message appearing in the MAPI account's "deleted" folder) does the following: 1. the Message disappears from the Mapi/Inbox folder. 2. I see, "Storing folder 'Mailbox - MyAccountName/Deleted Items' (...) in evo's status bar. 3. On the console I see: exchange-mapi-connection.c:2258: Leaving exchange_mapi_set_flags exchange-mapi-connection.c:1004: Entering exchange_mapi_connection_fetch_items: folder-id 2403D60000000001 libexchangemapi-Message: exchange-mapi-connection.c:1006: exchange_mapi_connection_fetch_items: lock(connect_lock) libexchangemapi-Message: exchange-mapi-connection.c:1225: exchange_mapi_connection_fetch_items: unlock(connect_lock) exchange-mapi-connection.c:1227: Leaving exchange_mapi_connection_fetch_items: folder-id 2403D60000000001 exchange-mapi-connection.c:2216: Entering exchange_mapi_set_flags libexchangemapi-Message: exchange-mapi-connection.c:2218: exchange_mapi_set_flags: lock(connect_lock) libexchangemapi-Message: exchange-mapi-connection.c:2256: exchange_mapi_set_flags: unlock(connect_lock) exchange-mapi-connection.c:2258: Leaving exchange_mapi_set_flags exchange-mapi-connection.c:2365: Entering exchange_mapi_remove_items libexchangemapi-Message: exchange-mapi-connection.c:2367: exchange_mapi_remove_items: lock(connect_lock) libexchangemapi-Message: exchange-mapi-connection.c:2416: exchange_mapi_remove_items: unlock(connect_lock) exchange-mapi-connection.c:2418: Leaving exchange_mapi_remove_items exchange-mapi-connection.c:1004: Entering exchange_mapi_connection_fetch_items: folder-id 2703D60000000001 libexchangemapi-Message: exchange-mapi-connection.c:1006: exchange_mapi_connection_fetch_items: lock(connect_lock) libexchangemapi-Message: exchange-mapi-connection.c:1225: exchange_mapi_connection_fetch_items: unlock(connect_lock) exchange-mapi-connection.c:1227: Leaving exchange_mapi_connection_fetch_items: folder-id 2703D60000000001 4. Pressing Send/Receive in evo, hangs at the MAPI account, and this is not interrupted by pressing 'Cancel All' 5. Trying to exit evo hangs & I'm forced to use --force-quit My bet is that some thread is blocking the exchange operations. I've attached to the current evo process and generated a new backtrace:
+ Trace 215248
Thread 4 (Thread 0xb163db90 (LWP 32515))
Thread 3 (Thread 0xa8ab0b90 (LWP 32543))
One additional observation: after restarting evolution (1st running with --force-shutdown) I notice that the Exchange MAPI Inbox & Deleted Items folders are both empty; i.e., the mail was really deleted. I don't know if this is the expected behavior.
Created attachment 134297 [details] Garbled header using MAPI This shows the garbled To and ReplyTo fields.
I can confirm intermittent occurance of the garbled header issue described above. I am running Unbunto 9.04, and have built Evolution, Evolution data server and Evolution-mapi from their GIT master branches today (May 9, 2009). The mail account is on a MS Exchange small business server 2007. I have used both the openchange --sendmail tool and evolution to send to the account. Both result in the garbled header display when the mail is fetched by evolution (screenshot attached). Using openchange --fetchmail tool, the headers are not corrupted. Note that the issue described also occurs when using Evolution 2.26 and evo-mapi installed from synaptic.
Created attachment 134556 [details] Garbled headers using MAPI still occurring Patch as per http://bugzilla.gnome.org/attachment.cgi?id=132189 for bug http://bugzilla.gnome.org/show_bug.cgi?id=569321 was applied to evolution-mapi source and rebuilt. Re-fetch by evolution forced by deleting folders.db file. Garbled headers still occurring, with same errors on same mails. Similar corruption can also still be seen on emails sent/received after the patch application.
Created attachment 134557 [details] Garbled headers using MAPI still occurring (2) Email sent/received after patch application.
Created attachment 134558 [details] Source of message with corrupted headers
Created attachment 134560 [details] Openchange fetchmail openchangeclient --database=/students/u4495166/.openchange/profiles.ldb --profile=davidayton --to=davidayton@spectre.local --fetchmail > ~/Desktop/fetchmailtest.txt
Created attachment 134561 [details] Openchange fetchmail with network trace openchangeclient --database=/students/u4495166/.openchange/profiles.ldb --profile=davidayton --to=davidayton@spectre.local --fetchmail --dump-data -d10 > ~/Desktop/fetchmail_trace_test.txt
(In reply to comment #12) > Created an attachment (id=134561) [edit] > Openchange fetchmail with network trace > > openchangeclient --database=/students/u4495166/.openchange/profiles.ldb > --profile=davidayton --to=davidayton@spectre.local --fetchmail --dump-data -d10 > > ~/Desktop/fetchmail_trace_test.txt > Thanks for the update. As we talked on IRC, could you also try to get valgrind traces of the new fetch of evolution (steps like: delete local mapi account cache; run evolution as this: $ valgrind --leak-check=full evolution &>evo.log and then try to open the test message in evolution (it should fetch it from the server). Let's see what it'll show us. Note: Maybe the folder structure will be shown in the second run, so the second log might be OK, I hope.
Created attachment 134682 [details] [review] Test patch David, try it with this patch. Let me look for leaks and fix them in the meanwhile. Clear your MAPI mailer cache before testing it out.Thanks
Created attachment 134717 [details] Backtrace while mapi is trying to save remote folder See thread #4.
Hi Bharath, It worked (although clearing the cache was essential). The message is no longer corrupted in the display. The problem with deleting a message still remains. I deleted a message in the mapi inbox Evo reports "Storing folder 'Mailbox -- ... which seems to hang (the rest of evo is working fine, so it's probably just the thread that's stuck). I'll attach another backtrace in a minute. Thanks Hmmm... This doesn't seem to have been saved. I'll try again (the attachment already appeared).
Some sort of collision occured. The backtrace comment was deleted, but the backtrace attachment is still there: https://bugzilla.gnome.org/attachment.cgi?id=134717
Created attachment 134740 [details] valgrind log Milan, As requested valgrind log when starting evolution 2nd time after clearing cache, and fetching message "evo test 20".
Created attachment 134741 [details] Garbled headers fixed Bharath, I have applied your patch in http://bugzilla.gnome.org/attachment.cgi?id=134682 and can also confirm that it fixes the corrupted headers issue.
(In reply to comment #14) > Created an attachment (id=134682) [edit] > Test patch > > David, try it with this patch. Let me look for leaks and fix them in the > meanwhile. Clear your MAPI mailer cache before testing it out.Thanks > Marking patch as reviewed (helps in my queries). We still wouldn't want to comment out releasing message object. Nice work Bharath! (We probably have to start working against openchange 0.8.2 . We'll decide that in next team meeting. )
*** Bug 583298 has been marked as a duplicate of this bug. ***
Created attachment 135371 [details] [review] Evolution Mapi patch
(In reply to comment #22) > Created an attachment (id=135371) [edit] > Evolution Mapi patch > Can you cleanup (remove commented code and unused variables) the patch and commit.
Cleanup done and committed to master.