I was subscribed to an IMAP list at one time but didn't discuss this much; my opinion of IMAP is rather low but I'm too polite to jump into someone else's list and tell them what I really think...
There are certainly mismatches between IMAP and SQL. For example, anything that implements virtual folders on the server will have to try hard to make the IMAP message sequence numbers work right. To be honest, I have been using Decimail for about five years and it "just works" for me, and I have now forgotten (or blocked the memories!) of the implementation challenges.