login about faq

I do have a question though as a user is experiencing a bug: their password has a backslash in it and the library is not able to connect to the IMAP server because the string is not properly escaped. Is there a best practice for this?

asked Aug 03 '12 at 14:25

chilkat's gravatar image

chilkat ♦♦

I did some testing and found that if I send a double-backslash, then the IMAP login succeeds. For example, in C++ code, I did the following:

    success = imap.Login("test@testemail.net","xyz\\xyz");
Each double-backslash in the C++ literal string results in a single backslash char, and therefore two backslashes are sent for the password. This results in a successful authentication.


answered Aug 03 '12 at 14:29

chilkat's gravatar image

chilkat ♦♦

From the IMAP RFC:

Certain characters, currently the double-quote and the backslash, may
not be sent as-is inside a quoted string. These characters must be
preceded by the escape character if they are in a quoted string, or
else the string must be sent as a literal. Both clients and servers
must handle this, both on output (they must send these characters
properly) and on input (they must be able to receive escaped characters in quoted strings).

Chilkat will be modified to automatically add the backslash if the password string contains a backslash or double-quote. This change will take effect in v9.3.2

This answer is marked "community wiki".

answered Aug 03 '12 at 14:47

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Aug 03 '12 at 14:25

Seen: 4,960 times

Last updated: Aug 03 '12 at 14:47

powered by OSQA