Apple mail checks wrong certificate

Yesterday, together with my collegue, we installed an SSL certificate for the submission part of a mail install. For the simple reason “Plesk 9 is a pile of shit”, we run Postfix on port 25 and Qmail on 587.

We assembled the private key and the certificate, and installed it as servercert.pem in /var/qmail/control/, and then symlinked clientcert.pem to this file. Another job well done, we thought. I opened the preferences for my mailclient (Apple’s Mail.app), opened my preferences, and configured a new outgoing server. Once there, in the advanced tab, I entered 587 as port number, and checked the TLS usage. Instantly, I was greeted with a warning sign about the certificate being invalid (it returned the old certificate).

Mail.app warning

After having checked that qmail completely restarted, and that the certificate itself is indeed the correct one, we were puzzled. But when we resorted to checking this with the trustworthy “openssl” tool (the command you need is “openssl s_client -starttls smtp -crlf -connect hostname.tld:port”), we saw that the certificate presented to us on port 25 was the old one, and the one on 587 was the correct one. This is normal behavior, the postfix install was still as it was, as port 25 wasn’t allowed to accept any authentication for mail submission, but the TLS config was still in. We disabled the tls part in postfix, and then, when adding the correct info in

Conclusion: apple mail will try to get the certificate from port 25, then port 486 and then port 587, even if you choose to specify your own portnumber in the configuration. Strange decision they made, those apple developers.

3 Responses to “Apple mail checks wrong certificate”

  1. Steven Says:

    An question for you…

    Why using Postfix for SMTP and Qmail als submission-agent? Redundancy (if Posftix fails for some reason, Qmail keeps the mail in queue)?

    Steven

  2. blonko Says:

    The postfix solution of Plesk doesn’t handle mail delivery correct, and the Qmail solution doesn’t spamscan incoming mails for aliases. So we placed postfix before qmail, to scan the mails, and let qmail do all the other work.

    If plesk 9 wouldn’t give so much trouble with its mail, all of this would be a lot easier :)

  3. dries Says:

    I see some familiar things :)