I have set up the default HTC email app to use IMAP. If i read a new mail on the phone, the read state is updated on my computer (thunderbird). Also, if I mark it as unread on the phone, then it becomes unread on my computer too. This is as expected.
But if I read email on my computer, it still shows as unread on my phone, similarly if I mark as unread on the computer the change is not visible on the phone. By viewing webmail and browsing my mail with netcat I know that the Seen flag on the server is always in sync with thunderbird, hence the problem must be on the phone's side.
Summary: IMAP flags changed on the phone is pushed to he server, but flags changed on the server is not updated on the phone.