simple.mailserver icon indicating copy to clipboard operation
simple.mailserver copied to clipboard

AUTH support question

Open hlesesne opened this issue 10 years ago • 2 comments

I was going to take a stab at implementing AUTH (probably LOGIN first) and wondered if @hanswolff had any suggestions for implementing the announcement and subsequent acceptance of credentials from the client.

I can extend SmtpCommandParser with a new ProcessCommandAuth, which handles the AUTH command along with the username, however this request then requires a subsequent send by the client of the password following a 334 (I think) response. This subsequent send does not contain a command parameter, only the password.

Here is a diff on a feature branch (sorry the commit is such a mess, it is just a spike and I inadvertantly included some superfluous code.

Link to ProcessCommandAuth

Any preference on how you would like this type of a workflow implemented?

hlesesne avatar Mar 17 '15 15:03 hlesesne

I haven't really looked how the AUTH works for SMTP. But your code looks okay so far. If I find time today I'll read about AUTH and see what is the best way to integrate it.

hanswolff avatar Mar 22 '15 06:03 hanswolff

Thanks. The toughest part is determining how to best handle the response from the client after the auth request, which doesn't actually contain a command, only the credential, so I can't use the standard ProcessCommandX pattern you have in place, so I wondered the best way to wait for that data. I suppose it would be similar to how you handle receiving the mail following the DATA command.

hlesesne avatar Mar 28 '15 14:03 hlesesne