The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features

See the new Forums

GMail IMAP: How to archive mail (remove from INBOX)

Forums » Opera for Windows/Mac/Linux » Opera mail, chat and news

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

24. October 2011, 08:34:04

danmichaelo

Posts: 19

GMail IMAP: How to archive mail (remove from INBOX)

Hi,
I've started using the Opera Mail client with Gmail IMAP. In Mutt and Apple Mail I can delete a message from INBOX and it will still remain in All Mail (it's "archived" in GMail terminology). In Opera Mail, however, when I delete a message from INBOX, it's really deleted. I don't use the Trash-folder, as I'm not interested in deleting messages, just archive them. Have anyone found a working for how to "archive" GMail mail from within the Opera mail client?

24. October 2011, 09:25:43

burnout426

Posts: 13202

On the "IMAP" tab in the account's properties, unset the trash folder. Then, it should work like you want.

Or, create a label named "Archive" and in its properties, set the IMAP keyword to "\Deleted" (without the quotes). Then, just apply the "Archive" label to messages you want to archive.

25. October 2011, 12:37:25

danmichaelo

Posts: 19

Thanks!

Unsetting the trash folder was the first thing I tried, but it didn't work as expected (the messages ended up being really deleted, not archived). This behaviour is different from the other IMAP mail clients I've used (Apple Mail and Mutt).

The second solution, using a label, worked however! Is there a way to assign a label keyboard-wise (pressing just one key)? I tried in Prefs to re-assign the "k"-key from "Mark as read" to"Set label Archive", "Set label, Archive" or "Set label: Archive", but neither worked. Could you help me out with the syntax?

25. October 2011, 18:07:52

arnymars

Natural Hobbiest

Posts: 465

Deleted from where - Opera M2 database or Gmail web server account? I don't think you can delete messages from Gmail All Mail mailbox via M2.

25. October 2011, 18:18:57

danmichaelo

Posts: 19

When I delete a mail (using the delete key) from GMails INBOX using M2 (and having unset the trash folder), it is deleted from All Mail as well. If I switch to All Mail and wait for Opera to sync, the mail disappears there. I've also checked using the webmail interface afterwards, and it's really gone.

(Btw., I'm using Opera 11.51 (build 1087) on Mac OS X 10.7.2)

25. October 2011, 20:52:25 (edited)

arnymars

Natural Hobbiest

Posts: 465

Hmmm... I delete plenty of headers in M2 without downloading actual emails, and also delete some emails in M2 after downloading and reading them, and then empty M2 Trash folder periodically, but it doesn't seem to affect in any way Gmail Web server hosted All Mail folders of the relevant accounts.

I know why: do not subscribe in M2 IMAP Folders to [Gmail]\All Mail, [Gmail]\Spam and [Gmail]\Trash folders syncing for any account. You'll save on traffic and would have a mail backup in case of M2 bugging its local Mail DB (it can be easily recreated from Gmail folders). Besides, Gmail Trash and Spam (pretty accurate) web mailboxes are emptied periodically anyway. And from All Mail you can Delete sensitive messages manually after login to the web interface.

Otherwise all your mail archive may gone one day due to M2 bug, and you never know, if you need some of these messages later.

25. October 2011, 21:46:41

LeoCG

Posts: 10103

What are your settings om Gmail's "forward and pop/imap"? Specially "When a message is marked as deleted and expunged from the last visible IMAP folder:"



Lastest Opera Developer Build @ Windows 8.1 Pro X64
Intel I5-4430 - 8GB Ram
Intel HD Graphics 4600

25. October 2011, 22:25:27

danmichaelo

Posts: 19

Sorry for not checking this earlier, but now I discovered that the messages actually ended up in GMail's Bin folder, so it seems like Opera moves messages to the Bin folder, and then it makes sense that they dissappear from All Mail. But what doesn't make sense is that I haven't selected a Trash folder! Is there some other setting involved than this one?



Also, note that the Bin folder is grayed out: (here I tried to unsubscribe from All Mail too, but that didn't make any difference)


Gmail IMAP settings:
* When I mark a message in IMAP as deleted: Auto-Expunge on
* When a message is marked as deleted and expunged from the last visible IMAP folder: Archive the message

25. October 2011, 22:43:52 (edited)

arnymars

Natural Hobbiest

Posts: 465

Uncheck [Gmail]\All Mail in Opera Menu - Mail - IMAP Folders for each Gmail account. I think, its unchecked by default, when adding a Gmail account in Opera. Generally, your mail is never deleted from Gmail servers, it just may no longer be visible to YOU (in web accessible IMAP folders).

26. October 2011, 03:01:55

burnout426

Posts: 13202

Originally posted by danmichaelo:

Thanks!

Unsetting the trash folder was the first thing I tried, but it didn't work as expected (the messages ended up being really deleted, not archived). This behaviour is different from the other IMAP mail clients I've used (Apple Mail and Mutt).

The second solution, using a label, worked however!



If you don't have a Trash folder set, it should work just like it does with the label. If it doesn't, that's a bug.

But, at mail.google.com, you need to have both "Auto-Expunge" and "Archive the message" selected as LeoCG mentioned.

If you do and it still doesn't work like the label, then it's a bug. I'll try to reproduce myself too.

Is there a way to assign a label keyboard-wise (pressing just one key)?



Press l (for label) to bring up the "label as" menu. Then, press the letter in the label's name that's underlined. That's about it.

Note though that what Oprera does by default ("move to "[Gmail]/Trash" when pressing del) is what's supposed to happen with Gmail IMAP so things are synced correct with mail.google.com. Before Opera did this, you had to drag to "[Gmail]/Trash" every time you wanted to delete a message. Now you can do it with just the del key like it should have been in the beginning in Opera. But, when a trash folder is not set, it should work like the label.

As for the archive label, Thunderbird has an "archive" option in the right-click menu that does the same. (Only it does a move to "[Gmail]/All Mail", which is another (and actually the proper way in Gmail IMAP) to archive a message).

If you haven't yet, make sure you read <http://operawiki.info/GmailIMAP>.

26. October 2011, 03:07:35

burnout426

Posts: 13202

Originally posted by burnout426:

But, when a trash folder is not set, it should work like the label.



I see the problem. If you unset the trash folder, Opera will reset the trash folder automatically at the next sync. Opera's supposed to do this when you setup the account (because that's how it's supposed be for Gmail IMAP). But, it might be good if Opera allowed you to deviate to incorrect settings for the user-case you mentioned.

Still though, the better solution is to leave things alone and use the archive label until Opera supports an archive command.

26. October 2011, 12:17:25

danmichaelo

Posts: 19

Thanks burnout, you spotted it! I tried subscribing to the Bin folder, and then it automatically showed up in M2's IMAP settings as the Trash folder. So it seems like Opera enforces the Gmail Bin folder, but since only subscribed folders are shown in M2's IMAP settings, it didn't show up there – which I consider a UI glitch. I will file a bug report on this.

Also, I still wish there was a faster way than having to press three keys (l, a, <Enter>) to archive (setting the archive label). Opera's keyboard shortcut options appears to be quite programmable. For instance Platform Mac, ? Cmd is configured to the action Open URL in new page, "opera:/help/index.html". It's almost surprising there is no action Set label, "Archive".. If it isn't, I need to file a feature suggestion too smile

26. October 2011, 12:38:00

burnout426

Posts: 13202

What happens if you goto mail.google.com and uncheck "show in IMAP" for both "[Gmail]/Trash" (Is it "[Google Mail]/Bin" for you?) and "Trash" ("Bin" for you?).

If they're totally hidden from IMAP, then maybe unsetting an IMAP trash folder will stick and you'll get what you want. But then, you wouldn't be able to delete messages, only archive them

26. October 2011, 13:48:11

arnymars

Natural Hobbiest

Posts: 465

I don't get one small thing though:

Why there is a need to archive any messages, when Gmail shows all messages anyway in web based [Gmail]/All Mail folder regardless whether you deleted them from any other folders or not, and whether such delete was done via M2 or Gmail web interface. You simply can't delete anything from [Gmail]/All Mail any other way, but only manually via web interface. And even in that scenario your mail is NOT deleted from Gmail server, and can possibly be returned to you upon request to Gmail support. smile

Am I missing something here - or my experience is different for some reason (I don't subscribe to Trash folders)?

26. October 2011, 14:03:45

burnout426

Posts: 13202

Originally posted by arnymars:

Am I missing something here



"Archive" in Gmail IMAP terms means to remove a label. This could be the "Inbox" label or the "Starred" label or some custom label you created. You can also archive a message from "[Gmail]/Trash" or "[Gmail]/Spam" to undelete it or unmark it as spam and restore the previous labels that were set for the message before it was deleted or marked as spam.

In short, "archive" for Gmail IMAP isn't really archiving in the strictest sense.

26. October 2011, 14:32:42 (edited)

arnymars

Natural Hobbiest

Posts: 465

Its interesting... So, what happens when a message is deleted from Gmail Inbox - does its copy in All Mail loose Inbox label automatically? I checked - it does. smile Hence, its auto "archived" by simply deleting it from a relevant folder in M2 or web interface, no need to do anything extra.

26. October 2011, 14:58:16

burnout426

Posts: 13202

Originally posted by arnymars:

Its interesting... So, what happens when a message is deleted from Gmail Inbox - does its copy in All Mail loose Inbox label automatically? I checked - it does. Hence, its auto "archived" by simply deleting it from a relevant folder in M2 or web interface, no need to do anything extra.



When the \Deleted flag is added to the message that happens yes. It's the same as dragging to "[Gmail]/All Mail".

See the "Why are there multiple copies of messages in M2?" section at <http://operawiki.info/GmailIMAP> for a visualization of how things are set up. And, see <http://files.myopera.com/burnout426/files/gmail_imap_table.html> for more info on actions.

But, when you *delete* a message (as in move it to "[Gmail]/Trash", which is what "delete" means in Gmail IMAP), the message only shows in Gmail's trash (and only shows in the "[Gmail]/Trash" IMAP folder). But, the other labels aren't actually removed. They just become inactive because the message is in the trash. The labels will become active again if the message is undeleted.

26. October 2011, 16:13:59 (edited)

arnymars

Natural Hobbiest

Posts: 465

Thanks. When I delete a message, it's not only shown in web interface Gmail/Trash, but also in Gmail/All Mail yet without label(s) anymore. I suspected, the labels are just not visible, because Gmail needs to know where to move it to if undeleted. smile

26. October 2011, 15:27:39

burnout426

Posts: 13202

Originally posted by arnymars:

Thanks. When I delete a message, it's not only shown in Gmail/Trash, but also shown in Gmail/All Mail but without label(s) anymore.



That's not correct behavior. When the message is in Gmail/Trash, it shouldn't show anywhere else, including "All Mail".

26. October 2011, 15:40:36

danmichaelo

Posts: 19

Originally posted by burnout426:

What happens if you goto mail.google.com and uncheck "show in IMAP" for both "[Gmail]/Trash" (Is it "[Google Mail]/Bin" for you?) and "Trash" ("Bin" for you?).

If they're totally hidden from IMAP, then maybe unsetting an IMAP trash folder will stick and you'll get what you want. But then, you wouldn't be able to delete messages, only archive them



Cool, that actually works smile Thanks for the creative solution!!

Not having the delete option is an issue, but not a big one. I prefer to be able to archive quickly, and I can always open the webmail interface if I want to delete something.

26. October 2011, 16:23:28

arnymars

Natural Hobbiest

Posts: 465

Can you explain a bit how IDLE feature in M2 works? OR, its Gmail feature?

I don't sync Gmail/All Mail for mail preservation safety (since M2 is always buggy, though getting better). Is there a way to change current IDLE behavior from checking All Mail to checking Inbox only for each Gmail account? I did notice, the mail no longer pops up immediately in M2 after being sent to one of my accounts. A user should have this important control at his disposal in opera:config, since he can still deselect any folders in IMAP Opera settings, including All Mail (and if he does, he deselects it in all accounts to follow the same logic - no unneeded extra traffic plus better mail safety).

26. October 2011, 16:34:27

burnout426

Posts: 13202

Originally posted by arnymars:

Can you explain a bit how IDLE feature in M2 works?



See <http://en.wikipedia.org/wiki/IMAP_IDLE> and <http://www.ietf.org/rfc/rfc2177.txt>.

Originally posted by arnymars:

Is there a way to change current IDLE behavior from checking All Mail to checking Inbox only for each Gmail account?



If unsubscribing from "All Mail" doesn't do it, unchecking "show in IMAP" at mail.google.com for "All Mail" might do it. If it still doesn't work, there's nothing you can do.

26. October 2011, 18:08:53

arnymars

Natural Hobbiest

Posts: 465

So, M2 sends IDLE command that contains a code prompting Gmail to send updates for All Mail box only? The box choice can be changeable in opera:config .

26. October 2011, 18:44:36 (edited)

burnout426

Posts: 13202

Originally posted by arnymars:

So, M2 sends IDLE command that contains a code prompting Gmail to send updates for All Mail box only?



It has to be only one folder and it's "All Mail" because messages from there are the ones that show in Opera's views. The ones in "Inbox" and other folders are hidden in Opera's views. (By default that is. If you unsubscribe from "All Mail' and mess with other things, then it might change to "Inbox" or might not or might mess up others things)

There's nothing in opera:config to change this.

26. October 2011, 18:56:50 (edited)

arnymars

Natural Hobbiest

Posts: 465

I think, now its more flexible - if one deselects All Mail (like I'll always do to prevent mail from being deleted by M2), he can see messages in Received - they are a mix of all Inbox messages from all accounts - and that's logical behavior. What's illogical is to block IDLE from checking Inbox in that scenario instead of All Mail - and it needs to be fixed. Basically, if M2 will insist on syncing All Mail, I'd have no alternative but to switch to another mail client - for web mail safety, because now Gmail offers extra mail safety feature independent on any mail client, and I don't want to loose it for no reason.

Lets say, I want to stay independent of M2 or another mail client bugs (current or future) or human errors - hope you recognize this right?

26. October 2011, 18:58:12

burnout426

Posts: 13202

Originally posted by arnymars:

like I'll always do to prevent mail from being deleted by M2



M2 doesn't delete mail unless you tell it to. I don't know why you have this fear of "All Mail".

Did you try unchecking "Show in IMAP" at mail.google.com for "All Mail" instead of just unsubscribing from it?

26. October 2011, 19:02:58

arnymars

Natural Hobbiest

Posts: 465

No, because Gmail Search won't work properly (search all mail) after that. But I can try just to test. Yes, M2 can delete staff by human error too, but in the past it did such things on its own ( I mean while a user executed presumingly unrelated command). Regardless of the cause, its just a precaution.

26. October 2011, 19:04:00

burnout426

Posts: 13202

Originally posted by arnymars:

No, because Gmail Search won't work properly after that.



That's doesn't make sense at all.

26. October 2011, 19:24:42 (edited)

arnymars

Natural Hobbiest

Posts: 465

Why? If part of mail is not accessible by user - actually the most complete subset - it might not be searched anymore. It depends on Gmail algorithms that are little known similar to Opera ones. On the other hand, Gmail may conduct search in a common user folder not visible in his account. On top, I scan All Mail visually at times after mistakenly deleting a message. To begin with, there is no objective need for a user to sync All Mail, when other key folders are synced - just leave it along.

If a user deleted a message from Inbox, it doesn't mean he wanted to delete it from All Mail as well - may be all he wanted is to remove Inbox Flag from that message, as Gmail does - for a reason! If a user deleted a message from All Mail - he probably wanted to delete it from his account.

26. October 2011, 19:24:03

burnout426

Posts: 13202

Originally posted by arnymars:

Why?



That setting hides "All Mail" from IMAP. It doesn't affect any searching at mail.google.com. And, in Opera, since you said you already unsubscribe from "All Mail" anyway, going further and hiding it from IMAP isn't going to make a difference with search.

When you're unsubscribed from "All Mail", all your messages are in "Inbox" or other IMAP folders that you're subscribed to. Opera will index them all so you can search them.

Originally posted by arnymars:

Yes, M2 can delete stuff by human error too, but in the past it did such things on its own



If you accidentally press del on a message, it'll just be moved to "[Gmail]/Trash" where you can undelete it.

If you think that M2 might delete things on its own, what makes you think unsubscribing from "All Mail" will help?

If you're afraid of a client deleting stuff on you on its own, you should just use another client. I wouldn't put up with that if Opera did that to me with Gmail IMAP. But, it doesn't and works fine.

26. October 2011, 22:13:14 (edited)

arnymars

Natural Hobbiest

Posts: 465

While you're claiming of me being afraid of things - I didn't say that. Being on the safe side - its a totally different story. Some of these things may happen accidentally, since a user's assumptions how M2 operates may not coincide with ever changing reality. M2 bugged my local mail DB many times - what makes you think, it can't do the same with a remote DB? smile Just a precaution... Other mail clients aren't immune of bugs as well, while M2 is great convenience feature integrated in Opera.

M2 logic must not contradict Gmail logic:

If M2 deletes a message from Inbox, it should be merely unflagged in All Mail, but not deleted from it, regardless whether one syncs Gmail/Trash or not. In web account Trash is always sinced, but it doesn't result in a deleted from Inbox message also being deleted from All Mail.

Forums » Opera for Windows/Mac/Linux » Opera mail, chat and news