Mailspring: SMTP error 17 when I add an account

Created on 2 Feb 2018  ·  32Comments  ·  Source: Foundry376/Mailspring

I can't add my University account to Mailsping. I get a SMTP bad login/password error in the app, error 17 in the logs.
It's working with the same settings on other mail apps, so it's not related to the server configuration.

Are there any related issues?

Related to this Linux issue https://github.com/Foundry376/Mailspring/issues/130

What operating system are you using?

Windows 10 64bits

What version of Mailspring are you using?

1.1.2-8ae17eae

--

Bug?

Do you have any third-party plugins installed? If so, which ones?

No

Is the issue related to a specific email provider (Gmail, Exchange, etc.)?

IMAP to Exchange server of my University

Is the issue reproducible with a particular attachment, message, signature, etc?

You cant reproduct that because you need valid logins.
This bug appears every time I try to add my account to Mailspirng

There are my logs :

* OK The Microsoft Exchange IMAP4 service is ready.
$��p�E1 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI UIDPLUS MOVE ID CHILDREN IDLE NAMESPACE LITERAL+
襑D1 OK CAPABILITY completed.
���(k��E�"2 LOGIN p1610912 "*********"
2 OK LOGIN completed.
3 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI UIDPLUS MOVE ID XPROXY3 CHILDREN IDLE NAMESPACE LITERAL+
3 OK CAPABILITY completed.
4 NAMESPACE
* NAMESPACE (("" "/")) NIL NIL
l��E�#4 OK NAMESPACE completed.
5 LIST "" "*"
//Not relevent
5 OK LIST completed.


----------SMTP----------
220 smtpbv.univ-lyon1.fr Microsoft ESMTP MAIL Service ready at Fri, 2 Feb 2018 14:11:32 +0100
EHLO LAPTOP-Bastien
250-smtpbv.univ-lyon1.fr Hello [134.214.126.172]
250-SIZE 36700160
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-AUTH GSSAPI NTLM
250 8BITMIME
STARTTLS
220 2.0.0 SMTP server ready
EHLO LAPTOP-Bastien
250-smtpbv.univ-lyon1.fr Hello [134.214.126.172]
250-SIZE 36700160
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH GSSAPI NTLM LOGIN
250 8BITMIME

SMTP Last Response Code: 250

SMTP Last Response: smtpbv.univ-lyon1.fr Hello [134.214.126.172]
SIZE 36700160
PIPELINING
DSN
ENHANCEDSTATUSCODES
AUTH GSSAPI NTLM LOGIN
8BITMIME


mailsmtp Last Error Code: 17

mailsmtp Last Error Location: 10

--

bug done-pending-release

Most helpful comment

Hey folks—interesting, thanks for following up @Pajn. I'm looking in to the CRAM-MD5 auth method now. That method is still preferred over PLAIN, but it /should/ work. I've configured a handful of different mail servers now, so I should be able to create a setup with the same LOGIN options you've shown in that snippet and test it out. Stay tuned.

All 32 comments

Any help here? I'm also trying to add my Outlook Web App mail and the exact same error appears.
I tried to do the same thing with Thunderbird and it's working just fine. The problem seems to be with Mailspring.

Would love to see this resolved and use the app :D

Also getting same issue
Using Ubuntu 17.10

Log:

----------IMAP----------
* OK The Microsoft Exchange IMAP4 service is ready.
r9r�1 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI UIDPLUS ID CHILDREN IDLE NAMESPACE LITERAL+
1 OK CAPABILITY completed.
2 LOGIN  [<snip>]
2 OK LOGIN completed.
3 CAPABILITY
d.* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI UIDPLUS ID XPROXY3 CHILDREN IDLE NAMESPACE LITERAL+
3 OK CAPABILITY completed.
4 NAMESPACE
* NAMESPACE (("" "/")) NIL NIL
4 OK NAMESPACE completed.
TAK5 LIST "" "*"
* LIST (\HasNoChildren) "/" Archive
* LIST (\HasNoChildren) "/" Calendar
* LIST (\HasChildren) "/" Contacts
* LIST (\HasNoChildren) "/" "Conversation History"
* LIST (\HasNoChildren) "/" "Deleted Items"
* LIST (\HasNoChildren) "/" Drafts
* LIST (\Marked \HasNoChildren) "/" INBOX
* LIST (\HasNoChildren) "/" Journal
* LIST (\HasNoChildren) "/" "Junk Email"
* LIST (\HasNoChildren) "/" Notes
* LIST (\HasNoChildren) "/" Outbox
* LIST (\HasNoChildren) "/" "RSS Feeds"
* LIST (\HasNoChildren) "/" Sent
* LIST (\HasNoChildren) "/" "Sent Items"
* LIST (\HasChildren) "/" "Sync Issues"
* LIST (\HasNoChildren) "/" "Sync Issues/Conflicts"
* LIST (\HasNoChildren) "/" "Sync Issues/Local Failures"
* LIST (\HasNoChildren) "/" "Sync Issues/Server Failures"
* LIST (\HasNoChildren) "/" Tasks
* LIST (\HasNoChildren) "/" Trash
5 OK LIST completed.


----------SMTP----------
220  [<snip>] Microsoft ESMTP MAIL Service ready at Wed, 7 Feb 2018 15:17:48 +0100
EHLO thobberlaptop
250- [<snip>] Hello  [<snip>]
250-SIZE 36700160
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-AUTH GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250 CHUNKING

SMTP Last Response Code: 250

SMTP Last Response: [<snip>] Hello [<snip>]
SIZE 36700160
PIPELINING
DSN
ENHANCEDSTATUSCODES
STARTTLS
AUTH GSSAPI NTLM
8BITMIME
BINARYMIME
CHUNKING


mailsmtp Last Error Code: 17

mailsmtp Last Error Location: 10
Waiting for Account JSON:

Waiting for Identity JSON:
15668 [2018-02-07 19:59:51.758] [main] [critical]
 ***
 *** A C++ exception occurred during program execution:
 *** type must be string, but is null
 ***

15668 [2018-02-07 19:59:51.772] [main] [critical]  *** Stack trace:
 ***   void nlohmann::detail::from_json(nlohmann::basic_json const&, nlohmann::basic_json::string_t&)
 ***   decltype ((from_json({parm#1}, {parm#2})),((void)())) nlohmann::detail::from_json_fn::call(nlohmann::basic_json const&, string&, nlohmann::detail::priority_tag) const
 ***   void nlohmann::detail::from_json_fn::operator()(nlohmann::basic_json const&, string&) const
 ***   void nlohmann::adl_serializer::from_json(nlohmann::basic_json const&, string&)
 ***   string nlohmann::basic_json::get() const
 ***   Account::SMTPSecurity()
 ***   MailUtils::configureSessionForAccount(mailcore::SMTPSession&, shared_ptr)
 ***   runTestAuth(shared_ptr)
 ***   main
 ***

/snap/mailspring/167/usr/share/mailspring/resources/app.asar.unpacked/mailsync: line 4: 15668 Aborted                 (core dumped) SASL_PATH="$(dirname $(realpath $0))" LD_LIBRARY_PATH="$(dirname $(realpath $0));$LD_LIBRARY_PATH" "$(dirname $0)/mailsync.bin" "$@"

This is what I get while I try to link an IMAP mail account. The error displayed is "An unexpected mailsync error occurred (134)View Log"

@vbotics It's clearly not the same bug, maybe you can create another issue ^^

Having similiar issues here with an Exchange server.

----------IMAP----------
* OK The Microsoft Exchange IMAP4 service is ready.
1 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
1 OK CAPABILITY completed.
2 LOGIN [<snip>] [<snip>]
2 OK LOGIN completed.
3 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
3 OK CAPABILITY completed.
4 NAMESPACE
* NAMESPACE (("" "/")) NIL NIL
4 OK NAMESPACE completed.
5 LIST "" "*"
* LIST (\HasNoChildren) "/" Agenda
* LIST (\HasNoChildren) "/" Archive
* LIST (\HasChildren) "/" Boxer
* LIST (\HasNoChildren) "/" Boxer/To-do
* LIST (\HasNoChildren) "/" Concepten
* LIST (\HasNoChildren) "/" Contactpersonen
* LIST (\HasNoChildren) "/" Drafts
* LIST (\HasNoChildren) "/" Journaal
* LIST (\HasNoChildren) "/" Junk
* LIST (\HasNoChildren) "/" Notities
* LIST (\HasNoChildren) "/" "Ongewenste e-mail"
* LIST (\Marked \HasNoChildren) "/" INBOX
* LIST (\HasNoChildren) "/" "Postvak UIT"
* LIST (\HasNoChildren) "/" "RSS Feeds"
* LIST (\HasNoChildren) "/" Sent
* LIST (\HasNoChildren) "/" Taken
* LIST (\Marked \HasNoChildren) "/" Trash
* LIST (\HasNoChildren) "/" "Verwijderde items"
* LIST (\HasNoChildren) "/" "Verzonden items"
5 OK LIST completed.


----------SMTP----------
220 [<snip>] Microsoft ESMTP MAIL Service ready at Wed, 7 Mar 2018 17:00:59 +0100
EHLO [<snip>]
250-[<snip>] Hello [<snip>]
250-SIZE 31457280
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-AUTH GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250 CHUNKING
STARTTLS
220 2.0.0 SMTP server ready
EHLO [<snip>]
250-[<snip>] Hello [<snip>]
250-SIZE 31457280
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH GSSAPI NTLM LOGIN
250-8BITMIME
250-BINARYMIME
250 CHUNKING

SMTP Last Response Code: 250

SMTP Last Response: [<snip>] Hello [<snip>]
SIZE 31457280
PIPELINING
DSN
ENHANCEDSTATUSCODES
AUTH GSSAPI NTLM LOGIN
8BITMIME
BINARYMIME
CHUNKING


mailsmtp Last Error Code: 17

mailsmtp Last Error Location: 10

Hi, same here:
```
----------SMTP----------
220 Microsoft ESMTP MAIL Service ready at Wed, 28 Mar 2018 12:44:38 +0300
EHLO
250- Hello []
250-SIZE 37748736
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-AUTH GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250 CHUNKING
STARTTLS
220 2.0.0 SMTP server ready
EHLO
250- Hello []
250-SIZE 37748736
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH GSSAPI NTLM LOGIN
250-8BITMIME
250-BINARYMIME
250 CHUNKING

SMTP Last Response Code: 250

SMTP Last Response: Hello []
SIZE 37748736
PIPELINING
DSN
ENHANCEDSTATUSCODES
AUTH GSSAPI NTLM LOGIN
8BITMIME
BINARYMIME
CHUNKING

mailsmtp Last Error Code: 17

mailsmtp Last Error Location: 10```

This is due that Mailspring has no Microsoft-Server-ActiveSync support, its not the same as SMTP.
I got the same problem with Exchange Server 2010 SP3

ActiveSync is uses normal HTTP POST queries to get sync and sendEmails

Example:

-----------------
 Log Entry: 10
-----------------

RequestTime : 
04/02/2018 20:36:58

ServerName : 
<REDACTED>

AssemblyVersion : 
14.03.0336.000

Identifier : 
<REDACTED>

RequestHeader : 
POST /Microsoft-Server-ActiveSync/default.eas?User=<REDACTED>&DeviceId=<REDACTED>&DeviceType=iPhone&Cmd=SendMail HTTP/1.1
Connection: keep-alive
Content-Length: <REDACTED>
Content-Type: application/vnd.ms-sync.wbxml
Accept: */*
Accept-Encoding: br, gzip, deflate
Accept-Language: nl-nl
Authorization: ********
Host: <REDACTED>
User-Agent: Apple-iPhone7C2/1505.216
MS-ASProtocolVersion: 14.1
X-MS-PolicyKey: <REDACTED>


RequestBody : 
<?xml version="1.0" encoding="utf-8" ?>
<SendMail xmlns="ComposeMail:">
    <ClientId><REDACTED></ClientId>
    <SaveInSentItems/>
    <Mime>Content-Type: text/plain;
    charset=us-ascii
Content-Transfer-Encoding: 7bit
From: <REDACTED>
Mime-Version: 1.0 (1.0)
Date: Mon, 2 Apr 2018 20:36:58 +0200
Message-Id: <REDACTED>
To: <REDACTED>

<REDACTED CONTENT>
</Mime>
</SendMail>

AccessState : 
Allowed

AccessStateReason : 
Global

ResponseHeader : 
HTTP/1.1 200 OK
MS-Server-ActiveSync: 14.3


ResponseBody : 
[No XmlResponse]

ResponseTime : 
04/02/2018 20:36:58

@TakeMeNL I'm pretty sure that's not the problem. I have IMAP/SMTP turned on for the Exchange account I'm trying to use, and other clients (Thunderbird, Geary, Newton) are able to connect to the IMAP/SMTP setup and both send and receive just fine.

Ah oki, Well I can’t enable or disable the imap/smtp in my exchange (they blocked it) so I have to work with this :P
Just thinking out loud to help, but I have the same results as you guys when I try the smtp connect.

Same issue for me. Are these the same issues as #471 #744 & #765 ?

I believe so, yes

Yes those are the same issue, all the have the Microsoft ESMTP

I am also hitting this issue on mailspring 1.2.1

----------IMAP----------
* OK The Microsoft Exchange IMAP4 service is ready.
1 STARTTLS
1 OK Begin TLS negotiation now.
2 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI UIDPLUS MOVE ID CHILDREN IDLE NAMESPACE LITERAL+
2 OK CAPABILITY completed.
3 LOGIN username *********
3 OK LOGIN completed.
4 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI UIDPLUS MOVE ID XPROXY3 CHILDREN IDLE NAMESPACE LITERAL+
4 OK CAPABILITY completed.
5 NAMESPACE
* NAMESPACE (("" "/")) NIL NIL
5 OK NAMESPACE completed.
6 LIST "" "*"
[REDACTED List of folders on mailaccount]
6 OK LIST completed.


----------SMTP----------
220 exch.domain.net Microsoft ESMTP MAIL Service ready at Sun, 29 Apr 2018 22:11:57 +0200
EHLO computername
250-exch.domain.net Hello [x.x.x.x]
250-SIZE 52428800
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-AUTH GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250 CHUNKING
STARTTLS
220 2.0.0 SMTP server ready
EHLO computername
250-exch.domain.net Hello [x.x.x.x]
250-SIZE 52428800
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH GSSAPI NTLM LOGIN
250-8BITMIME
250-BINARYMIME
250 CHUNKING

SMTP Last Response Code: 250

SMTP Last Response: exch.domain.net Hello [x.x.x.x]
SIZE 52428800
PIPELINING
DSN
ENHANCEDSTATUSCODES
AUTH GSSAPI NTLM LOGIN
8BITMIME
BINARYMIME
CHUNKING


mailsmtp Last Error Code: 17

mailsmtp Last Error Location: 10

The same connection settings work in evolution and Thunderbird, the email-server is Microsoft Exchange with IMAP enabled.

If I can help out by troubleshooting in some way, let me know.

Same issue even the SMTP server doesn't require AUTH.

----------SMTP----------
220 mail.xxx.com ESMTP
EHLO pc
250-mail.xxx.com
250-8BITMIME
250-SIZE 26214400
250 STARTTLS

SMTP Last Response Code: 250

SMTP Last Response: mail.xxx.com
8BITMIME
SIZE 26214400
STARTTLS

mailsmtp Last Error Code: 17

mailsmtp Last Error Location: 10

same issue here

Same issue here using MailSpring 1.2.1 on WIndows 10.x Enterprise to connect to Exchange/IMAP + an SMTP mail relay that works w/ Thunderbird. Thank you in advance for any assistance you might provide! :-)

Same issue here

Same issue on 1.2.2 for Mac. Please fix :(

Confirming this bug using version 1.2.2 on Windows 10. I use the same login information successfully for Mailbird on Windows, Geary on Linux, and K9 on Android.

Same issue from MacOS, with version 1.2.2 on an Exchange IMAP/SMTP setup (working with other mail clients like Spark).
My take on it is that the issue lies in the mailsync util, which is still private code.

Would be great to have at least some feedback from maintainers.

@bengotow @emorikawa Is anyone looking into this? Not sure if you're the right people to ping, just pinging because you're the top two contributers on this repo. This has been a bug for a while, and it's the only thing stopping me from using Mailspring exclusively :(

Just installed 1.3.3 and issue still exists.

----------IMAP----------
* OK The Microsoft Exchange IMAP4 service is ready.
1 STARTTLS
1 OK Begin TLS negotiation now.
2 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
2 OK CAPABILITY completed.
3 LOGIN "******" "*********"
3 OK LOGIN completed.
4 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
4 OK CAPABILITY completed.
5 NAMESPACE
* NAMESPACE (("" "/")) NIL NIL
5 OK NAMESPACE completed.
6 LIST "" "*"
* LIST (\HasChildren) "/" Archives
* LIST (\HasNoChildren) "/" Archives/2018
* LIST (\HasNoChildren) "/" Calendar
* LIST (\HasNoChildren) "/" Contacts
* LIST (\HasNoChildren) "/" "Deleted Items"
* LIST (\Marked \HasNoChildren) "/" Drafts
* LIST (\Marked \HasNoChildren) "/" INBOX
* LIST (\HasNoChildren) "/" "Infected Items"
* LIST (\HasNoChildren) "/" Journal
* LIST (\HasNoChildren) "/" "Junk E-Mail"
* LIST (\HasNoChildren) "/" Notes
* LIST (\HasNoChildren) "/" Outbox
* LIST (\HasNoChildren) "/" "RSS Feeds"
* LIST (\HasNoChildren) "/" Sent
* LIST (\HasNoChildren) "/" "Sent Items"
* LIST (\HasChildren) "/" "Sync Issues"
* LIST (\HasNoChildren) "/" "Sync Issues/Conflicts"
* LIST (\HasNoChildren) "/" "Sync Issues/Local Failures"
* LIST (\HasNoChildren) "/" "Sync Issues/Server Failures"
* LIST (\HasNoChildren) "/" Tasks
* LIST (\HasNoChildren) "/" TeamMates
* LIST (\Marked \HasNoChildren) "/" Trash
6 OK LIST completed.


----------SMTP----------
220 ***** Microsoft ESMTP MAIL Service ready at Wed, 18 Jul 2018 09:22:52 +0430
EHLO shadow
250-***** [*******]
250-SIZE 204800000
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-AUTH GSSAPI NTLM LOGIN
250-8BITMIME
250-BINARYMIME
250 CHUNKING
STARTTLS
220 2.0.0 SMTP server ready
EHLO ******
250-***** Hello [*******]
250-SIZE 204800000
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH GSSAPI NTLM LOGIN
250-8BITMIME
250-BINARYMIME
250 CHUNKING

SMTP Last Response Code: 250

SMTP Last Response: **** Hello [****]
SIZE 204800000
PIPELINING
DSN
ENHANCEDSTATUSCODES
AUTH GSSAPI NTLM LOGIN
8BITMIME
BINARYMIME
CHUNKING


mailsmtp Last Error Code: 17

mailsmtp Last Error Location: 10

Hey folks—just a heads up, this just got fixed today and a new version of the app will be out in a few days. Basically, when the available SMTP authentication options were limited (eg GSSAPI NTLM LOGIN), Mailspring was choosing the most secure/advanced option (GSSAPI), even though the app doesn't support configuring GSSAPI. This slipped through the cracks for a long time because in cases where other login methods are supported (like DIGEST_MD5) the app chooses those, and GSSAPI is only available on university / corporate networks where there's a single-sign on solution.

Sorry for the hassle—stay tuned! (Related to #341)

Great! Many thanks for the fix!

I still have this issue, for me it looks like it's CRAM-MD5 that's the problem though:

250-AUTH LOGIN CRAM-MD5 PLAIN
250-8BITMIME
250-ENHANCEDSTATUSCODES
250 SIZE
AUTH CRAM-MD5
334 *********************************
*********************************
535 5.7.8 Authentication failed

SMTP Last Response Code: 535

SMTP Last Response: 5.7.8 Authentication failed


mailsmtp Last Error Code: 17

mailsmtp Last Error Location: 10

mailsmtp Last Auth Type: 1

Edit: To be clear. This is with 1.4.0
Edit2: I have verified the challange that the server sends and it adheres to the format described in https://en.wikipedia.org/wiki/CRAM-MD5

@Pajn Same here... running the latest release 1.4.0 on Ubuntu 16.04.5 and still getting exactly the same error as with the previous version. Nylas Mail had no issues with the same account set-up.

Version 1.4.0 fixed the issue for me.

Hey folks—interesting, thanks for following up @Pajn. I'm looking in to the CRAM-MD5 auth method now. That method is still preferred over PLAIN, but it /should/ work. I've configured a handful of different mail servers now, so I should be able to create a setup with the same LOGIN options you've shown in that snippet and test it out. Stay tuned.

Latest version fixed that for me. Thanks.

1.4.2 works for me now 👍

Same here. Thanks a lot :+1: !

Was this page helpful?
0 / 5 - 0 ratings