cURL / Mailing Lists / curl-library / Single Mail


IMAP and Usernames

From: Steve Holme <>
Date: Sat, 24 Mar 2012 10:57:58 +0000

Hi all,

I've just been playing around with setting up IMAP on my Exchange Server and
trying to get curl to work (The sort of thing you obviously do on a Saturday

The good news is I got it working but the IMAP4 protocol doesn't deal very
well with usernames that contain spaces - they have to be escaped with quote
marks whilst the POP3 and SMTP protocols have no problems.
So for example the plain text login command in POP3 is:

USER Steve Holme
PASS <password>

And SMTP and AUTH LOGIN would be:

<base64 encoded password>

Whilst in IMAP4 the equivalent needs to be:

B LOGIN "Steve Holme" <password>

When running curl or even my own application I can cope with this by passing
in a string that simply contains the quote marks.

However, should libcurl detect this and escape the username itself or is it
outside its responsibility?



List admin:
Received on 2012-03-24