diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp index 8569d2264a3b..6ee7b3bf6884 100644 --- a/mailnews/imap/src/nsImapProtocol.cpp +++ b/mailnews/imap/src/nsImapProtocol.cpp @@ -4319,7 +4319,14 @@ void nsImapProtocol::InsecureLogin(const char *userName, const char *password) command.Append(" login \""); command.Append(userName); command.Append("\" \""); - command.Append(password); + + // if the password contains a \, login will fail + // turn foo\bar into foo\\bar + nsCString correctedPassword; + correctedPassword = password; + correctedPassword.ReplaceSubstring("\\","\\\\"); + command.Append((const char *)correctedPassword); + command.Append("\""CRLF); nsresult rv = SendData(command.GetBuffer(), PR_TRUE /* supress logging */);