How to stop Mail.app in Lion creating an Archive folder for archiving in Gmail?

30

9

Mail.app in Mac OS 10.7 added an Archive button. Unfortunately, when archiving a message in a Gmail account, instead of simply putting the message into All Mail folder, Mail.app creates a folder called Archive (in Gmail web interface this folder comes up as [Imap]/Archive) and puts the message there. Is there a way to tell Mail to put the archived messages into Gmail's All Mail instead?

Alexey Blinov

Posted 2011-07-26T09:07:01.863

Reputation: 511

I don't think it's a useful feature for Gmail IMAP. The mail in the inbox should already be in the All Mail folder so you're better off deleting it from the Inbox instead of archiving it. – fideli – 2011-07-26T15:15:49.617

1I found out that a message that is moved to Archive folder will be archived for real in Gmail if I archive it again (in Archive folder). – puri – 2011-08-03T06:10:37.947

2I'm surprised there is no "Use this mailbox for Archive" feature like there is for Drafts/Junk/Sent/Trash. – Andrew Vit – 2011-09-12T23:04:10.193

The Mail.app which uses the Message.framework which contains the list of mailbox names that it uses does not specify an Archive mailbox name unlike the others. strings /System/Library/Frameworks/Message.framework/Versions/Current/Message | grep MailboxName | sort seems to not show a notion of Archive, but there is a text called "Archive" which means that it is hard coded into the binary. – Archimedes Trajano – 2011-10-16T05:59:30.613

Answers

15

You could edit /Users/<username>/Library/Mail/V2/MailData/Accounts.plist setting ArchiveMailboxName to [Gmail]/All Mail then restart Mail. This seems to work for me.

sj26

Posted 2011-07-26T09:07:01.863

Reputation: 271

this works great! just replace the "sj26" with your username – gerrit – 2013-04-18T14:27:12.323

Yeah, this is perfect until a certain future version of OS X is released, then maybe Apple will fix the behavior. Please mark this as accepted. – Khakionion – 2013-07-23T18:46:30.983

2

I created an AppleScript to move messages to [Gmail]/All Mail though and then created a service so I can run it from a keyboard shortcut. The AppleScript is here: http://gist.github.com/1134751 I'm not thrilled with it's performance though.

FastScripts (http://www.red-sweater.com/fastscripts/) could be be used to assign a keyboard shortcut to the script itself - without having to turn it into a service.

Owen

Posted 2011-07-26T09:07:01.863

Reputation: 306

1

It seems that it's easier to turn off the "Move deleted message to Trash mailbox" in the Mailbox Behaviours tab of the Gmail account preferences and continue using the usual Delete button instead of the new Archive button. This way when you delete the message it is simply removed from Inbox, i.e. in Gmail terms "archived".

Alexey Blinov

Posted 2011-07-26T09:07:01.863

Reputation: 511

1This isn't what the original poster (and myself) are looking for. Doing it your way means that no messages are deleted in normal operations. There's a number of messages that I DO want to delete, and others that I want to archive. – Schof – 2011-08-07T18:55:18.607

You sure? This answer comes from the original poster :p – Max Ried – 2012-03-31T13:13:55.057

0

I don't know how to change the button action.

However, it is possible to create a keyboard shortcut to Archive a message using the commercial plugin Mail Act-On. After watching a couple of the tutorials, I wrote an Act-On rule for every one of my accounts that archives ("moves") the message(s) to the correct [Gmail]/All Mail folder. You can map all of the rules to the same keystroke (I used Control-A) and tell each rule to stop when matched.

Scott Roland

Posted 2011-07-26T09:07:01.863

Reputation: 101

0

I went into Gmail on the browser, then settings -> labels.

Then unticked "Show in IMAP", back to inbox then closed browser.

I then gave it a moment and Quit mail and opened it again.

There was a huge sync, re-downloading all of Gmail messages again and the Archived folder is gone.

MDJCM

Posted 2011-07-26T09:07:01.863

Reputation: 1