andyedinborough/aenetmail — Issue #26: spaces and double quotes in password
Author: AndyClaw
Created: 2012-02-04 05:40:55+00:00
State: open

If password contains a space, the login command sends too many arguments.

The answer is to put quotes around the password, and to handle quotes in the password use backslash to escape, and to handle backslash use double backslash. Per RFC 3501 section 9 Formal Syntax.

I recommend altering the login command found in internal override void OnLogin using the following line of code:

command = string.Format("{0}LOGIN {1} \"{2}\"", tag, login.Replace("\\", "\\\\").Replace("\"", "\\\""), password);