Do you see a use for an IMAP proxy where the proxy would be able to execute hooks which modify mail contents, such as transparent encrypting/decrypting mails, or maybe some virus-filtering? It would need at least some kind of IMAP command/reply parsing capabilities, so it might be able to do all kinds of other things.
Maybe one potential use case would be Cyrus Murder-like proxying to multiple IMAP servers to distribute the mailboxes. But that might be done better as an imap process plugin, or maybe as IMAP mail storage backend.
Anyway, the reason I'm asking this is because I was asked to add mail encryption/decryption capabilities to Dovecot's IMAP proxy, but I'm not sure what would be the best way to handle this. In any case it would be a plugin or a new binary which is executed instead of imap binary, but can I do it in a way that would actually be useful for Dovecot project in general?