IMAP is a lot. It's a stateful protocol that doesn't lend itself to a simple implementation and can be intimidating. IMAP's syntax is branched, subtle, and has various issues. Above that, the syntax is intertwined with business logic, making separating concerns difficult. It doesn't help either that there are more than 70 extensions, with any of them potentially breaking your understanding of how IMAP operates.
After the talk, you will have a much better understanding of IMAP and, hopefully, will avoid making the same mistakes we made.