Gmail's IMAP implementation is different than most. It has the job of trying to represent a database (not necessarily in the SQL sense) of messages with multiple labels as IMAP mailboxes(folders) while being compatible with lots of IMAP clients, including ones that don't support IMAP keywords. And, it has to do this while keeping things in sync with the mail.google.com interface.
Because of this, the way you do actions on messages in your IMAP client is different and something you need to get used to.
This page will first attempt to explain how things work so you understand why Gmail IMAP is the way it is. Then it'll give you actual directions for how to perform actions in M2 that sync well with the mail.google.com interface.
If you just want a direct overview of how to use Opera's built-in mail client with Gmail IMAP, see the Gmail IMAP Action Table.
Then, if you want to know details, read on.
First off, here are some super basic examples of how IMAP works:
Sets or removes flags on selected messages. For example, the \Deleted flag could be set or unset on the selected messages to mark them as deleted.
Wipes out all messages that have the \Deleted flag
stored on them.
Wipes out messages with certain IDs that have the
\Deleted flag stored on them.
Copies a message from one mailbox to another.
Those are the basic commands that will be relevant for understanding Gmail IMAP.
In the Mail panel, you have the "Unread" *view* and several *access points*, which are: "All Messages", "Filters", "Followed Threads", "Labels", "Attachments", "Mailing Lists", "Mail for imap_account1", "Mail for imap_account2" "Newsgroups1?", "Newsgroups2?" and "Feeds".
Each of the access points can have multiple views themselves. For example, M2's All Messages access point has a view for Received, Outbox, Sent, Drafts, Spam and Trash.
Each View in M2 shows only messages that match a certain criteria. For example, the Received view shows received messages, the Trash view shows messages that are marked as deleted and so on.
"Mail for imap_account" access points have views for each IMAP mailbox(folder) on the server that you're subscribed to. The criteria for each of these views is basically, "Show me all messages that are in this folder on the server". This makes the "Mail for imap_account" access points the best place to manipulate messages on the server because you're dealing with raw folders kind of like you do in a webmail as opposed to dealing with filtered views. Keep this in mind as the IMAP access points are where you'll spend all of your time.
IMAP access points are also views themselves. If you click on "Mail for imap_account", you'll get a message list view that shows messages from all the IMAP folder views under the access point.
Pressing DEL or clicking the Delete button sets the \Deleted flag on the selected messages. Then, those messages will only be shown in views that have "view -> Show in -> Show Trash" set. The main view that has this is All messages/Trash.
In the All Messages/Trash view, clicking the Undelete button will remove the \Deleted flag from the selected messages. Then, they will no longer show up in the Trash view.
In the All Messages/Trash view, pressing DEL or clicking Delete for the selected
messages will UID expunge them.
Right-clicking in the mail panel and choosing Empty Trash will Expunge all
messages that have the /Deleted flag set on them.
Dragging messages from one IMAP folder view to another will move the messages.
Since there's no IMAP Move command, the messages will be copied to the target
folder and the originals will get \Deleted set on them. Then, the originals will be UID
expunged.
As an alternative to dragging, you can use the cut
and paste commands on the message list for the IMAP folder views.
If you want to copy a message from one IMAP folder to another IMAP folder, you
have to use the copy and paste commands in the message list for the IMAP folder views.
Or, you can hold down ctrl while you drag.
If you drag a message from a view under an access point that's not an IMAP access point to an IMAP folder view, it will initiate a copy and paste instead of a cut and paste. Same thing applies when you drag from an IMAP folder view under a *different* IMAP access point.
Now, some clients allow you to designate a certain IMAP folder as a trash folder so that when you press DEL on a message, it copies the message to the IMAP Trash folder, stores \Deleted
on the original and UID expunges the original.
Then, when you press DEL in the IMAP
Trash folder view it stores \Deleted on the message and UID expunges it. And, if you "Empty
Trash" for the the IMAP trash folderv view, it does that for all messages in the IMAP Trash folder. M2 doesn't allow one to do this, but you'll see it's not useful for Gmail IMAP anyway.
Now, M2 supports a Delete Permanently option (shift+DEL) that sets \Deleted on the
message AND UID expunges it. This is useful for when you just want the message gone
and don't want to have to Delete it and then go under the All Messages/Trash view to expunge
it. You'll see why this is important later.
In M2, the All Messages/Received view shows a list of messages for all your IMAP folders so
that you can easily search through all your messages. The Unread view is the same
thing except that it just shows unread messages from all your IMAP folders. (If you
have an IMAP sent folder set in M2, messages from it won't be shown in those views by default.)
In the message list for each view, you can click on the different header columns depending on how you want to sort messages. By default, M2's sorting is messed up and you should click on the "Sent" header twice (so that the arrow is pointing down) to sort by sent in descending order.
Gmail on the server basically consists of a database of messages with certain label attributes. The webmail UI then presents that to you in a nice way. This is fine, but when using IMAP, the database and the label attributes for each message have to be translated into IMAP mailboxes(folders).
For Gmail IMAP, [Gmail]/All Mail is your database off all your messages (Besides
[Gmail]/Sent Mail, [Gmail]/Trash and [Gmail]/Spam). Starred, Inbox and other IMAP
folders not under [Gmail] are your label folders.
A full physical *copy* of a message in [Gmail]/All Mail will be present in each
label folder that applies to the message.
So, if you receive a message with a subject of "Test" and apply the "zipzambam"
label to it, you'll have 3 physical copies of the message and it'll look like this under the "Mail for your_gmail_account" access point.
-[Gmail] - All Mail Test -Inbox Test -zipzambam Test
Now, in M2, since the Unread and All Messages/Received views show messages from all
IMAP folders, you're going to see each copy in their list (3 in this case).
That's just the way it is. Don't fight it and don't worry about it. For Gmail IMAP, you're not supposed to use anything under any of the non-imap access points/views (except All Messages/Drafts and All Messages/Sent in some cases). Just stick to just using the IMAP
folder views under "Mail for your_gmail_account" access point. Keep all the other views and access points collapsed and never expand them. Just pretend they're not there.
Here's an XML visualization of why you get multiple copies of messages in various M2 views like Unread and Received:
Gmail database:
<database> <message id="0" labels="INBOX, public-html, whatwg"> <subject>HTML5 rocks!</subject> </message> </database>
Database converted to IMAP mailboxes(folders):
<imap> <mailbox name="[Gmail]"> <mailbox name="All Mail"> <message id="0"> <subject>HTML5 rocks!</subject> </message> </mailbox> </mailbox> <mailbox name="INBOX"> <message id="0"> <subject>HTML5 rocks!</subject> </message> </mailbox> <mailbox name="public-html"> <message id="0"> <subject>HTML5 rocks!</subject> </message> </mailbox> <mailbox name="whatwg"> <message id="0"> <subject>HTML5 rocks!</subject> </message> </mailbox> </imap>
M2's Received view (a filter based on messages from the IMAP mailboxes)
<m2> <view name="Received"> <message from-mailbox="[Gmail]/All Mail"> <subject>HTML5 rocks!</subject> </message> <message from-mailbox="INBOX"> <subject>HTML5 rocks!</subject> </message> <message from-mailbox="public-html"> <subject>HTML5 rocks!</subject> </message> <message from-mailbox="whatwg"> <subject>HTML5 rocks!</subject> </message> </view> </m2>
As you can see, the reason you have multiple copies in various views is because the IMAP server has multiple copies. The IMAP server has multiple copies because Gmail's IMAP implementation uses a *copy* of a message in a mailbox to represent each active label on a message in the database.
But, you'll never be bothered by this since you do not use non-IMAP access points and views in M2 with Gmail IMAP.
Here's how you do things in M2 with Gmail IMAP so that your actions are
synchronized with how the Gmail webmail interface shows things:
If you want to move a message to Gmail's trash (which will remove all copies of it from other IMAP folders), drag
it (or cut and paste) from one of the IMAP folder views it's in to the [Gmail]/Trash IMAP folder view.
If you moved the message to the Trash and then want to undelete it, move it back and all the labels that were on the message should be restored (which means all the copies in all the label folders will be recreated).
If you want to mark a message as Spam (which will remove all copies), drag it (or cut and paste) from one of the IMAP folder views it's in to the [Gmail]/Spam IMAP folder view.
If you want to undo this, drag it back to where it was. If that doesn't have any effect as far as marking it as "Not Spam" after a while, you'll specifically have to drag it back to Inbox to get it marked as "Not spam". Then, you can archive it and reapply labels if needed.
To empty Gmail's trash, select all messages in the [Gmail]/Trash IMAP folder view and invoke Delete Permanently (shift + del).
You can use the same type of thing to clear [Gmail]/Spam.
To remove a label from a message, Delete permanently (shift + del) on it in the IMAP label
folder view. This doesn't really "Delete permanently". It just removes the labeled copy.
As an alternative, you can drag or cut and paste the message to [Gmail]/All Mail.
To change a label of a message, drag it from one IMAP label folder view to another (or use cut
and paste from one message list to another).
To add another label to a message, copy and paste it (or hold down ctrl while dragging) into another IMAP label folder view's message list.
In Opera 10, when you copy, you can continue pasting to multiple IMAP folder views so you can apply multiple labels without having to invoke copy each time. It basically works like copy and pasting works in Windows Explorer.
To Star a message, copy and paste it (or hold down ctrl while dragging) to the [Gmail]/Starred IMAP folder view's message list.
In the [Gmail]/Starred IMAP folder view, invoke Delete Permanently (shift + del) on it.
Remove the Inbox label from it by invoking the Delete Permanently command on it in the IMAP Inbox label folder view.
As an alternative, you can drag or cut and paste a message from the IMAP Inbox label folder view to [Gmail]/All Mail.
M2 doesn't offer an option to upload Drafts to Gmail. However, you can drag (or copy and paste in this case) from the All Messages/Drafts view to the [Gmail]/Drafts IMAP folder view.
When you send a message, Gmail automatically copies it to the [Gmail]/Sent Mail IMAP folder. You do not need to set [Gmail]/Sent as a sent folder in M2 in the account's properties. However, *if* you want M2 to automatically add contacts from [Gmail]/Sent Mail to M2's contacts panel, you can set [Gmail]/Sent Mail as your sent folder without getting an extra copy in [Gmail]/Sent Mail (Gmail seems to ignore the extra copy). This also allows the All Messages/Sent view to contain the full list of sent
messages that are on the Gmail server. Only do these things if you really really want to.
If you have a message with no labels, it'll only be in [Gmail]/All Mail IMAP folder. If you want to delete it, drag it to the [Gmail]/Trash IMAP folder view. If you want to add a label to it, copy and paste it to an IMAP label folder view like 'Inbox'.
In some of the situations above (like moving to Gmail's trash), you can copy and paste to the [Gmail]/Trash IMAP folder view instead of dragging(cutting and pasting) and the Gmail server will do the same thing. This will allow you to drag from the Unread or All Messages/Received views to perform an action like moving a message to Gmail's trash. But, that's not recommended and you should stick to dragging(cutting and pasting) from one IMAP folder view to another and leave non-IMAP access points and views alone.
Instead of doing Delete Permanently (shift + del) in the [Gmail]/Trash IMAP folder view for example,
you can also use just Delete. However, then, you have to empty M2's All Messages/Trash view.
This is why you use Delete Permanently so you don't have to do 2 steps. For Gmail IMAP
accounts, by default, Thunderbird makes DEL work like Delete Permanently specifically for this reason.
Most of the time, all you'll be doing is:
Opening messages, dragging them to the [Gmail]/Trash IMAP folder view and invoking Delete Permanently on them in [Gmail]/Trash.
Now, since the [Gmail]/Spam IMAP folder can contain nasty and perhaps unsafe messages, if you don't have View (the button on the mail toolbar) -> display -> "Block external embeds" checked (it's checked by default), you should set view -> display -> "list only" for message lists if you're going to be viewing the [Gmail]/Spam IMAP folder, Unread or All Messages/Received views. That way, the body of a spam message doesn't load unless you choose to open the message. (Same thing applies for all other views that might have spam messages in them.)
After you permanently delete messages from [Gmail]/Trash (or another folder when
removing a label) for example, the [Gmail]/All Mail IMAP folder view (and IMAP label folders that *had* copies of the message) won't be updated with the changes (like the unread count next to the IMAP folder view) until you either click on the IMAP folder to select it or the next sync. If this bugs you, just click check/send after you perform an action. That will sync things so that the copies disappear from all the other views faster.
If you drag a message to [Gmail] while it's collapsed, just hold over it for a second
or two and it'll expand so that you can continue dragging to the IMAP folders.
First, here are a few pics to show what the mail panel looks like. In the Gmail account used for the following pics, there is only 1 message in database. But, it has "INBOX", "Label1?", "Label2?", and "Label3?" labels applied to it.
This is a great example stressing how important it is to ignore and collapse all the access points except the IMAP account access point.
Don't use this view with Gmail IMAP. Keep it collapsed.
Don't use this view with Gmail IMAP. Keep it collapsed.
imap_access_point_top_view.png
As you can see, besides the original copy of the message that appears in the [Gmail]/All Mail IMAP folder view, there's a copy of the message in each IMAP label folder view that applies to the message. In the case of views like All Messages/Received, Unread and the IMAP access point top view, the copies for the other IMAP folder views will show in the message list also. But, don't worry about those message lists as you don't use Unread and All Messages/Received with Gmail IMAP and only use the IMAP access point top view for searching the entire IMAP account with the quick find field.
move_to_trash1.png (dragging)
move_to_trash2.png
move_to_trash3.png
empty1.png
empty2.png
empty3.png
empty4.png
Tools -> Mail and chat accounts -> add -> email -> next -> Enter your name and Gmail address -> next -> Enter your gmail address and password -> finish
Also, don't forget to see the "Sorting" section above so that your messages are sorted in the message list correctly.
Check out this article for step-by-step instructions for setup:
http://www.pcmech.com/article/setting-up-imap-enabled-gmail-in-opera-924/
At mail.google.com, if you goto "settings -> Labs" and enable "Advanced IMAP Controls", you will gets some new IMAP options.
1. Under "Settings -> Labels", there will now be "Show in IMAP" checkboxes. These allow you to hide certain label mailboxes from your IMAP client.
2. Under "Settings -> Forwarding and POP/IMAP" there will be some new IMAP delete options that can help you make Gmail IMAP act more like a normal IMAP server.
a. Auto-Expunge: Set this to "Do not automaticaly expunge messages.
b. When a message is expunged from the last visible IMAP folder: You can set this to "Immediately delete the message forever" or "Move the message to the trash". The former will be more like standard IMAP behavior. The latter will simulate delete as moving to a Trash folder.
Now, understand that when using the Advanced IMAP Controls, you're not using Gmail IMAP as it was intended to be used and things might not sync well with the webmail. You should check the webmail interface from time to time to see if messages have the labels they're supposed to and that messages that you completely deleted with IMAP are actually gone completely from All Mail and the Trash.
Also, the Gmail IMAP Action Table at the beginning of this article will no longer apply.