GNOME Bugzilla – Bug 654543
Mark as junk doesn't work
Last modified: 2012-06-06 15:17:34 UTC
EWS + Exchange 2010 1. Select any message in message list 2. Right click -> mark as junk or go to tool bar -> click on 'mark selected message as junk' 3. Nothing happens Expected - Message should be moved to junk email folder or at least tagged as junk, should be shown in junk e-mail folder.
we have the bug open, will be handled.
Created attachment 205351 [details] [review] Evolution EWS patch Outlook allows you to block a particular sender/domain, mark them safe and junk filtering is supported by Microsoft internal technology. I don't see any ews API supporting these operations. What I have done in this patch, marking the message as junk will move the message to Junk E-mail folder and will be deleted from current folder. The same approach is used in evolution-mapi. Thanks!
Review of attachment 205351 [details] [review]: Please incorporate the changes and commit the patch. It would be nice if you attach the updated patch here and then mark it as committed. ::: src/camel/camel-ews-folder.c @@ +1575,3 @@ folder_class->transfer_messages_to_sync = ews_transfer_messages_to_sync; folder_class->get_filename = ews_get_filename; + folder_class->set_message_flags = ews_set_message_flags; In Ews we sync all the flags and perform necessary operations in the virual method ews_synchronize_sync. Over-riding set_message_flags might cause performance issues on a slow network, you should also handle all the flags operations such as read/unread, delete etc. Please perform this operation in syncronize_sync method rather than this. If the users wants immediate update on the server as when he marks a message as read/unread or junk etc. it should be provided using a option rather than providing this as a default.
Created attachment 211532 [details] [review] Evolution EWS patch I have done modifications accordingly. Changes are synced with ews_synchronize_sync. Thanks!
There are still some weak places in the patch. After recently discovered issues with Deleted flags you may want to change this. Having precedence on Deleted flag seems OK to me. You are leaking all the uids in junk_uids list. You are leaking 'ret_items' from e_ews_connection_move_items(), the content of the list, it is. You are leaking GCancellable in the ews_move_msg_to_junk(), which, by the way, should not create its own cancellable, neither use its own GError, it should have parameters for these variables. The change in API for e_ews_connection_move_items() is not necessary now, I just added camel_ews_store_summary_get_folder_id_from_folder_type() (I agree, it was needed before this function being added. I would not change the API now.) You should also provide CamelStore::get_junk_folder_sync function (I would extract content of get_trash_folder_sync() into a function which would take folder_type parameter and few others and reuse it in both places). Looking at the end of ews_synchronize_sync(), I see that 'success' variable is not considered properly (it has nothing to do with your patch as such, the issue is there already), if any of the previous operations will fail, then the other operation is done anyway, overwriting the 'success' variable, and possibly the error variable as well. That might be good to fix too.
One last thing, the removal of - g_slist_free (ids); in ews_transfer_messages_to_sync() is also not correct.
Created attachment 215753 [details] [review] ews patch for evolution-ews; Updated patch, which contains all the issues mentioned above, plus fixes few other issues. The patch is for gnome-3-4 branch.
Created commit 42cd667 in ews master (3.5.3+) Created commit e050900 in ews gnome-3-4 (3.4.3+)