Skip to Content

Prevent Spotlight from resurrecting your deleted emails on iPhone

Note: The problem discussed below behaves differently depending on the type of email account being used. Users of POP mail accounts are indeed noticing a problem with deleted email messages appearing in Spotlight search results. Please see this post for updated information.

Our friends over at Engadget have highlighted a Cult of Mac post that, at first glance, appears to have found a bug in Spotlight's caching of email search results on the iPhone. The idea is that after you delete an email from your inbox in the iPhone's Mail.app client, you can still locate and open the e-mail using Spotlight search, if you know the subject of the message.

What's really happening, though, is what Apple might otherwise call "user confusion." When you delete an e-mail message in most mail clients, the message isn't magically deleted, but instead moved to a "trash" or "deleted messages" folder. Being a folder, it is indexed by Mail to provide an unread count, as well as by Spotlight so that you can easily find messages in the folder. When you search for the email, it shows up in Spotlight and opens in Mail because the message still exists in your trash folder.

All right, so what can you do to avoid this? Well, you need to empty the trash folder from your email. With many providers, you can just go to the trash folder, and delete the message from there to permanently remove it. The problem there is that, if you use a service like Gmail, the message doesn't really get deleted when you do this because of the way Gmail translates its labels into folders. Gmail's Trash folder is also set to purge itself after 30 days by default.

Your options? You either have to use the Gmail web interface in Safari, or if you don't mind tweaking your Gmail settings, you can enable the Advanced IMAP Controls Lab and then change your Gmail settings to immediately delete messages instead of using the trash folder. (Note that if you have your "All Mail" label configured to show up in IMAP, you will need to either disable it, or delete the message from that folder on the iPhone as well. See this thread for more information.) Once you've deleted the message, go in to the Trash folder and hit the refresh button to ensure that the message is no longer listed, which will remove it from the local mail cache. This should also clear up Spotlight's index so that the message no longer appears.

By now, you're probably wondering if this is really something to worry about. In my opinion, it really depends on how you manage your email. If you rarely delete messages, or you just delete things that are not of interest to you, they will most likely disappear from your trash folder after a specified time period that is set by your email provider (usually somewhere between 7 and 30 days.) However, if you intentionally delete messages with the idea that the message is unretreivable, then you should probably consider testing this out for yourself to see if it affects you. Again, with many providers, just periodically deleting the contents of the trash folder will do the trick. If you use Gmail, or your company's email services are hosted by Google, then you may need to log in to the web interface periodically to empty the trash, or you can look into the available configuration options, if you feel comfortable doing so.

So in reality, this isn't really a bug as much as it is what I would call "intended, but unexpected behavior." Many people simply forget that the trash folder exists, particularly on the iPhone where you don't always see it sitting off to the left hand side of your inbox. Checking your trash folder for any unintentionally deleted items, and cleaning out the old messages periodically, isn't really a bad habit to get into. With that said, however, I do think that Apple could improve this behavior by implementing some simple changes like adding an "Empty Trash" button to the trash folder, showing the count of all messages in the trash instead of just unread messages (so that it's easier to notice there are messages in there), and having Spotlight either ignore deleted messages like Leopard's Spotlight does, or at least indicate that they were found in the trash.

What are your thoughts on this? Do you consider this to be a bug, or do you think it's just a place that Apple could improve the experience on? Let us know in the comments!

Update: Leander Kahney has posted an update to the original Cult of Mac post that clarifies this issue a bit more. It seems that accounts using POP are configured by default to remove messages after one day or one week, thus causing them to continue to appear in Spotlight search results. Unfortunately, there isn't an option to remove them immediately, however, only after a day, one week, one month, or never. Because of this, Spotlight still sees them in the index, and Mail still contains a cached copy of the message until the time limit configured in the settings is reached.

If you'd like to check out this setting for yourself, go to the Settings app, tap on Mail, Contacts & Calendars, and choose the POP mail account you want to modify. Scroll down and choose Advanced, and the retention settings will be at the top of that page under Deleted Messages. It appears the default for a new account is to retain messages up to one week. So this is still the OS doing what it's configured to do, but there really should be an option to remove messages immediately here. If Apple were to add an option there, and/or remove Spotlight's ability to index deleted messages, the problem would be solved.

Update 2: After further investigation, it appears that some messages deleted on POP accounts do disappear from Spotlight, while others show up long after the message is deleted. I have conducted several tests on this situation, including on different versions of the iPhone OS, and have posted an update with details.



Note: The problem discussed below behaves differently depending on the type of email account being used. Users of POP mail accounts are...
 

Add a Comment

*0 / 3000 Character Maximum

23 Comments

Filter by:
Jack

Prevent Spotlight from resurrecting your deleted emails on iPhone.

Oh bad news

I just sold my 4GB iPhone to a people to replace the new 8GB iPhone in http://www.laptops-battery.co.uk/.
Hope he cant see the news.

August 20 2009 at 3:18 AM Report abuse rate up rate down Reply
E Grotz

Wow, no offense, but I'm amazed at how slow to the party everyone is here. I've known about this since mid June and tried to raise the issue all over the place, on here, even the Apple Discussion boards but -- hah -- nobody would listen (cries) ! boo hoo!

http://extensivegroup.blogspot.com/2009/06/iphone-bug-in-30.html

As far as I could tell it only affected POP accounts (of which I had only one). It's a security risk, in so far as POP in general is also a security risk!

August 19 2009 at 9:41 AM Report abuse rate up rate down Reply
Patrick Coffey

There is still a problem. I use exchange server and I know for a fact that my trash can is empty both on my iphone, outlook, and outlook webmail. But still spotlight shows that I have messages in my trash can. When I click on the message, the body of the message says "This message has not been downloaded from the server". Clearly there is a bug in 3.0

August 18 2009 at 5:55 PM Report abuse rate up rate down Reply
1 reply to Patrick Coffey's comment
TuxToaster

Patrick,

Please see my updated post on this. There is indeed a bug associated with POP accounts, and I'd have to assume, Exchange accounts that use POP as well. Looks like it should be fixed in 3.1, unless Apple releases an update before then.

August 18 2009 at 6:13 PM Report abuse rate up rate down Reply
badtzmaru

what an inconsequential "bug" / "feature"

August 18 2009 at 4:25 PM Report abuse rate up rate down Reply
KenC

Michael it's not just pop it's IMAP email as well. I tested this yesterday and it affects IMAP as well.


Secondly are you still trying to state that people are not clearing up their trash in their email accounts? It's a Spotlight bug it's not the idiocy of people not cleaning out their trash. Your comment above makes it seem that you still think that people are just simply NOT clearing out the trash. I ran Spotlight found the email I deleted and cleared out of trash (yesterday) clicked it took mail a bit to open it but sure enough it was open once I hit the back button it takes me to my "trash" list of email and sure enough that email IS NOT in that list. So it is caching that info somewhere DEEP inside the iPhone.

Apple even came out today saying they know this is a bug and it should be fixed in the 3.1 update how is it then the intended behavior?

August 18 2009 at 3:52 PM Report abuse rate up rate down Reply
2 replies to KenC's comment
kevin

There are two aspects to "clearing" the trash. First is removing the message from the trash (e.g. emptying the entire folder or deleting a specific message from Trash) and Second is refreshing the trash folder on the iphone. Performing only the first step will not remove it from the spotlight search.

This is exactly the way IMAP works. Most folders (except the inbox) do not update themselves until the user accesses them.

I suspect that Apple's fix to this will simply be to have the trash folder automatically update itself just as the inbox does.

August 18 2009 at 4:18 PM Report abuse rate up rate down Reply
TuxToaster

Ken,

When it comes to IMAP, Kevin is right. You have to empty the folder, *and* refresh it before Spotlight picks up on the changes. Once the email is completely deleted, and the folder(s) it was in have been refreshed, then Spotlight won't find it anymore.Yeah, it's a big PITA, but really, that's how IMAP works in general... the app has to periodically poll the folders or be manually refreshed before it knows that an email is no longer there.

With POP, however, I did some digging and found out there is indeed a bug there, it just doesn't happen every time, and I guess I was lucky enough for it to work fine the first time I tried it. When using POP, the client marks the email as deleted, but never fully deletes the message and so it continues to show up under Spotlight's results. Luckily, Apple has already fixed that problem in the 3.1 update though.

August 18 2009 at 5:27 PM Report abuse rate up rate down Reply
Pasnbyu

On a related note, I used a similar "feature" to resurrect mt Notes app after it began crashing immediately after opening. I used Spotlight search to find a Note by searching on a word I knew was in a Note. After opening the Note it found from the Spotlight results screen, the Notes app has worked ever since. I wonder if this "feature" will be "fixed" as well?

August 18 2009 at 2:43 PM Report abuse rate up rate down Reply
Marco

This post is innacurate, please correct it or delete the post. The bug is there, I delete and delete and re-delete and spotlight still finds the email. So, please, I know you want to defend Apple (why? I don't know) but encouraging companies to fix their bugs (instead of explaining them away) is a good thing.

August 18 2009 at 2:25 PM Report abuse rate up rate down Reply
1 reply to Marco's comment
TuxToaster

As it says in the post, word is that POP accounts are affected differently due to a retention setting in the OS.

And for the record, I have no interest in defending Apple. If they're in the wrong on something, I'm more than fine with calling them out on it. But much of the hype going around about this issue is simply by people who don't understand that the iPhone is simply finding messages that are in the trash, or retaining messages that have been deleted as per the defined retention settings. If there is indeed a bug in the way this is being handled, then I'll update the post, but for now it seems to be intended behavior.

I do believe Apple should change the way this works, no argument there.

August 18 2009 at 2:46 PM Report abuse rate up rate down Reply
richard

I'm wondering if more time was spent researching the story to get the facts straight, or designing the picture to go with it?

August 18 2009 at 2:22 PM Report abuse rate up rate down Reply
2 replies to richard's comment
TuxToaster

I tested the problem, which was said to be an issue for all email accounts. I found that ensuring the messages were deleted and refreshing the trash folder did indeed remove the results from Spotlight, and I posted this article to clarify those points.

Cult of Mac has now posted an update, clarifying the problem and detailing that the issue mainly deals with POP3 accounts and a setting in the iPhone OS that retains deleted messages. I've already updated the post with this information.

Either way, the facts are straight, and as more information on the problem develops, we'll continue to update the post.

August 18 2009 at 2:38 PM Report abuse rate up rate down Reply
richard

Thanks for re-reporting cult of mac posts. I'll be sure to just read their site in future. I'll come here for the laughs. My favorite part of this particular article:

"What are your thoughts on this? Do you consider this to be a bug…"

August 18 2009 at 2:47 PM Report abuse rate up rate down Reply
A User

Not really a bug or feature. It is just how it is.
There are always a trash bin. If you don't dump it, you delete items always there.
iPhone is not a repository, the server will always hold the e-mail and its content. So, technically, it is still existed. Deleting from iPhone is moving away from the inbox.
In fact, no one for sure knowing those "e-mail" system will ever delete our emails.

August 18 2009 at 2:16 PM Report abuse rate up rate down Reply
darkpaw

I think this is still a bug.

I use a normal everyday POP service for one of my email accounts. I have read a bunch of emails, and received a bunch of spam which I deleted. I then emptied the Trash on the iPhone.

On my desktop Mac, the emails download again (I have set the server to not delete the emails until my Mac reads them). I force the server to delete the emails and they are indeed gone.

Back on the iPhone, going into the Trash for that mail account shows no emails. Running Spotlight on the phone lists the spam emails I deleted. They still exist somewhere in the iPhone even though the Trash has been emptied and refreshed. If I select one of the Spotlight results, Mail launches and crashes. I would say this is a bug.

August 18 2009 at 1:59 PM Report abuse rate up rate down Reply
1 reply to darkpaw's comment
Miller

I would agree.... a bug it is.

Once a message is deleted and the trash is emptied, the search should NOT let you find it again. I can't wait till Apple says its part of their new "Advanced Deleted Message Search Algorithm". LoL.

I am an Apple fanboy... but sheesh. :)

August 18 2009 at 2:07 PM Report abuse rate up rate down Reply
Buy an ad here

Hot Apps on TUAW

Tweets

© 2012 AOL Inc. All Rights Reserved.