Gmail – Force getmail (IMAP) or gmail to archive, not delete messages

gmailimap

I use getmail to IMAP check my gmail.

It works great, but the bigger my INBOX is, the longer each check takes.

I can set "delete = true" in getmail, but I like having the mail
backed up on gmail. I just don't want them all in the INBOX.

How can I tell getmail (or gmail) to move read messages to "Archived",
instead of deleting them outright.

Previously, I've manually archived read messages in my INBOX, but it'd
be nice to do this automatically.

Best Answer

Try "Advanced IMAP Controls" in Gmail Labs.

UPDATED:

1) In Gmail go to Settings -> Labs an enable "Advanced IMAP Controls".

2) Under Settings -> "Forward and POP/IMAP" in the "IMAP Access" section select "Limit IMAP folders to contain no more than this many messages" and set the limit to 1000. (A lower number is not possible at the time of writing.) This should limit the number of visible messages through IMAP in your inbox.

3) Also make sure that under "When a message is expunged from the last visible IMAP folder" you have selected "Archive the message" to make sure that deleting an email through IMAP will leave a copy of it in your "All Mail" Gmail folder.