Does this screen look familiar?

If you’re constantly having to click “Always trust XXX when connecting to XXX” when using Mail with SSL on, your solution may be a few clicks away.
In the above image, notice that it says “Always trust “smtp.gmail.com” when connecting to “imap.gmail.com”.” The problem here is that Leopard won’t ever trust a certificate (even after clicking the check box) when the server you entered in your account details doesn’t match the server name the certificate is using.

Here’s another slightly more complicated example…
I have several e-mail accounts hosted on “grid servers” from MediaTemple. You may use a different hosting company (i.e. Go Daddy, Yahoo!, Google, HostMonster) for your personal domains, but most don’t include SSL certificates that match your domain (or they cost extra). Since Mail won’t accept SSL certificates that don’t match your mail server, you may see something like this:

As you can see, the server entered in my Mail account settings is “mail.briancometa.com” but the certificate is for “*.gridserver.com.”
Unlike the first example, I can’t simply replace “mail.briancometa.com” with “*.gridserver.com” in my account settings (that’s not a legit mail server address).
In this case, I had to log into the Media Temple hosting panel to find out what grid server “briancometa.com” was hosted on. I knew to look for something ending in “gridserver.com” and after a little searching found that briancometa.com is, in fact, s6895.gridserver.com.
Back in Mail, I replaced both instances of “mail.briancometa.com” in my account settings with “s6895.gridserver.com.” I immediately quit and re-opened mail, re-entered passwords after checking for new mail, and re-entered passwords after sending messages from each account. If the Verify Certificate box pops up again, this should be the last time, make sure to click the “Always trust” checkbox.
NO MORE SSL ISSUES!! And, mail seems to run a bit faster — at least during startup.
—
Did this work for you too? Leave a comment and let us know.