Cannot delete mails on remote gmail server

456 views
Skip to first unread message

gerald.w...@gmail.com

unread,
Sep 17, 2018, 12:00:00 PM9/17/18
to mu-discuss
I have defined a gmail context für mu4e. I sync the "All mails" folder between google servers and my machine via offlineimap.

I was then moving mails from my local "All Mails" folder into a local archive folder that I do not include in sync. With those moved mails no longer in my local "All mails" folder I thought they would be deleted on the remote gmail folder. Thats how it works with my university mail server.

Yet: mails stay in the remote gmail "All mails" folder. Even if I delete the mail locally right away (using "D" = mu4e-headers-mark-for-delete), they are never deleted remotely! Instead, if I do a new mu4e-get-mail-command (=offlineimap), I get the previously removed mail back with a "ST" flag.

How can I actually DELETE mails remotely via mu4e ?

Thanks

emacs v. 27.0.50 mu4e v.1.1.0.C

Vladimir Sedach

unread,
Sep 17, 2018, 1:02:25 PM9/17/18
to mu-di...@googlegroups.com
> I was then moving mails from my local "All Mails" folder into a local
> archive folder that I do not include in sync. With those moved mails no
> longer in my local "All mails" folder I thought they would be deleted on
> the remote gmail folder. Thats how it works with my university mail server.

This is a problem with Gmail's deliberately incompatible IMAP
implementation and its abuse of folders and Gmail labels. See:

https://groups.google.com/forum/#!topic/mozilla.support.thunderbird/9T3VGSvPJgM

You need to go to Gmail IMAP/POP settings (in normal view; the
options are not available in HTML view) and set "When a message is
marked as deleted" to "Move to trash" or "Immediately delete." Also
set "Auto-Expunge off."

If I remember correctly I also had problems with messages with
multiple labels either showing up multiple times or not being deleted
correctly. The way to solve that problem was to remove all labels in
Gmail (I did not mind because labels had broken down as an
organizational tool after the first couple of thousand messages).

Between this and Gmail's privacy and deliverability (on the receiving
end) problems I became convinced that the real solution is to stop
using Gmail. Fortunately mu4e+offlineimap makes it effortless to use
multiple mail accounts and you can gradually transition from Gmail to
other email providers.

Vladimir

Gerald Wildgruber

unread,
Sep 17, 2018, 4:42:19 PM9/17/18
to mu-di...@googlegroups.com, v...@oneofus.la

Thanks Vladimir,

that made it somewhat clearer; and after my ongoing experience with Gmail, I guess you are right!

I set "Auto-Expunge off", and then (under "When a message is
marked as deleted") activated "Move to trash".

How or where can I "remove all labels" as you suggested?

What I get so far is the following: I can now "delete" in mu4e messages via "D", and upon a subsequent sync they do in fact no longer show up in my local INBOX.

But what happens server-side is unfortunately something completely different: "deleted" mails are no longer in the INBOX, but all of them are in the folder "all mails"; they weren't deleted at all, but only moved, into another folder, and not, as is documented, into "Trash". "Deleted" mails are somehow only archived or ignored.

Trying in vain the most simple of things -- to delete a mail -- for two days now becomes really obnoxious.

Can anyone help with what's going on here and how to really delete or at least move to "Trash" mails I delete locally?

Thanks

Gerald.

Vladimir Sedach

unread,
Sep 18, 2018, 3:04:55 AM9/18/18
to gerald.w...@gmail.com, mu-di...@googlegroups.com
> How or where can I "remove all labels" as you suggested?

In the Gmail web interface, under Settings > Labels, you can delete
labels, and control which labels show up as IMAP folders. I only have
"Show in IMAP" checked for Inbox.

> But what happens server-side is unfortunately something completely different: "deleted" mails are no longer in the INBOX, but all of them are in the folder "all mails"; they weren't deleted at all, but only moved, into another folder, and not, as is documented, into "Trash". "Deleted" mails are somehow only archived or ignored.

That does not seem to happen with my Gmail setup. The one other thing
I can think of is to set "type=Gmail" in the offlineimap
configuration instead of "type=IMAP" for the Gmail repository.

Vladimir

Gerald Wildgruber

unread,
Sep 18, 2018, 4:31:47 AM9/18/18
to mu-di...@googlegroups.com, Vladimir Sedach

On Di, Sep 18 2018, Vladimir Sedach <v...@oneofus.la> wrote:

>> How or where can I "remove all labels" as you suggested?
>
> In the Gmail web interface, under Settings > Labels, you can delete
> labels, and control which labels show up as IMAP folders. I only have
> "Show in IMAP" checked for Inbox.

This seems to be the one decisive setting! I unchecked everything except "INBOX" and "Sent", and now it works!

When I delete an email locally with mu4e and sync afterwards, the mail no longer shows up (on the gmail server) neither in INBOX, nor in "All mails" but in "Trash" (actually: for a brief time it is no longer in INBOX, but is still in "All mail" and is then moved from there to "Trash"). That's what I expected in the first place and how it worked with every other mail provider except Gmail.

> I can think of is to set "type=Gmail" in the offlineimap
> configuration instead of "type=IMAP" for the Gmail repository.

I had that already.

Thanks again Vladimir! This is solved now.
Reply all
Reply to author
Forward
0 new messages