Ticket #4561 enhancement new
Decouple literal-handling code from command parsing code in twisted.mail.imap
|Reported by:||khorn||Owned by:|
It seems like it would be a good idea to decouple the part of the IMAP parsing code that handles "literals" vs. "commands" in the imap module into a separate layer. This would:
- simplify the IMAP-specific parsing code
- allow code-reuse for anyone wanting to implement other IMAP-like protocols (e.g. ACAP, ManageSeive, etc.)
Probably should be implemented as an intermediate class between Protocol and the IMAP classes which would have methods like 'literalReceived', 'literalAboutToStart', 'commandReceived' etc. that the IMAP classes could then override.
There might also be a way to do this as a mixin or an interface instead.
This ticket might help make #4124 a bit easier.