#1397 accepted
Bill Cole

MM should try all available A records for servers

Reported by Bill Cole | February 4th, 2016 @ 04:33 AM

A basic form of server load balancing and functional clustering for high availability is to use multiple A records for a name, conventionally using short TTLs with resolvers rotating the order of records in answers with multiple records. The conventional behavior for a TCP client of any sort is to be prepared for a name to have multiple A records and if connection to one IP address for a name fails, to try the next one in the list of addresses provided by the DNS resolver. This is a conventional behavior that has been implemented in a broad range of tools for decades across most if not all platforms.

MailMate ignores that behavioral convention. For example: Rather than retrying SMTP connections that timeout with other valid IP addresses for the same SMTP server name, it repeatedly tries the same IP and if an IP actually rejects the connection, it doesn't retry at all. In either case, MM alerts the user to the failure. With IMAP the failure when one of multiple addresses does not work is worse: the account goes into "unavailable" mode, from which it seems nothing but a manual offline/online cycling will recover it.

Since there are many mail systems (including iCloud and GMail) that use round-robin DNS for load balancing and availability, it would be good for MM to support it.

Comments and changes to this ticket

  • benny

    benny February 11th, 2016 @ 01:28 PM

    • State changed from “new” to “accepted”

    MailMate currently use the BIO_ functions in openssl to make connections. I only specify a hostname which means I'm unsure how I could do something like what you describe.

    In any case, I have to switch to CFNetwork and maybe that'll make a difference. I'll keep this ticket open until that happens and then we can revisit the issue.

  • Bill Cole

    Bill Cole February 13th, 2016 @ 07:56 PM

    For what it's worth, curl built under MacPorts (i.e. using OpenSSL) does the right thing:

    $ curl -v -k https://webmail.cgptest.ignorethis.net
    * Rebuilt URL to: https://webmail.cgptest.ignorethis.net/
    *   Trying
    * Immediate connect fail for Host is down
    *   Trying
    * Connected to webmail.cgptest.ignorethis.net ( port 443 (\#0)

    So it is possible to do it using OpenSSL. I have not dug through the curl code to see how. It may just be that it does the name resolution on its own and uses the returned IPs for the BIO calls instead of having OpenSSL do the DNS.

  • benny

    benny February 14th, 2016 @ 10:26 AM

    Ok, I didn't know that. Don't spend time on it since CFNetwork is the only way forward for me.

  • benny

    benny April 23rd, 2018 @ 08:52 AM

    (Cleaning up old tickets.) Is this a problem after MailMate switched to CFNetwork?

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