Basically the same question as Sendmail Configuration SMTP Relay Port 465, however, the answer there is "I have abandoned the idea of using my host as a sendmail relay and moved over to using Gmail".

However, I'm going to give it another try, so here is the situation.

  • My mail server accepts SMTPS, (SMTP over SSL to port 465). So SMTPS configuration is the way I need, not STARTTLS, as
  • STARTTLS starts the connection on port 25, then turns unencrypted connection into encrypted one.
  • However, accessing port 25 to my mail server is blocked, to the reason you know, hence SMTPS only


Here are different ways to do it, according to what I find from the Internet. However, I don't know which one to believe.

https://fedoraproject.org/wiki/Configure_sendmail_as_a_client_for_SMTPs says (on Aug 3, 2016),

Setting up SMTPS is fairly easy to do using a client like Evolution, however, it is not quite as straightforward to configure sendmail to do the job... When researching this topic I found a number of helpful sources on the internet. One of the problems though is that they didn't have all the pieces or something was a little off...
The initial step to setting up the SSL connection on port 465 is to configure and run stunnel. Stunnel provides a socket wrapper for ordinary programs to use SSL.

I.e., it says to use stunnel. However, https://www.cyberciti.biz/faq/howto-configure-sendmail-ssl-certificate-email/ says (on Dec 4, 2006),

Sendmail can be configured to encrypt email via the secure socket layer (SSL) when you want to send and receives emails.
Open sendmail configuration file /etc/mail/sendmail.mc...append/modify following directives:


and in https://groups.google.com/forum/#!topic/comp.mail.sendmail/Gy6QBfMd3l4 it says (on Oct 31, 2006)

Sendmail doesn't do client-side SMTPS...
You don't really need any certs for client-side setup - i.e. there is no config that needs to be done for client-side STARTTLS.


So you can see that, there is quite some controversies over how to do it, according to what I find from the Internet.

Maybe because by the time when it is said, the option is not available, or maybe by the time when it is said, the author didn't know other options, etc, etc. Thus,

All in all, how to do client-side SMTPS with sendmail as of year 2018? I.e.,



I have abandoned the idea of using sendmail as the client to SSL Port 465 (SMTPS), but use msmtp, because I've found an article that introduce msmtp extremely clearly, very easy to follow, and painless to make it working:

Msmtp: A simple mail transfer agent

However, if anyone'd like to answer for sendmail, I'd love to change my answer-choice to yours.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.