
Users who use Outlook with IMAP to access their Gmail account (whether regular Gmail or Google Apps Gmail) will have problems when they attempt to archive their Emails using Outlook AutoArchive or manually initiating an Outlook archiving process.
There are 2 issues that prevent archiving from being successful with Outlook:
- Gmail Related Problem: Gmail manages Emails in a different way than what usually Email Servers/Services do.
- Gmail uses labels instead of folders. Multiple labels can be assigned to the same Email; and when you get a new Email it will automatically have 2 labels: Inbox and “All Mail”.
- Gmail uses the “All Mail” label as the place where you should be archiving your Emails. This means, you will never have to delete any Email and you will always be able to access old Emails.
- Outlook Related Problem: Outlook has an odd method for archiving Emails; it makes use of the most recent date of Sent, Received, and Modified dates of an Email. There are various reasons on why the Modified date of an Email would get updated and it is most apparent when you have an IMAP account; as soon as you connect to the IMAP server and have Emails synchronized, the Modified date will be set to the Current date! This makes the archiving process virtually only relying on the Modified date. An attempt to archive Emails using Outlook may result in archiving nothing! More about this is available at the Microsoft article (do NOT follow their lame workaround).
In this tutorial, we will tackle these issues by
- Modifying the Gmail Settings to change its behavior with Outlook and IMAP.
- Using third-party software, called MailStore, to archive your Emails depending on the Sent and Received dates of your Emails.
(Outlook 2007 is used in this tutorial)
Important:
After changing the Gmail IMAP settings as you will see in the next section, the “All Mail” folder will no longer show in Outlook. If you have Emails that only have “All Mail” label, you will no longer see them in Outlook and, in this case, if you wanted to archive them or deal with them locally, you will have to assign these emails another label such as Inbox or any label you want. You may do that using the Gmail webmail interface or Using Outlook before applying the new settings.
Changing the Gmail IMAP settings,
- Login to your Gmail Webmail account.
- On the top-right of the page, click on the Settings link.
- Select the Labs tab.
- Look for “Advanced IMAP Controls” section then click on the Enable radio button.
- Scroll back to top and click on the “Save Changes” button.
- Again, click on the Settings link and then on the “Forwarding and POP/IMAP” tab.
- In the “IMAP Access” section, you will see new options that can be set. If you haven’t enabled the IMAP feature before, you should do so now by clicking on the “Enable IMAP” radio button.
- Under the “Auto-Expunge” section, click “Do not automatically expunge messages” radio button.
- Under the “When a message is expunged from the last visible IMAP folder” section, click the “Move the message to the Trash” radio button.
Note: you can set the option to delete messages permanently, but this will not let you restore accidently deleted messages. If you just set them to be moved to Trash (as we have done above), the emails will be deleted automatically after 30 days (or you can later access the Trash label/folder and delete them from there). - Click the “Save Changes” button.
- Click on the Settings link and then on the Labels tab.
- For “All Mail”, uncheck the “Show in IMAP” checkbox. (This setting will be applied immediately).
Note: there is no need to click the hide link; it is just for the webmail and will not affect the labels visibility in Outlook.
Archiving your Emails,
There are two ways you can use to archive your Emails, either manually moving your items in Outlook or using third-party software to archive your Emails easily and conveniently. Choose the way that best suits your needs.
So you can:
- Manually archive your Emails: By moving Emails to “Personal Folders” and then use AutoArchive on Personal Folders at a later time or move them directly to .pst files.
- Or Using MailStore: that will allow you to easily and efficiently archive your Emails.
Before you attempt to archive your Emails, it is important to understand how Outlook and Gmail behave with the changed Gmail settings.
Deleting an Email in Outlook,
When you delete an Email in your Outlook IMAP account, the Email will not be deleted directly and instead, it will be marked for deletion by Outlook. When an Email is marked for deletion, you will see a strikethrough on the header of the Email. To complete the deletion process you will need to purge them and to do that: click the Edit item in the Menu bar, then point to Purge, then select
- Purge Marked Items in “folder”, where “folder” is the folder containing your marked Email for deletion.
- Purge Marked Items in “Account Name”, where “Account Name” is your IMAP account.
- Purge Marked Items in “All Accounts”.
Adding the Purge Command to a toolbar,
For your convenience, you can add the Purge command to a toolbar. To add it:
- Select Tools from the Menu bar, then click Customize.
- Select the Commands tab.
- Under Categories, select Edit.
- Under Commands section, look for the Purge Command and drag it to a toolbar. Example: I have put it next to the delete button as shown in the figure below,

Moving an Email in Outlook IMAP,
You should understand what happens when you move an Email from an IMAP folder to some other Folder. When you do so,
- The Email will be copied to the destination folder.
- The original Email in the source folder will be marked for deletion. And therefore, you will have to purge it to complete the move process.
Automatically purging deleted Emails,
This feature is very helpful for that if you wanted Emails that are marked for deletion to be deleted automatically. To turn it on,
- Select any folder of your IMAP account.
- In the Menu bar, select Edit.
- Point to Purge, and then click “Purge Options”.
- Check the “Purge items when switching folders while online” checkbox.
- Click the Ok button.
If that is set, you don’t have to worry anymore about purging Emails.
Note: When Emails marked for deletion are purged, they will be moved to the Trash Folder/Label (depending on our new Gmail settings). When an Email is moved to Trash, they will no longer have the “All Mail” label (achieving our goal for deleting an Email).
Note about Starred/Flagged Emails,
When using Outlook, the best way to delete a flagged Email, is to remove the flag first and then delete it. That is because we want to keep using the Gmail Starred label. If you delete and purge an Email in the Inbox folder where this Email is flagged, it will not be moved to Trash, and you will still see it in the Starred label/folder.
Now that you understand all this interaction for the new settings, it is time to setup the Outlook and MailStore for archiving your Emails.
For a better and more efficient use of the archiving method, please do the following in Outlook if you haven’t done so yet:
- Disable Outlook Junk Email filter. You will only need to use the [Gmail]/Spam folder and so the Outlook junk filter should be disabled. To do so,
- From the Menu bar, choose Tools then click Options.
- Select the Preferences tab.
- Click the Junk-Email button.
- Select “No Automatic Filtering…”
- Click OK, and then click OK again.
- Add the Purge Command (see “Adding the Purge Command to a toolbar” section in this tutorial)
Setting up MailStore for archiving Outlook Emails,
Downloading MailStore,
- Open the MailStore page.
- Then Click “Download MailStore Home” button, or just use the direct download link.
MailStore 4.0.6 Installation, (by the time of this writing, version 4.0.6 was the latest)
After you have downloaded the software, run the installer and Install the program…
When you run the program for the first time, it will ask you “Where should MailStore store all e-mail and settings?” just click “Create a new e-mail archive” radio button and click Ok button.
- Launch MailStore.
- At the top-right, and next to the Start button. Click on the Archive-Email icon/button, the icon is shown in the figure below,
- At the top-center, click the “Microsoft Outlook” button.
- Select “Archive Email Stored in your local Outlook” radio button.
- If you have several Outlook profiles in the drop down box, choose the right one. If you have only one, just proceed to the next step.
- Click the Next button.
- In the Folders section, click the “…” button.
- In the dialog, you can include/exclude folders for archiving. Normally, if you have many folders, you would want to include all and exclude some. To do just that:
- Keep the “Include Folders and SubFolders” text area blank.
- In the “Exclude Folders and Subfolders” section,
- Click on the Add… button. Then select “Personal Folders” folder and make sure that “Include Subfolders” checkbox is checked. Then click the OK button.
- Similarly, add the following folders from your IMAP Gmail account of the folder tree:
- [Gmail]/Starred
- [Gmail]/Spam
- [Gmail]/Trash
- If you have accounts that you do not want to archive their Emails, you should include their root directories as well in this section (Exclude Folders and Subfolders).
- Click the OK button to finish selecting folders.
- In the Filter section, check the “Only archive messages that are older than” checkbox. You can set a Date or a Range. Typically, you might just want to set a range so that next time you want to archive your emails, you would just run the archive processor without modifications to the settings.
- In the Delete section, click the “…” button.
- Select the “immediately after archiving” radio button then click the OK button.
- Click the Next button.
- Enter a name for your settings in the text field shown.
- Keep the “Run after clicking Finish” checkbox unchecked (we will run the archiving process in the next section). Then click the Finish button. You will see that an entry for you settings has been added.
To run an archiving process,
- Select the Entry of it.
- Click the Run button at the bottom right of the Window. (Or you can simply double-click the entry).
To change the settings for an entry,
- Select the Entry.
- Click the Properties button at the bottom right of the window and change your settings.
You can also create a shortcut for the entry on your desktop,
- Select the Entry.
- Click the “Create Shortcut on Desktop” button at the bottom-right of the window. If you double-click on the shortcut, archiving will start immediately.
Note: When the archiving process finishes, the emails in your Outlook IMAP account corresponding to the archived Emails will be marked for deletion (depending on our settings). And therefore, to complete the Archiving process, you will have to purge them using the Outlook Purge command. When the Emails are purged they will be moved to the Trash label, and will be permanently deleted after 30 days.
Exporting the MailStore archive to Outlook,
After the archiving process is done, you may need to export your archive to Outlook. To do so,
- At the left pane of the MailStore screen, you can see the “My Archive” folder tree. If you want to export the entire folder, right click over it.
- Point to “Export To” then select “Microsoft Outlook”.
- Choose “Export Email to your local Outlook” radio button. (The option for exporting directly to pst files is not available with the free version). Then you can use the Outlook AutoArchive on personal folders only! (Or manually move them to .pst files).
Want to get updates for new posts? Subscribe to my RSS feed and follow me on twitter :)
You can also get the ITfall blog updates by Email.
And don't forget to share this post and leave a comment ;)
Possibly Related posts:
3 Comments
Thank you for this insightful look that shed light on the different limitations Outlook client has. After reading this article, it is a must to try Mailstore with the suggested procedures.
I followed these archiving steps and the problem I have now is my blackberry is telling I me need to turn on the All Mail in the Gmail setting in order to receive emails on my phone. Any solutions
Matt,
If you have archived your emails and you are done with it, I don’t see any problem in setting “All Mail” back on so that you can get your emails on your Blackberry if it requires it.
Amer.