curl / Mailing Lists / curl-library / Single Mail


Re: Question: how to specify a different identity using IMAP PLAIN auth?

From: Julian Espérat via curl-library <>
Date: Thu, 28 Feb 2019 22:39:50 +0100

I found out I can pass the authenticate command as a
CURLOPT_CUSTOMREQUEST. Except it breaks when cURL needs to reconnect,
because then it doesn't reauthenticate properly.

I think we need something like a CURLOPT_IMAP_IDENTITY to allow cURL
handling the authentication natively instead of as a custom command?

On Tue, Jan 29, 2019 at 6:08 PM Julian Espérat <> wrote:
> Hi,
> The IMAP AUTHENTICATE PLAIN commands expects the value to be
> base64(<identity>\0<username>\0<password>)
> I could not find how to tell cURL to use something else than the
> username in the the "identity" part of the AUTH command above, which
> is required to access a shared Office 365 inbox through IMAP.
> When using USERPWD="username:password" cURL sends the following IMAP command:
> AUTHENTICATE PLAIN <base64(username \0 username \0 password)>
> I tried different thing, including variations of
> USERPWD="username\identity:password" and "username:identity:password"
> but could not achieve it.
> Is there an option I missed? If not, can we do a feature request?
> Thanks a lot,
> Julian.

Received on 2019-02-28