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 654543 - Mark as junk doesn't work
Mark as junk doesn't work
Status: RESOLVED FIXED
Product: evolution-ews
Classification: Other
Component: Mail
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: Evolution EWS maintainer(s)
Evolution EWS maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-07-13 11:14 UTC by Akhil Laddha
Modified: 2012-06-06 15:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Evolution EWS patch (6.11 KB, patch)
2012-01-16 10:30 UTC, Punit Jain
needs-work Details | Review
Evolution EWS patch (6.65 KB, patch)
2012-04-07 08:40 UTC, Punit Jain
needs-work Details | Review
ews patch (11.82 KB, patch)
2012-06-06 15:15 UTC, Milan Crha
committed Details | Review

Description Akhil Laddha 2011-07-13 11:14:40 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.
Comment 1 efrat adar 2011-08-03 10:39:40 UTC
we have the bug open, will be handled.
Comment 2 Punit Jain 2012-01-16 10:30:04 UTC
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!
Comment 3 Chenthill P 2012-02-17 05:22:02 UTC
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.
Comment 4 Punit Jain 2012-04-07 08:40:27 UTC
Created attachment 211532 [details] [review]
Evolution EWS patch

I have done modifications accordingly. Changes are synced with ews_synchronize_sync.

Thanks!
Comment 5 Milan Crha 2012-04-26 07:09:54 UTC
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.
Comment 6 Milan Crha 2012-04-26 07:15:38 UTC
One last thing, the removal of
-	g_slist_free (ids);
in ews_transfer_messages_to_sync() is also not correct.
Comment 7 Milan Crha 2012-06-06 15:15:36 UTC
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.
Comment 8 Milan Crha 2012-06-06 15:17:34 UTC
Created commit 42cd667 in ews master (3.5.3+)
Created commit e050900 in ews gnome-3-4 (3.4.3+)