smiley22 / S22.Imap

A free, easy-to-use and well-documented .NET library component for communicating with IMAP servers
http://smiley22.github.com/S22.Imap/Documentation/
MIT License
210 stars 112 forks source link

Help needed: how to handle delegated mailbox #128

Open John-Simons opened 8 years ago

John-Simons commented 8 years ago

with my credentails on the network I have a mailbox, but I also have full access to another mailbox with these same credentails with another imap client (a payed one) I can just fill in the e-mail address and the username and password, but I cant find how to manage this with S22.Imap.

I Googled everything I know, and read almost the complete documentation, and did a lot of tries in my code, but I cant seem to find a solution (still hope there is one).

Hope here is someone here that can and will help me. If I'm not in the correct forum (issues) then please let me know so I can put it in the correct one.

by the way, I also tried to find it with client.listmailboxes, but it only lists all mail folders Thanks in advance John

hutchpd commented 6 years ago

This is covered in RFC4616

The mechanism consists of a single message, a string of [UTF-8] encoded [Unicode] characters, from the client to the server. The client presents the authorization identity (identity to act as), followed by a NUL (U+0000) character, followed by the authentication identity (identity whose password will be used), followed by a NUL (U+0000) character, followed by the clear-text password. As with other SASL mechanisms, the client does not provide an authorization identity when it wishes the server to derive an identity from the credentials and use that as the authorization identity.

It should be as simple as

ImapClient(hostname, 993, $"{DelegateMailbox}{ChrW(0)}{Username} , password, AuthMethod.Plain, True)