I've had the same issues -- Dreamhost IMAP and I do think it started with the iPhone 4.1 install. I was hoping it would get fixed with 4.2, but no dice. Oddly enough, as you say, it's chronic but intermittent.
For awhile I was thinking it was happening when I was temporarily losing all connectivity on my iPhone (I live where cell coverage can be spotty), but have come to realize that it consistently happens even when I'm around 3G and wifi.
The other thing I thought may have caused it was Dreamhost moving me to a different mail server -- I think that and iOS 4.1 happened right around the same time.
I haven't bugged Dreamhost about it yet and have just lived with it (with frustration).
I'll keep an eye on this thread and certainly post anything worthwhile I discover.
This started happening for me and others in my office when Dreamhost switched our mail server. We don't see this problem with .mac or gmail. I have asked Dreamhost to look into it, but they say it is not their server. I switched to iPhone 4.1 in September. My Dreamhost mail server was switched in November. That is when my problems started (and 2 others in my office on iPhones). We are look for alternatives. Is anyone aware of others having this problem with iPhone mail?
I think the problem with ... this problem is that two things happened around the same time and possibly both are relevant. The thing is, my iPad on version 3.2 of the OS, had no trouble with the dreamhost IMAP servers. It was only when I upgraded my ipad to 4.2.1 that it started exhibiting the same issues that my iPhone started having as of 4.1.
I cannot be sure whether it was the dreamhost change or the iPhone change unfortunately. All my devices are at 4.1 at least, unfortunately.
The fact that others are seeing this now gives me up it will be fixed eventually, and I am glad people have pinged dreamhost. Sadly I think it's Apple (after all my ipad worked fine up until I upgraded it) and the chances they will fix it soon are slim unless there are a lot of people with the problem.
@Jonathan I wouldn't write off the possibility that it's Dreamhost because if it's caused by Apple, it seems non-Dreamhost IMAP users would find themselves in the same boat and other threads would be in a tizzy on this Apple discussion site. That being said, I was surprised to find little or no evidence of this problem on the Dreamhost forums.
@snailgarden Actually, there is something different about dreamhost imap servers than google, that's for sure. The question is, When they moved us to new servers did they change to a different version of IMAP that has slightly different behavior?
So, there's something different about the IMAP servers compared to gmail (not surprising as they are obviouly different implementations) but my mac computers have no trouble with messages getting marked read ... wait a second, I suppose I don't know that for sure since I always read my email with my Mac ...
Well I marked some messages as unread in the webmail interface, and they turned up unread in the Mac mail interface after I stopped and restarted Mail. I had to do that to get it to work though, even synchronising that server didn't help. Not sure what this means.
I just performed some tests with Mac mail and Thunderbird. If I toggled the "Unread" state of any item, it appeared immediately in the other mail program. So I could toggle in Thunderbird and the Mac would notice immediately, and I could do the same in Mac Mail and thunderbird would notice immediately.
It's just the iPhone and iPad that are not working.
This is clearly an iOS bug.
Looks like I'm back in the saddle. Here's what I heard from Dreamhost:
"That's most unfortunate. I was able to setup the email account on my own iPhone, which is running iOS 4.2. I haven't heard reports of issues with 4.1, however, but it's possible your settings on your device became corrupt on your prior update. I'd suggest recreating the email account in your device to be on the safe side since there's no issue with the servers themselves. Loading the email account in webmail and on my iPhone show the same status; 1 unread message at the time I checked. Things look to be in sync on setting it up, so it's likely the settings on the device that are the issue. Updating to iOS 4.2 might help as well. I hope this helps. If you have further questions, please don't hesitate to let me know."
I followed their suggestion -- after updating to iOS 4.2, I deleted my Dreamhost IMAP account on my iPhone and recreated it. After a day of testing, unread/replied-to/fwd'd/etc status is syncing correctly no matter which device (iMac or iPhone or webmail) performs the action. I'll keep an eye on it, but for now I'm saying: it's all good!
I hope this works for everyone else!
When i first had this problem on 4.1 I deleted all my accounts and it worked fine for a little while (but I don't think more than a day) and then it started going wrong again.
So when 4.2.1 came along I didn't bother going that route. But, because you seem happy with the result I will give it a try again with 4.2.
If it stops working for you, please let us all know ...
No this is not fixed.
However I have more information and I am more convinced it's an iOS bug.
If I change read/unread status in Mac mail and refresh my iPhone every time, that works just fine except for the last (or first, depending on how you sort) item in the list. So my most recent item, if I toggle the read/unread in Mac mail and then refresh my iPhone, it doesn't change. But for any other item in my inbox, that works just fine.
There's something special about the most recent item. So you can see how, over time, the most recent item at any given time, may get out of sync and you get scattered items screwed up. Actually, my theory gets a little fuzzy at this point ... I wonder if each 'most recent' item OVER TIME gets messed up, does it continue to have problems syncing from that moment on? That's what it seems like ... It's as though an individual item gets messed up some how and from then on it will not work.
Are you having better luck?
What am I saying!? It's way worse than that.
Any item I mark as read/unread on my iPhone has no affect on Mac mail unless I quit and restart the Mac mail.
Ah - and if I mark it unread in my iPhone and then go read it on my Mac mail, the Mac mail no longer affects it. Ah - that's the bug. I always ALWAYS do this on my iPhone. I mark something as unread on my iPhone so I can deal with it properly when I get back to my main computer.
THOSE are the items which stay unread forever. No - that's not quite it either.
However, I have proven to myself that this also happens on gmail for me now.
It's an iOS bug.
I am having the same problem on my iPhone with Dreamhost IMAP mail accounts, even after updating to iOS 4.2.1 and having deleted and recreated my mail accounts on the iPhone.
Incomplete synchronization (new messages appear, but messages that have been marked as read or deleted elsewhere linger on the phone).
Extremely annoying and limiting to the utility of the phone. Am glad to hear that others are having a similar problem so I know it's not just me!
For me the same issue but narrowed down to the following:
Only occurs when Iphone checks mail first. If mail is subsequently checked apple and the new mail changed to unmarked it works on the iphone, but only for new messages the old message (from iphone mail check startup) remain unread on the iphone.
Maybe someone will come up with the solution