Discussion:
"Authentication failed" when trying to connect to Imap account
Beatrix Willius
2014-08-11 14:32:48 UTC
Permalink
Hi,

Curl newbie here. I'm trying to connect to one of my Imap test accounts via Curl. It's works fine when using Python's imaplib, but Curl gives me an "Authentication failed" error. The server I'm trying to connect to a plain vanilla Kerio server.

Using Mac OS 10.9.4, Curl on Xojo via MBS plugin.

Here is the output from Curl:

Rebuilt URL to: imap://macsend.de/
Hostname was NOT found in DNS cache
Trying 46.253.112.9...
Connected to macsend.de (46.253.112.9) port 143 (#0)
* OK Kerio Connect 8.3.0 IMAP4rev1 server ready
A001 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 IDLE ACL LITERAL+ UIDPLUS QUOTA ID SORT ANNOTATE ANNOTATEMORE STATUS-COUNTERS UNSELECT LISTEXT NAMESPACE XLIST SPECIAL-USE STARTTLS AUTH=CRAM-MD5 AUTH=PLAIN AUTH=LOGIN AUTH=DIGEST-MD5
A001 OK CAPABILITY completed
A002 AUTHENTICATE DIGEST-MD5
+ cmVhbG09Im1haWwubWFjc2VuZC5kZSIsbm9uY2U9IjJCdXNneERWOGtWaExsc0MvbVhCaEE9PSIscW9wPSJhdXRoIixhbGdvcml0aG09bWQ1LXNlc3M=
dXNlcm5hbWU9ImJ3IixyZWFsbT0ibWFpbC5tYWNzZW5kLmRlIixub25jZT0iMkJ1c2d4RFY4a1ZoTGxzQy9tWEJoQT09Iixjbm9uY2U9ImRiZjQ5ODU3IixuYz0iMDAwMDAwMDEiLGRpZ2VzdC11cmk9ImltYXAvbWFpbC5tYWNzZW5kLmRlIixyZXNwb25zZT1iNDM0MDllN2YxNjM1MmY5N2RjNzQ3ZDMwMmM5ZDI1ZA==
A002 NO Authentication failed
Authentication failed: 78
Closing connection 0


Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.h
Steve Holme
2014-08-11 19:48:32 UTC
Permalink
Post by Beatrix Willius
Curl newbie here.
Hi and Welcome...
Post by Beatrix Willius
I'm trying to connect to one of my Imap test accounts via Curl. It's
works fine when using Python's imaplib, but Curl gives me an
"Authentication failed" error. The server I'm trying to connect to a
plain vanilla Kerio server.
Certain servers are known to give us problems in our DIGEST-MD5 implement and as the person who maintains the email protocols here, I've not got to the bottom of it yet, due to lack of access to such servers - my apologies :(
Post by Beatrix Willius
Using Mac OS 10.9.4, Curl on Xojo via MBS plugin.
What version of curl are you using? I'm guess from your log output something that is pre v7.37.0?

Are you able to try again with either v7.37.0 or v7.37.1 (The latest)?

If not, is it possible to obtain the communication from Python's imaplib to see what it sends and receives from your server - this might be useful anyway if the latest version still fails.

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etique
Beatrix Willius
2014-08-12 15:11:26 UTC
Permalink
Hi Steve,
Post by Steve Holme
Certain servers are known to give us problems in our DIGEST-MD5 implement and as the person who maintains the email protocols here, I've not got to the bottom of it yet, due to lack of access to such servers - my apologies :(
This is the easiest problem of all to solve. I'll contact you.
Post by Steve Holme
Post by Beatrix Willius
Using Mac OS 10.9.4, Curl on Xojo via MBS plugin.
What version of curl are you using? I'm guess from your log output something that is pre v7.37.0?
I'm using a plugin and have contacted the plugin author for the Curl version. Additionally, I've asked him if it's possible to update to the latest version.
Post by Steve Holme
Are you able to try again with either v7.37.0 or v7.37.1 (The latest)?
If not, is it possible to obtain the communication from Python's imaplib to see what it sends and receives from your server - this might be useful anyway if the latest version still fails.
Need to check if this is possible.

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.htm
Steve Holme
2014-08-14 19:36:53 UTC
Permalink
Post by Beatrix Willius
Post by Steve Holme
Certain servers are known to give us problems in our DIGEST-MD5
implement and as the person who maintains the email protocols here,
I've not got to the bottom of it yet, due to lack of access to such servers
- my apologies :(
This is the easiest problem of all to solve. I'll contact you.
Many thanks for that and allowing me to verify that curl 7.37.1 works as it should.

For anyone reading this thread with interest, I emailed Beatrix privately after she sent me server details and I test the latest code base. In summary DIGEST-MD5 authenticate was successful with her server using DIGEST-MD5 with both a Windows x64 SSPI build, that uses the Windows API to perform the Digest, as well as a Windows x64 OpenSSL build that performs the Digest natively within curl code.

There have been a couple of fixes in this code over the last couple of months, though I suspect it is the first that fixes this particular problems...

The first was that I added the qop into the client's response in 7.37.0 – this was a bit of a gamble when I implemented it but I found through the SSPI implementation that it sent it and our native routines didn’t ;-) As such my belief was that any server that was expecting a qop may fail.

The second fix was in 7.37.1 where we changed the length of the cnonce to make it longer.

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.h

Continue reading on narkive:
Loading...