Tuesday, February 19, 2008

Fun of implementing a IMAP server (part 2)

So after my IMAP server works with Outlook Express, I tried it with Mozilla Thunderbird. Well, Thunderbird reported my IMAP server is not a IMAPv4 server. Scratch my head I can't figure out why, downloaded Thunderbird source (the power of opensource), and the source tree is HUGE!! Finally found where it is doing IMAP, and everything looks normal.

So I print out the request/responses of the IMAP connection from Thunderbird. the problem is when I reply the CAP request, I responded with:
and Thunderbird think the response is for OK instead of CAPABILITY.

So that is solved. Now Thunderbird won't show any items in folders. Again the source! Well Thunderbird expects UID # in each response, even if the request didn't see UID in tags. And Thunderbird doesn't like RFC822.PEEK to return the full body (I was returning the entire thing to Outlook Express when I see RFC822.PEEK tag). So Thunderbird is more strict in compliance, where if they want header just return the header instead.

Anyway there were a lot of other problem alone the way, but those are boring ones :-)
Next week I will install my IMAP/SMTP service on our server, because wife doesn't like to risk it. The one big advantage of my own implementation is delete/move is ultra fast (because each email is a single file), where UWIMAP uses mbox format, delete/move is extremely slow.

No comments: