#651 ✓fixreleased
Patrick

Problem connecting to gmail over SSL in os x 10.9.2

Reported by Patrick | February 25th, 2014 @ 09:10 PM

After the recent update security(ssl handling), the connection fails to get mail.

Clearing connection to imap.gmail.com
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 993
Successful connection on socket 11.
Initiating secure connection...
Error: Failed SSL handshake.
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 143
Error: Time limit (15s) reached while trying to write data (imap.gmail.com)
Error: Failed while trying to connect to “imap.gmail.com” on socket 11.
Clearing connection to imap.gmail.com
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 993
Successful connection on socket 11.
Initiating secure connection...
Error: Failed SSL handshake.
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 143
Error: Time limit (30s) reached while trying to write data (imap.gmail.com)
Error: Failed while trying to connect to “imap.gmail.com” on socket 11.
Clearing connection to imap.gmail.com
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 993
Successful connection on socket 11.
Initiating secure connection...
Error: Failed SSL handshake.
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 143
Error: Time limit (60s) reached while trying to write data (imap.gmail.com)
Error: Failed while trying to connect to “imap.gmail.com” on socket 11.
Clearing connection to imap.gmail.com
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 993
Successful connection on socket 11.
Initiating secure connection...
Error: Failed SSL handshake.
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 143
Error: Failed connecting to host (imap.gmail.com:143).
    “error:0200203C:system library:connect:Operation timed out”
    “error:2007306E:BIO routines:CONN_STATE:nbio connect error”

Comments and changes to this ticket

  • benny

    benny February 26th, 2014 @ 10:03 AM

    Does this problem persist? I don't seem to have any problems connecting my Gmail accounts?

    Are you on a slow network?

    You can hardcode the settings to use port 993 since Gmail does not support port 143 (although that is the recommended IMAP port). That'll focus MailMate on retrying on port 993.

  • benny

    benny February 27th, 2014 @ 08:12 PM

    I fully understand the frustration. I'll do what I can to help.

    You wouldn't happen to be located in Dallas? I have another user who had a weird problem cause by a Verizon issue described here.

  • benny

    benny February 27th, 2014 @ 09:47 PM

    When this happens then what is the result of running the following in the Terminal:

    openssl s_client -crlf -connect imap.gmail.com:993
    

    Just to make sure that it's only MailMate which cannot connect.

  • benny

    benny March 3rd, 2014 @ 09:03 AM

    Thanks for the openssl output. It's a tricky problem since I cannot reproduce it (I have a couple of Gmail accounts online).

    When this happens does it then always work when you restart MailMate?

    If you get another log in Activity Viewer leading up to this then you are very welcome to share it. I might spot something non-obvious (or get an idea of what I could add to find out more about the problem).

  • benny

    benny March 10th, 2014 @ 01:32 PM

    Hold down ⌥ when clicking “Check Now” to fetch the latest test version. I've tried changing some things and adding a bit more debug output. As before, keep the Activity Viewer open and provide the final lines of the logs as you did before.

    Thanks in advance!

  • benny

    benny March 11th, 2014 @ 09:19 AM

    @Patrick: Thanks, this output looks as expected. It doesn't explain why the SSL handshakes fail, but for now I'll assume this is a server issue and threat it as gracefully as possible. Note to myself: I really should add some time stamps to those logs :-)

  • benny

    benny March 12th, 2014 @ 09:27 AM

    @Stuart: So for you it never clears up, but if you restart MailMate then it works again?

  • benny

    benny March 17th, 2014 @ 02:04 PM

    Sorry about the late reply. Once again, I suggest fetching the latest test version. I haven't really looked into this particular problem, but the SSL handshake might include a more verbose error message now. Also, I've done some work on IMAP timeout values although I doubt this has any effect on this issue.

    Thanks for the feedback!

  • benny

    benny March 18th, 2014 @ 12:58 PM

    Yet another test version in a few minutes. I still have no idea what the problem is. I did fix a (presumably) unrelated problem.

    Enable some additional (chaotic) output like this:

    defaults write com.freron.MailMate MmDebugSSLHandshake -bool YES
    

    Maybe it'll provide the hint I need to make progress on this issue.

  • benny

    benny March 19th, 2014 @ 12:40 PM

    Thanks to both of you. Based on the output, I think it's pretty clear that you are having the same issue. As far as I can see the output from Patrick shows that the connection succeeds when retried, but the first error is identical to the repeated error in the output from Stuart.

    I'm running out of ideas and it's hard to debug when I cannot reproduce the issue myself, but I appreciate your patience.

    One quick attempt is to ignore the error reported and keep retrying for 15 seconds. This is done with this test version when MmDebugSSLHandshake is enabled. I don't really think it'll work, but it's worth a shot.

  • benny

    benny March 19th, 2014 @ 01:31 PM

    Here is another test version to try, but I would still like to know if the previous one made any difference.

    For this one you should enable this debug variable:

    defaults write com.freron.MailMate MmSkipSSLHandshake -bool YES
    

    (It doesn't really mean that the handshake is skipped. It means that it is postponed until it is needed.)

    Thanks in advance.

  • benny

    benny March 20th, 2014 @ 01:06 PM

    @Stuart: Is this with or without the MmSkipSSLHandshake?

    (Unfortunately, I don't really like the MmSkipSSLHandshake fix since it doesn't really tell me anything about what the problem is.)

  • benny

    benny March 21st, 2014 @ 10:00 AM

    Another test version is available. I would like you to try out these settings:

    defaults write com.freron.MailMate MmSkipSSLHandshake -bool NO
    defaults write com.freron.MailMate MmUseDirectSSLHandshake -bool YES
    

    As noted I don't like MmSkipSSLHandshake and I seem to have problems when waking my machine from sleep (I don't know for sure that this is a related issue). With MmUseDirectSSLHandshake I'm using a slightly different API to make the handshake.

    Sorry about all the test versions, but it's necessary as long as I cannot reproduce the issue myself.

  • benny

    benny June 8th, 2014 @ 06:20 PM

    @Erno: Did it fix the issue?

  • benny

    benny July 10th, 2014 @ 12:42 PM

    • State changed from “new” to “fixcommitted”

    @John: Thanks for the feedback. I've changed the default behavior and I suspect it would have worked without changing the settings. I'll change the ticket state.

  • benny

    benny October 15th, 2014 @ 03:32 PM

    • State changed from “fixcommitted” to “fixreleased”
  • benny

    benny December 21st, 2014 @ 09:48 AM

    So you can connect via openssl, but MailMate cannot connect to the server? Do you have some output/error from MailMate as well?

  • benny

    benny December 21st, 2014 @ 07:50 PM

    The log is from IMAP (port 993), but the reported problem is for SMTP on port 465. Port 465 is non-standard and not all servers behave the same on this port. MailMate currently has a problem with that, but you can force MailMate to work (I believe) by entering 465s instead of just 465 in the settings window.

  • benny

    benny December 21st, 2014 @ 08:45 PM

    Ok, 587 is much better. You should use that, but I don't know why the server is rejecting the email address. That seems to be a server issue and not a MailMate issue?

  • benny

    benny December 22nd, 2014 @ 09:32 AM

    @Des: I've updated your comments to exclude domains/addresses.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Mac OS X email client.

Shared Ticket Bins

People watching this ticket

Attachments

Referenced by

Pages