AdSense Mobile Ad

Tuesday, June 16, 2009

GMail with Evolution and the trash bin: how to organize mails and delete GMail messages

In part I of this series of posts (well, what meant to be just one post but it's going to explode...) I explored the basic configuration you need to setup Evolution as your GMail client. I also told you about GMail labels. labels are a mechanism to extend the concept of folders (in this case, IMAP folders): GMail servers indeed store just one copy of a message and if a message is labeled multiple times, the message will appear in all the corresponding folders. Label work just like UNIX hard links.

Folder names and GMail internal folders

GMail will provide one IMAP folder per label whose name will be the label's name. So far, so good. Now: GMail also uses some special folders to operate internally and you'll see them in the IMAP tree. These folders are:
  • [GMail]/All Mail
  • [GMail]/Drafts
  • [GMail]/Sent Mail
  • [GMail]/Spam
  • [GMail]/Starred
  • [GMail]/Trash
You really shouldn't use them but believe me, they just do what they say. Is it clearer why on part I we modified the default settings for some folders?
  • The [GMail]/Drafts folder is visible in GMail web interface, so it's very handy to have Evolution save drafts directly there: you could start a message on Evolution, save it, and then sending it from you mobile device. You should be aware of a gotcha: if you're editing a message with a large attachment beware that when the mail client saves it, it will indeed send the attachment to the server! In such cases, I just attach the file at last.
  • The [GMail]/All Mail folder contains a link to every single message in your account. That's why you should never store messages directly here unless you know what to do. We'll get into this later.
  • The [GMail]/Sent folder contains a link to every message you sent. GMail does this automatically for you: the message will be stored on the server and labeled accordingly. That's why you don't have to save sent messages on the server. You would simply waste bandwith!
  • The [GMail]/Starred folder contains a reference to starred messages. One more time you realize that everything's built around labels.
  • The [GMail]/Trash label is very special. We'll get into this later.

Copying and moving messages

The file metaphor still applies:
  • Copying a mail from a folder to another is equivalent to label a message with the destination folder's label.
  • Moving a mail from a folder to another means removing the origin folder's label and applying the destination folder's label.
In the introduction, I said that labels are similar to UNIX hard links. Yes, but there's an important difference: a mail isn't unlinked when its label counter is 0 and a mail can be unlinked even if its label counter is greater than 0.

Deleting messages

This is where things may not be so intuitive. I'll try to make it clera with an example: when you receive a message (and you don't have any auto-labeling filter triggered by such message), that email goes into the Inbox. Moreover, that message will automagically appear into the [GMail]/All Mails folder. Now: what's the IMAP gesture that corresponds to archiving such message? A valid answer would be: moving it to the [GMail]/All Mails folder. This would indeed translate to:
  1. Removing the GMail internal Inbox label.
  2. Applying the [GMail]/All Mails label (which is already applied to every message).
Thus, the only action you could perform would be removing the Inbox label and you could do it in a bunch of ways including:
  • Moving the message to a local (non-GMail) folder: this folder could also be the Evolution local Trash folder.
What has happened, then? Well: you think you deleted a message whereas you simply archived it. This is also true when multiple labels are applied. You can remove one label, but the same message could still be appearing in another n IMAP folders because of the remaining labels! How can you remove a message, then? Think about GMail web interface: when you delete a message, no matter the number of labels applied, what happens is that GMail is labeling it with the magic [GMail]/Trash label!
No matter how many labels a message has, labeling it with the [GMail]/Trash label effectively tell GMail to delete it in 30 days.
If you want to delete a message, then, just move it to the corresponding [GMail]/Trash folder of your account.

Is there a better way to do it?

I recognize that renouncing to the comfortable Delete button and having to move a message into the [GMail]/Trash folder is neither intuitive (semantically) nor easy: one click is addictive, a (right-click, move, choose folder) sequence is just a pain.

I had to cope with the same issue in Thunderbird but, fortunately, Thunderbird was easy enough to tweak in order to map the Delete action into the corresponding GMail action. It basically reduced to mapping the local Trash folder into the remote [GMail]/Trash folder and it could be easily accomplished manually editing the trash_folder_name property of each account.

I haven't (yet) found a way to do it with Evolution and I'll spend a couple of hours more to investigate it.


Gublerian said...

did you find a solution? greets

Anonymous said...

I personally prefer to keep everything in "All Mail" so like the 1-click archive (by clicking delete). I don't like it that sent messages are copied to a local folder since it's already in the [Imap]/Sent folder.

I wish there was a way to tell Evolution to do nothing with sent mail.

It would be nice to be able to just mark trash deleted instead of making an extra copy in the local Trash folder and then having Evolution delete it automatically on exit, but that's not as big a deal as getting the extra sent message that doesn't automatically delete.

Anonymous said...

Found out you can make Evolution not copy "deleted" messages to the trash.

Uncheck "Hide Deleted Messages" in the drop-down "View" menu - that's the one at the top - you know, where it says "File Edit View Folder Message Search Help".

So now, it doesn't "hide" a deleted message by copying it to the trash folder, instead it shows the deleted message still in the inbox with a line through it until the inbox label is removed by gmail, and that's what I wanted to have happen. I can still find the "deleted" mail in All Mail, but not a local copy in Trash.

Now I can set my local trash to empty once a month instead of every time I exit, giving me a chance to change my mind about deleted items on the other non-imap accounts I have in Evolution.

Anonymous said...

I found out how to prevent the Delete button in Evolution from copying messages to local Trash.

Just uncheck Hide Deleted Messages in the View dropdown menu. View is in the toolbar menu across the top where it says "File Edit View Folder Message Search Help"

By unchecking that, when you click the Delete button, instead of hiding the deleted message by copying it to the local Trash folder, it leaves the message in the inbox with a line through it until gmail removes the inbox label, still leaving the "deleted" message in All Mail.

Now, I can set the trash to empty on exit once a month instead of every time which gives me a chance to change my mind on messages I deleted from accounts other than gmail.