Outlook 2013 and GMail: I want outlook delete action to archive not trash

In Outlook 2010 there was an option to have the delete action move the e-mails into a specific IMAP folder instead of moving them to trash. That option is apparently has been dropped in Outlook 2013.

When I delete an e-mail in Outlook 2013, it ends up in the trash folder on GMail. I prefer to just archive the e-mails in another folder/label and keep them forever or until I hit my 10 GB limit (which ever comes first :)).

My GMail IMAP settings are:

  • When I mark a message in IMAP as deleted: Auto-Expunge on - Immediately update the server.

  • When a message is marked as deleted and expunged from the last visible IMAP folder: Archive the message (default)

I would have thought that with these settings it would be impossible for an IMAP client to trash an e-mail.


After searching in a lot of forums, posts, and comments,

A combination of two solutions finally fixed this issue for me on 3 different gmail accounts.

These are the steps:

  1. Delete the label "deleted items" from your gmail account (previous outlook version may have added this label, all the mail with that label will move to archive)
  2. In Outlook in the left nav folder list, click on "[Gmail]"
  3. Right click on [Gmail] .. IMAP folders
  4. Tick the box "When displaying hierarchy in Outlook, show only subscribed folders"
  5. Restart Outlook 2013

After the restart a new folder "deleted items (This computer only)" will appear in your outlook and from now on all of the deleted items will go there locally and to Archive on Gmail.

BTW, From now on you can see the "all mail" folder as well.

Enjoy.


  1. Gmail settings: Go to Gmail Settings -> Forwarding and POP/IMAP and set these options:

    1.1. When I mark a message in IMAP as deleted: Auto-Expunge on - Immediately update the server. (default)

    1.2. When a message is marked as deleted and expunged from the last visible IMAP folder: Archive the message (default)

  2. MS Office 2013 settings: Go to File -> Account Settings -> Account Settings -> Email Tab -> Select your account -> Change button -> More Settings -> Advanced Tab and set this setting:

    2.1. Under Deleted Items enable Mark Items for deletion but do not move them automatically

P.S. It worked for me. Now when I delete a message in Inbox, outlook only marks it for deletion and let the gmail do its default delete action (i.e. archive the mail).


After extensive research and obsessing on this, it appears that there is currently no way in Outlook 2013 to make SMTP messages be archived instead of going to trash. So, taking a different tack, I am letting Outlook 2013 delete them and then using an Google Apps Script to periodically to archive the messages out of trash.

function myFunction() {
  var threads = GmailApp.getTrashThreads(0, 200);
  GmailApp.moveThreadsToInbox(threads);
  GmailApp.moveThreadsToArchive(threads);

  if (threads.length > 0)
  {
    var emailAddress = Session.getActiveUser().getEmail();
    GmailApp.sendEmail(emailAddress,
                       'Moved ' + threads.length + ' messages out of trash.',
                       'Have a good day.');
  }
}

You can set the function up to run hourly or daily depending on your preference.

References:
https://stackoverflow.com/questions/11964870/gmail-api-move-from-trash-to-archive-using-script-google-apps-script
https://developers.google.com/apps-script/your_first_script
https://developers.google.com/apps-script/execution_methods#time-driven_trigger


I tried all of the above (except the Google Apps Script) to no avail, but I finally achieved the desired result by combining suggestions above with another tweak as follows. (I'm going to include all the settings I tweaked, even though some may not be necessary.)

(Warning: I'm just a tinkerer, not an expert.)

  1. In Gmail's Label settings, I have both "All Mail" and "Trash" set to show up in IMAP.
  2. In Gmail's IMAP settings, I have Auto-Expunge turned on (the default setting).
  3. In my Outlook account settings, I'm using the standard ports:993 and 587.
  4. In my Outlook account settings, under the "Advanced" tab, in the section under "Deleted Items", I selected the first option, "Mark items for deletion but do not move them automatically". Note that this is not the default option.
  5. In Outlook's IMAP Folders options, I have ticked the box, "When displaying hierarchy in Outlook, show only subscribed folders".
  6. It may not matter, but in my case, in order to get All Mail to show up in Outlook, I first tried to manually subscribe to the folder, and then finally I had to manually create an "All Mail" folder under [Gmail]. Then I right-clicked and selected "Process Marked Headers". This made All Mail show up normally.

I think that's it (unless I'm forgetting something). Believe it or not, with the above settings, I now have the desired behavior where deleting a message in Outlook simply causes it to be archived in Gmail. For all I know, it may be unnecessary to subscribe to the All Mail and Trash folders, but at this point I would rather not do any further tweaking, since for now everything is working perfectly. But I think the key is #4 above, perhaps combined with having Gmail's Trash folder included in IMAP.