Gmail IMAP Auto-Expunge Explained

Gmail IMAP Settings Explained

Wondering what the settings inside Gmail’s “Forwarding and POP/IMAP” tab mean? Find here the Gmail IMAP settings explained (including auto-expunge and folder size limits).

First, It Makes Your Disk Look Bigger

Glance upon a typical Volkswagen ad of the 1950s and -60s, and you will see white space—sometimes a bit less, and sometimes a lot more.

Take this print ad from 1964, for instance: a tiny beetle cowers in the bottom right corner with vast expanses above to… picture your house. The headline explains: It makes your house look bigger.

In a similar fashion, one Gmail IMAP setting can make your hard disk look bigger—on your phone but on your desktop, too; let’s find out more:

Gmail IMAP Settings Explained

Looking for settings for connecting your email program to Gmail? Copy and Paste Gmail IMAP Server and Port for Email Access

Gmail offers a host of slightly obscure settings that govern how email programs and services can connect to your account via IMAP.

You can find and configure the following Gmail IMAP Settings on the Forwarding and POP/IMAP tab inside Gmail options.

Gmail IMAP Auto-Expunge Settings Explained

What IMAP Auto-Expunge Does

When you delete an email using IMAP, it does not immediately disappear (or go to a “Trash” folder). Instead, the email program marks it with a “deleted” flag. Only when the email program finally sends the IMAP “expunge” command, all emails flagged as “deleted” actually disappear. Many email programs do this automatically when you switch folders, for example, or close the program.

With Gmail, this safety net is not normally necessary. Most email programs will copy messages to the Gmail “Trash” folder before marking them deleted. It is then save to expunge them.

“When I mark a message in IMAP as deleted:”

  • Auto-Expunge on is the same as expunging the Gmail folder every time you mark an email as “deleted”. Gmail online is always up to date.
    This is the recommended setting.
  • Auto-Expunge off means Gmail operates like a traditional IMAP account. It will then honor the commands sent by email programs and wait for the “expunge” command to delete messages.

“When a message is marked as deleted and expunged from the last visible IMAP folder:”

This setting is available only when auto-expunge is disabled. It defines what happens to an email when is is removed from the last folder in which it appeared. With Gmail IMAP, every Gmail label corresponds to an IMAP folder, and every message appears in all the folders that correspond to its labels plus the “[Gmail]/All Mail” folder. All Gmail messages that are not deleted or marked as spam show in the “All Mail” folder.

Not all Gmail folders need be visible to email programs via IMAP, though; you can turn off IMAP access to specific labels to make Gmail IMAP more lightweight and faster. Only the Inbox is always visible.

This setting only applies to folders available via IMAP.

  • Archive the message (default) means emails deleted from the last visible folder (including the Inbox) are still available in Gmail under All Mail (as well as all labels not accessible via IMAP).
  • Move the message to the Trash means emails deleted from the last visible folder are moved to the Gmail Trash label (corresponding to the “[Gmail]/Trash” folder. They will be automatically deleted forever after some 30 days in the Trash label; you can also empty the Gmail Trash manually, of course.
  • Immediately delete the message forever means emails deleted from the last visible folder are removed altogether. With this setting, Gmail works like a traditional IMAP account.
    If you do not see the message in the email program, it is gone beyond recovery. This is true even if the message was tagged with a label in Gmail that is not visible via Gmail IMAP.
    If you have Gmail IMAP enabled for the All Mail label, you cannot expunge an email from the “[Gmail]/All Mail” folder while it is still in another visible folder.

Gmail Settings to Limit IMAP Traffic and Folder Size Explained

“Folder Size Limit”

Folder Size Limit lets you restrict the number of messages Gmail makes available via IMAP in each folder. IMAP folders can get large and unwieldy, and if your email program or mobile device insists on keeping a local copy of each message, they can take up a large amount of space—all for reading and working on last week’s emails.

With Limit IMAP folders to contain no more than this many messages, you can prevent overly large Gmail IMAP folders. All emails are always available in Gmail on the web and in the Gmail apps, of course.

(Gmail IMAP settings explained and tested with Gmail in a desktop browser; updated April 2024)

Home » Email Tips and Resources » Gmail Tips and Resources » Gmail IMAP Auto-Expunge Explained