iPhone and Exchange Server
September 28th, 2007 by gregr
I’ve been using an iPhone for a while, and it’s definitely a whole new experience on a phone. I’ve been enjoying it quite a bit, but perhaps I’ll write more about that later.
I have it connected to our corporate Exchange server, and the first thing I noticed was that when I would delete a message on the iPhone, it wouldn’t get deleted in Exchange.
Technically, the message gets marked for deletion in Exchange via IMAP. The problem is, it just sits there in that state until eventually someone does an EXPUNGE command on your mailbox. And even worse, when you connect Outlook to Exchange via non-IMAP methods (like whatever the default is), the message just shows up with no indication it was marked for deletion.
Well, Shawn at fresh logic studios has built a small app that will periodically run an expunge against your mail account on Exchange, and this completely solves the problem. As downloaded, it runs the command every 5 seconds; I recompiled it to instead run every 5 minutes, so as not to get my IT guys too unhappy with me.
So a HUGE thanks to Shawn for writing this - it’s a lifesaver! Highly recommended.
UPDATE 7/14/2008 - I notice a ton of traffic coming to this post over the last few days; this post was written when the only way to connect your iPhone to Exchange was via IMAP. Â Using the iPhone 2.0 firmware, you can use Exchange ActiveSync, which doesn’t have the same issues as described above.
This entry was posted on Friday, September 28th, 2007 at 2:11 pm and is filed under apple, iphone. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

September 29th, 2007 at 5:27 am
As of the 1.1.1 firmware update, the problem seems to be solved. You need to go into Advanced Settings for your Exchange e-mail account on the iPhone and set the deleted items folder to the LOCAL IPHONE TRASH (in other words, do not set it to the Deleted Items folder on the Exchange server).
This is now working for me on 2 iPhones and others that I have run across on various discussion forums.
October 1st, 2007 at 4:10 pm
Ed - not for me; it seems I still need to run this app to get messages to be deleted…
October 3rd, 2007 at 1:05 am
Pingback
October 4th, 2007 at 1:31 pm
Are there any remote wipe or removal of emails if stolen or loss?
December 2nd, 2007 at 4:26 pm
I tried setting my Iphone settings to sent the items to Iphone TRASH, didn’t work; then I changed to send deleted items to the deleted items folder, didn’t work Also, I went to advanced settings on the Iphone and set to delete afer 24 hours, still doesn’t work. This is so frustrating. I am having trouble downloading the application to fix this. Have a PC with Windows XP. Will it run on that? I use Exchange.
December 2nd, 2007 at 5:09 pm
Marianne - it will indeed run on XP, that’s where I’m running the expunge app. As for my sent items and deleted items, I have the iphone set to point to the corresponding folders on the Exchange server, and it’s all working ok for me.
December 3rd, 2007 at 1:02 am
[...] iPhone and Exchange Server - Greg Reinacker’s Weblog - Musings on just about everything. [...]
December 3rd, 2007 at 8:26 am
When I try to run the expunge program, I get an error message — that the program has encountered an error and can’t run. I just saved the program on my desktop and try to run it from there. Even though I have my “Sent” messages from the Iphone set to show in my Outlook “Sent Items” file, they show up instead in “Sent Messages,” so then I just move them into the “Sent Items” folder because the “bcc” to myself makes for even more incoming mail. The deletion of email is a major hassle though, so I would love to get “expunge” working.
December 3rd, 2007 at 8:42 am
Greg,
I just noticed that messages deleted from my Iphone now appear in the “Deleted Items” file, but they still also appear in the Inbox, even when I empty the Deleted Items folder?
December 3rd, 2007 at 9:20 am
I should have said that on my PC I notice the Iphone messages are in the “Deleted Items” folder, but they also remain in the Inbox, even when the Deleted folder is emptied. I think this probably has to do with the Deleted items still being available on our server for a set amount of time.
December 3rd, 2007 at 9:29 am
Marianne - the behavior you’re seeing, with a copy of deleted items remaining in your mailbox, is exactly what the “expunge” command will take care of. Not sure why the app might not be working for you, though; you might leave a comment with the guys who wrote it (see link in this post above) and perhaps they could help you…
December 6th, 2007 at 12:33 pm
I removed and reinstalled Expunge and got it to work after all. Outlook on my PC deletes the Iphone messages and every time it does a Send/Receive. I owe you a beer!
December 22nd, 2007 at 4:35 pm
Is this only about email? What about the calendar and other tools in exchange … will it sync with an iPhone?
December 22nd, 2007 at 4:36 pm
And … I mean wireless like my blackberry will.
December 22nd, 2007 at 4:40 pm
Tony - calendar and contacts need to sync through iTunes, using a cable…no over-the-air sync for that info. I came from Windows Mobile, where both of these would sync wirelessly (unlike Blackberry, which will only sync calendar wirelessly, not contacts) - it’s certainly an inconvenience, having to use a cable, but I’ve found it’s not as bad (for me anyway) as I thought it would be. Personally, I’m willing to live with it, in exchange for all of the other things I get from the iPhone…but YMMV.
January 9th, 2008 at 11:20 am
I download the app but it just reads “running…” and never changes after I give the three pieces of information . Am I doing something wrong?
January 9th, 2008 at 11:34 am
Ryan - nope, that’s what it’s supposed to do. :-)
January 9th, 2008 at 11:54 am
So I leave it running in the background, and then how long should it take see a sent eamil show up?
January 9th, 2008 at 11:56 am
Ryan - the only thing it does is flush out deleted messages so you won’t see them in Outlook and other apps. Everything else is done by the iphone itself…
January 9th, 2008 at 12:07 pm
Greg Thanks for all your help! Deleted emails is working for me know, but they seem to be deleted completely from the server not sent to the deleted items folder like specified in advanced settings. Oh well, they stay on the Iphone trash if i need them.
Just to clarify this only works for deleted emails. Correct? If i send an email from my iphone it will not show up in sent emails on the server, but only on sent on the actuall iphone. Is there a way for sent emails from the Iphone to show up in the sent file on the server? Thanks again for you help!
January 9th, 2008 at 12:10 pm
Ryan - you need to map your “sent”, “deleted”, etc folders on the iphone to be the appropriate server folders on Exchange; you do this from the iphone mail setup somewhere. If you google, you’ll find detailed instructions how to do all that.
January 12th, 2008 at 6:11 am
>>(unlike Blackberry, which will only sync calendar wirelessly, not contacts)<<
This is not correct. Blackberry syncs both Calender & Contacts wirelessly, certainly does with MS Exchange.
January 12th, 2008 at 12:07 pm
peer - thanks…that must have changed since I last took a close look at the Blackberry.
February 9th, 2008 at 7:14 am
gregr: i bought i phone day one. I have had the Iphone since day one, love it. However, I still have been unsuccessful in setting up my corporate email. We run MS Exchange server 2003 and Windows XP.
I have heard so much back and forth about YES, it’s compatible, and NO, Apple made sure it wouldn’t work.
However, all over google there’s posts and blogs about folks getting it to work, your blog being one of those that are PRO ES:
http://www.talkiphone.com/forums/iphone-chat/430-connect-iphone-exchange-2003-a.html
http://blogs.zdnet.com/microsoft/?p=534
http://www.rassoc.com/gregr/weblog/2007/09/28/iphone-and-exchange-server/
Point being, if anyone has actually done this, I will buy them a plane ticket to sunny South Florida to hook me up…
Anyone?
February 9th, 2008 at 9:23 am
J.P. - the gating factor is whether your IT guys will enable IMAP on your Exchange server, and expose the necessary ports through your firewall. Once that is done, it works for me…
February 13th, 2008 at 8:53 pm
Everything was syncing beautiful, my Exchange server corporate email acct and my contacts from the day I connected my iphone last month. The problems started with the new update a couple of weeks ago. Since the update, I friggin can’t get all of my Outlook contacts to sync correctly. I had all 1,500+ contacts and now I can only sync about 500 of my contacts. I did a restore/sync reset today & now I can’t get my exchange server to connect :(. MAC…you’re losing me!!
March 4th, 2008 at 11:59 am
@ gregr: I know this doesn’t pertain to iPhone but you mentioned BlackBerry sync. BlackBerry DOES synchronize contacts (as well as just about everything) wirelessly and has done this for quite some time. Contacts, app configurations, memos, tasks, messages, calendar entries, etc are all synchronized wirelessly unless disabled by the company’s BlackBerry administrator.
March 22nd, 2009 at 4:47 am
You can sync Tasks and Notes with Exchange 2007 using iExchange, it’s an application you can find in App Store.
April 13th, 2009 at 9:39 am
Hi all,
It seems everyone has the same problem. I have three questions infact:
1. can i connect my iphone exchange server with my hotmail id?? i mean to synchronise it !!
2. Why does it not download the attachments?? So that we can send viz blue tooth to some other device ??
3. Blue tooth, it doesnt detect any devices near by …why ??
Kindly clraify me ..anyone??