Can’t use vandelay to import mailbox from imap servers using impersonation.
Vandelay is not following the RFC4616 section 2
As I can see in /src/imap/client.rs code line 195 only authcid is being used, but RFC specifies authzid exactly for the requested feature.
Im my opinion the function authenticate_plain should admit authzid too to allow impersonation
I think that this could be implemented as optional parameter --auth-superuser (or any other name for the parameter) to fill the authzid value in the function.
The final target is being able to use vandelay to import mailboxes from, in example, zimbra server using impersonation.
Example of use:
vandelay import imap --allow-cleartext --url imap://imap.example.com --auth-basic "[email protected]" --auth-superuser "[email protected]" --auth-password "superuser_password" alice.sqlite
In RFC 4616 (SASL PLAIN), the layout of the payload is:
authzid || NUL || authcid || NUL || password
I think that vandelay is doing this:
NUL || authcid || NUL || password
When authzid is empty, server uses the authcid identity for authentication and for authorization and that works ok if impersonation is not needed, but when it is needed you have different identities for authorization and for authentication, but that is not possible to specify in current vandelay version.