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 726728 - Configure saving drafts on/off
Configure saving drafts on/off
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: server-support
0.6.x
Other Linux
: High normal
: 0.8.0
Assigned To: Geary Maintainers
Geary Maintainers
: 713519 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-03-19 17:32 UTC by mock
Modified: 2017-09-23 12:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
from one google mail account (231.84 KB, image/png)
2014-03-19 17:32 UTC, mock
Details
the other google mail account (236.69 KB, image/png)
2014-03-19 17:33 UTC, mock
Details
nothing new in drafts folder (115.49 KB, image/png)
2014-03-19 17:34 UTC, mock
Details
verifying the empty drafts folder despite having drafts in my conversations (58.20 KB, image/png)
2014-03-19 17:35 UTC, mock
Details

Description mock 2014-03-19 17:32:57 UTC
Created attachment 272411 [details]
from one google mail account

when creating messages in geary for my added google mail account (mail through a google apps account), i can end up with draft copies of a message which only appear in my gmail app on my phone (nexus 5). i assume it might the autosave for drafts, but if the message takes a long time before i hit send then it can generate many of these drafts. (for one message a little bit ago, i ended up with 39 drafts dispersed throughout the "conversation.")

these drafts are not in any draft folder: not geary, not my gmail account (web interface), not even the gmail app. they only exist within the conversation, usually between replies. in order to delete them, i cannot bulk select them. i must edit each one and choose discard from the menu to remove them.

this has only happened when i use geary. i had problems in 0.4.x. i compiled 0.5.x which still demonstrated the same behavior. i compiled the 0.6.x version hoping this matter had been resolved, but it remains.

i like geary, but the clean up of these drafts gets out of hand too quickly for it to make this worth using right now. i'm attaching a few screenshots of what i end up with when this happens.

i'm running fedora 20 with gnome 3.10 and all the updates for my distro. my phone is a nexus 5 running android 4.4.2 (kitkat build KOT49H) and gmail app version 4.7.2 (967015).
Comment 1 mock 2014-03-19 17:33:49 UTC
Created attachment 272412 [details]
the other google mail account
Comment 2 mock 2014-03-19 17:34:21 UTC
Created attachment 272413 [details]
nothing new in drafts folder
Comment 3 mock 2014-03-19 17:35:01 UTC
Created attachment 272414 [details]
verifying the empty drafts folder despite having drafts in my conversations
Comment 4 Charles Lindsay 2014-03-19 18:12:31 UTC
> they only exist within the conversation

To be clear, do you mean that they only exist within the conversation *on your phone*, not even in the conversation in gmail or in Geary?

I don't have a modern android device, but in my old one, there is an option to re-sync with the server.  What happens if you do that?
Comment 5 mock 2014-03-19 19:21:23 UTC
yes, that's correct. only in my phone's gmail app/client. i had at one point planned to do the select many and delete in the web client, but they didn't even exist in the conversation there.

in my experience, refreshing my mail client did not clear the messages. i had even let it spend time overnight to clear them. they didn't go away.
Comment 6 Jim Nelson 2014-03-20 19:14:34 UTC
There's a couple of things that would help us here.

First, in your Gmail Settings under "Forwarding and POP/IMAP", there's two IMAP options that may be affecting this: "When I mark a message in IMAP as deleted:" and "When a message is marked as deleted and expunged from the last visible IMAP folder:".  How do you have those configured?

Second, are there any configuration settings on your Android Gmail app that might be of interest here?  Anything related to Drafts, Trash, or deleting/expunging would be good to know about.

Third, a network log would be helpful to see if the drafts are being trashed or not.  If you could run Geary like this:

$ geary --debug --log-network > geary.log

Reproduce the problem, then send that file to geary@yorba.org.  You'll probably want to redact the log file of usernames, passwords, and any sensitive material.
Comment 7 mock 2014-03-21 13:57:52 UTC
answers:

1. the defaults for both these options are chosen. in order, "auto-expunge on" and "archive the message."

2. there are no settings that effect the folder in a similar way as that of the web interface.

3. i have emailed a redacted geary.log file to the address above.
Comment 8 Jim Nelson 2014-03-25 00:09:43 UTC
Those settings are what I use.  The log file indicates the draft is properly deleted: Geary's issuing the commands, the server sends back OK for both as well as the IMAP notifications of it going away.  So, I'm at a loss as to what's going on here.

This is what I suspect is happening: one of Gmail's odd side-effects (from an IMAP perspective) is that if a message is deleted from Drafts, it's not actually deleted but moved to Trash.  That's not true in other folders.  For example, in Inbox, deleting a message merely removes it from the Inbox.  It's still located in All Mail and whatever other labels you may have assigned to it.

It looks to me that your mobile app is seeing these drafts in All Mail and threading them into the conversation.  Alternately, the Gmail app is seeing them in the Trash and not blacklisting them.  (Geary does this, for example, to prevent trashed messages from being included in a conversation.)  I can't be certain, but it really sounds like a bug on your phone's client.

One experiment you might try is deleting the drafts from your Trash folder (using Geary or the web interface), re-sync your client, and see if the problem persists for that conversation.  If not, it sounds like the client is including trashed messages in the conversation.
Comment 9 Federico Bruni 2014-03-25 12:32:37 UTC
I can confirm this bug (I'm using Cyanogenmod 10.1.3, Android 4.2.2).
I'll try upgrading and see if it's fixed.
For the moment, the workaround is entering the trash folder and manually deleting the drafts.

It seems that it's an old problem:
https://bugzilla.mozilla.org/show_bug.cgi?id=562748 (read comment 13)
http://forums.mozillazine.org/viewtopic.php?f=31&t=2288873
http://www.macobserver.com/tmo/answers/how_to_configure_apple_mail_to_avoid_duplicate_drafts_with_gmail
Comment 10 Federico Bruni 2014-03-25 14:22:48 UTC
BTW, the same problem occurs using Icedove/Thunderbird 24.4.0
Comment 11 mock 2014-03-25 14:38:59 UTC
ok, i see the drafts in the trash in all clients. (it's not possible to delete from the trash folder on the mobile gmail client...?)

i guess deleting the drafts from the trash folder is the short term solution.

i did test this process out in evolution using imap connections to my gmail accounts, and there are no drafts leftover in any of the folders like in geary. evolution is perhaps cleaning these up? dunno.
Comment 12 Jim Nelson 2014-03-25 19:16:41 UTC
Looking over the comments in the other reports (esp. the Thunderbird ticket), it looks like the problem is indeed the Gmail app threading in messages stored in the Trash.  It also doesn't sound like Google is going to fix that any time soon.

The ticket also made an interesting discovery: if the drafts stored in the Trash are marked with the \Deleted flag (but not expunged) they won't be included in the app's conversations.  That's something we could consider as well, but in my mind it's a work-around, not really the solution.
Comment 13 Jim Nelson 2014-03-25 19:21:07 UTC
> i did test this process out in evolution using imap connections to my gmail
> accounts, and there are no drafts leftover in any of the folders like in geary.
> evolution is perhaps cleaning these up? dunno.

I'd have to take a closer look at Evolution, but I suspect it's storing its drafts in a local folder, not the server.  (When I create a draft with my version of Evolution, it does not appear on the server.)  Geary doesn't have a notion of a local-only folder yet (bug #713898, bug #713581).
Comment 14 Jakob Unterwurzacher 2014-04-08 21:21:52 UTC
Just to let you know, I posted the issue on the Google product forum a week ago and got zero response: https://productforums.google.com/forum/#!category-topic/gmail/reading-and-receiving-messages/2HpQGwj9R20

What Geary probably has to do is to delete the drafts from the trash, too, when talking to Gmail.
Comment 15 Jim Nelson 2014-04-10 19:54:15 UTC
*** Bug 713519 has been marked as a duplicate of this bug. ***
Comment 16 Federico Bruni 2014-04-28 11:41:53 UTC
There's been a follow-up from Google:

"The problem would appear to be that you are saving drafts created in your IMAP client to the server. 

That entails multiple copies of the message you are composing being sent to the Gmail server. These are not actually the same type of file as Gmail's "Drafts" - because they are being sent as messages by your client to your Gmail account, so they have similar characteristics to ordinary messages, and when Trashed when a message is finally sent, will appear in Trash. 

Why your Gmail App is including them in the conversation view when Gmail in a browser does not I can only guess, but it could possibly be related to whether or not Geary removes the Inbox label when the messages get deleted after sending. Some clients do not, and whilst in the web interface, the Trash label always takes priority over any other label a message might have, it might lead to confusion in the Gmail App.  

The simple answer is probably to turn off Save Drafts to Server in your email client, and just have your drafts saved locally within the client till you are ready to send. "

As a temporary workaround, could you consider the idea of add a preference to disable the autosave of drafts? Maybe as an (hidden) option to set in geary.ini, so it doesn't appear on the user interface?

This problem is rather annoying and it's preventing me from using Geary with a Google account.
Comment 17 Jim Nelson 2014-05-06 20:44:25 UTC
Ok, I was getting ready to write a rather heated response, but I took the time to follow Jakob's link and see that the Google engineer did a little more homework and came to realize that the Gmail App was the problem here, not Geary (or Thunderbird, Outlook, or Apple Mail).

I do think a master switch somewhere to turn this off would be useful.  I'm renaming this ticket to reflect that.
Comment 18 Jim Nelson 2014-05-28 01:46:50 UTC
Geary now has a "Save drafts" checkbox in the Accounts dialog.  Hopefully this helps work around these problems.

Pushed to master, commit 9741f6
Comment 19 Federico Bruni 2014-05-28 12:14:15 UTC
Yup, it helps. Thanks!
Comment 20 Frédéric Parrenin 2014-09-27 20:46:15 UTC
I can reproduce this problem with 0.8.0.
Comment 21 Jim Nelson 2014-09-30 19:23:09 UTC
This patch is merely about turning off saving drafts to workaround the problem.  The real solution is for Google to fix their apps not to include messages in Trash in a conversation.
Comment 22 Federico Bruni 2014-11-06 21:08:57 UTC
A quick comment to let you know that Google didn't fix this problem in version 5.0 of Gmail, released yesterday
Comment 23 Michael Gratton 2016-11-21 23:38:08 UTC
Hey all, can anyone confirm if this is still a problem in Google's GMail apps?

I'd like to remove the account pref if they have resolve it.