Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
Outlook may be trying to be too clever, moving messages to the trash folder rather than merely marking it deleted. Not sure what to do about it if that's the case... –  Darael Feb 1 '13 at 0:10
add comment

6 Answers

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.

share|improve this answer
add comment

Turning Auto-Expunge off in Gmail fixed this for me.

share|improve this answer
    
I fear that this option is a like a ticking time bomb. From what I have read, these messages are still sitting there marked for deletion and will be deleted the next time a compaction or manual expunge request comes in (perhaps for a mobile device). Maybe that request will never be sent or maybe it will get sent and I will not notice it until the messages are gone. –  Jersey Dude Feb 11 '13 at 15:13
add comment

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:
http://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

share|improve this answer
add comment

This... seems to work, consistently and with multiple accounts.

However, it does seem a bit... dubious, not to mention counter-intuitive, if not ridiculous. Oh, and just plain goshdarn surprising. I almost hesitate to post it, but as I said it empirically works, consistently.

When defining a Gmail account in Outlook, you need to manually set the port numbers and protocols.
According to the Google help docs, IMAP requires SSL and uses port 993; SMTP requires TLS / SSL (depending on which line you read) and uses either port 465 or 587.

Well, port 465 only works with SSL (not TLS), so I've always gone with TLS on 587.

On a lark, I set the account to use port 465 with SSL.... and now the Delete action does indeed Archive the emails.

Again, when using TLS/587 Outlook Delete erases the email; with SSL/465 Outlook Delete results in a Gmail Archive.

Simply shocking behaviour.

share|improve this answer
    
I was already on port SSL/465 when I reported this problem. –  Jersey Dude Sep 10 '13 at 12:38
add comment

There are two setups to accomplish what you want.

First, turn auto-expunge off in Gmail and select Archive as the expunge-time action. Then, in Outlook account settings, set items to be marked for deletion but only deleted when the account is updated. These two settings work to turn Outlook [delete] into Gmail archive. To actually delete the item, move it to Gmail trash.

Second, and perhaps more elegantly, instead of the above steps, subscribe to the All Mail Gmail folder. To archive the message, move it to the All Mail folder. To delete it, simply click delete or move it to the trash. Gmail will figure out what you want to do and will remove extra copies of the message.

share|improve this answer
    
#1: See ticking time bomb comment above regarding auto-expunge. #2: I do not want to have to change my behavior. I just want delete to archive like it used to. –  Jersey Dude Sep 10 '13 at 12:38
add comment

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.

share|improve this answer
    
As far as I can tell, my solution is safe in the sense that the "deleted" items in Outlook will never actually be "purged". Note the following link for reference: office.microsoft.com/en-001/outlook-help/… –  Lucas D May 24 at 17:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.