You are not logged in.

#1 2011-10-03 11:44:55

matse
Member
Registered: 2011-04-27
Posts: 299

[SOLVED] mutt - gmail (imap) and trash

Hello everybody,
I've switched to mutt some days ago and I have a little problem with my gmail account when it comes to deleting messages, which is done by moving them to the trash folder. So at first some parts of my muttrc:

set imap_user = "...@gmail.com"

set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed="+[Google Mail]/Drafts"

macro index,pager d "<save-message>=[Google<quote-char> Mail]/Trash<enter><enter>" "Trash"

So when pressing "d" the mail is automatically moved to trash but I receive thie error / warning at the bottom of mutt:

Mailbox was externally modified.  Flags may be wrong.

So does anybody know why I get this warning and how to solve the problem?
Greetings
matse

Last edited by matse (2011-10-26 21:59:04)

Offline

#2 2011-10-03 15:22:43

badfrog88
Member
Registered: 2010-08-13
Posts: 43

Re: [SOLVED] mutt - gmail (imap) and trash

The Crunchbang wiki has a very good entry that I used.

http://crunchbanglinux.org/wiki/howto/h … gmail_imap

Offline

#3 2011-10-03 15:27:59

matse
Member
Registered: 2011-04-27
Posts: 299

Re: [SOLVED] mutt - gmail (imap) and trash

Nice entry but it doesn't help me. Deleting mails isn't even mentioned in this wiki and everything else works fine. I also forgot to mention that even moving mails to trash works - it just shows me this warning.
So far,
matse

Offline

#4 2011-10-03 16:01:13

badfrog88
Member
Registered: 2010-08-13
Posts: 43

Re: [SOLVED] mutt - gmail (imap) and trash

I thought this was the entry that would solve the problem.

set trash = "imaps://imap.gmail.com/[Gmail]/Trash"

Sorry if this didn't help.  I'll check my .muttrc later and see what I have.

Offline

#5 2011-10-03 16:19:46

matse
Member
Registered: 2011-04-27
Posts: 299

Re: [SOLVED] mutt - gmail (imap) and trash

Oh you're right! In this tutorial they use a patched version of mutt with this patch. The mutt version from the official arch reps doesn't have this patch included, recompiling would be a solution but I would prefer to stay with "vanilla mutt".
Greetings,
matse

Offline

#6 2011-10-03 16:59:49

badfrog88
Member
Registered: 2010-08-13
Posts: 43

Re: [SOLVED] mutt - gmail (imap) and trash

Here is my .muttrc file. I did notice that I had to comment out the set trash statement.  I had played with Debian before coming back to Arch..

set from = "<gmail address>"
set realname = ""

set imap_user = "<gmail address>"
set imap_pass = "<password>"

set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
#set trash = "imaps://imap.gmail.com/[Gmail]/Trash"

set header_cache = ~/.mutt/cache/headers
set message_cachedir = ~/.mutt/cache/bodies
set certificate_file = ~/.mutt/certificates

set smtp_url = "smtp://<gmailaddress>@smtp.gmail.com:587/"
set smtp_pass = "<password>"

bind editor <space> noop
macro index gi "<change-folder>=INBOX<enter>" "Go to all mail"
macro index ga "<change-folder>=[Gmail]/All Mail<enter>" "Go to all mail"
macro index gs "<change-folder>=[Gmail]/Sent Mail<enter>" " Go to sent mail"
macro index gd "<change-folder>=[Gmail]/Drafts<enter>" "Go to drafts"

set move = no #Stop asking to "move read messages to mbox"!
set imap_keepalive = 900

Offline

#7 2011-10-03 17:09:23

matse
Member
Registered: 2011-04-27
Posts: 299

Re: [SOLVED] mutt - gmail (imap) and trash

Hmm I've just tried to compile mutt 1.5.21 with the latest patch from here. Unfortunately this patch is outdated and doesn't work with the recent version of mutt. There is an updated version (for 1.5.16, didn't test it with 1.5.21) on this site but since I don't want to rely on an unmaintained patch I'm looking for a solution without patch. But thanks for your help!
matse

Last edited by matse (2011-10-03 17:09:40)

Offline

#8 2011-10-03 19:15:25

badfrog88
Member
Registered: 2010-08-13
Posts: 43

Re: [SOLVED] mutt - gmail (imap) and trash

Maybe I've misunderstood you. Do you want some sort of "Trash" Directory that mutt would put the deleted files in?  I just noticed that when mutt deletes the files they don't appear in my gmail trash folder. Turns out they are only moved to the "All Mail folder".  sad

Last edited by badfrog88 (2011-10-03 19:26:06)

Offline

#9 2011-10-03 20:26:11

matse
Member
Registered: 2011-04-27
Posts: 299

Re: [SOLVED] mutt - gmail (imap) and trash

Hi,
yes exactly that's the problem, if you just delete a mail in mutt it is not really deleted, gmail just removes the "inbox" label (see here). So it is still in your "All Mail" folder. In order to delete it you have to move it to your trash (where it is deleted automatically after 30 days or if you delete if from there with mutt).
Greetings
matse

//Edit: so I guess the warning just tells you what I wrote above, that gmail removed the "Inbox" label, so I guess mutt just tells you that something else removed this flag. Since the "moving to trash" nevertheless works fine I guess best solution is probably to just ignore this message.

Last edited by matse (2011-10-03 20:46:54)

Offline

#10 2011-10-20 16:14:28

archtaku
Member
Registered: 2010-07-02
Posts: 84

Re: [SOLVED] mutt - gmail (imap) and trash

If you want to get rid of the error message, you can do so by making your delete action a macro:

# \043 = pound sign (like the keyboard shortcut for Gmail's web interface)
macro index,pager \043 "<save-message>=[Gmail]/Trash<enter><enter><refresh>" "Trash Message"

The <refresh> action will redraw the window immediately after moving the message to the trash folder, making the error message disappear.

Of course, you won't see the message saying "4 kept, 1 deleted", but then again with this error message popping up you weren't seeing it anyway. This will at least get rid of the error if it bothers you.

Last edited by archtaku (2011-10-20 16:14:57)

Offline

#11 2011-10-26 21:58:50

matse
Member
Registered: 2011-04-27
Posts: 299

Re: [SOLVED] mutt - gmail (imap) and trash

Hi archtaku,
I've read your mail last week and completely forgotten to report that your workaround works great, thanks for the hint. Marking the thread as solved now.
Greetings
matse

Offline

#12 2011-10-26 22:01:15

archtaku
Member
Registered: 2010-07-02
Posts: 84

Re: [SOLVED] mutt - gmail (imap) and trash

Awesome, glad to hear it.

Offline

#13 2011-11-04 20:56:25

TehBanz
Member
Registered: 2011-09-08
Posts: 6

Re: [SOLVED] mutt - gmail (imap) and trash

archtaku, thank you so much for the workaround! it works for me too. Just had to let you know!

Offline

Board footer

Powered by FluxBB