# Only offer smtp-auth over tls

**URL:** <https://forum.hestiacp.com/t/only-offer-smtp-auth-over-tls/2372>\
**Category:** Community Support\
**Created:** [December 21, 2020, 2:56pm UTC](https://forum.hestiacp.com/t/only-offer-smtp-auth-over-tls/2372 "2020-12-21T14:56:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stsimb](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/stsimb/32/1108_2.png) [@stsimb](https://forum.hestiacp.com/u/stsimb)\
**Post date:** [December 21, 2020, 2:56pm UTC](https://forum.hestiacp.com/t/only-offer-smtp-auth-over-tls/2372/1 "2020-12-21T14:56:41Z")

</div>

Hello everyone,

I have been running HestiaCP v1.3.2 on Debian 10.6.  
By default, exim offers the ability to use smtp authentication over port 25 unencrypted, i.e. the username/password combination of an email account are transmitted in plain text.

I would like to only offer the smtp-auth capability over TLS, not plain text.

To do this, I have modified /etc/exim/exim4.conf.template and added the following line  
auth\_advertise\_hosts = ${if eq{$tls\_cipher}{}{}{\*}}

Is this something that other people would also like and find useful?  
Could HestiaCP configure this out of the box?

Thanks,  
Sot.

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [December 21, 2020, 3:19pm UTC](https://forum.hestiacp.com/t/only-offer-smtp-auth-over-tls/2372/2 "2020-12-21T15:19:37Z")

</div>

We support TLS out of the box by default

---

<div class="post-metadata">

**Author:** ![stsimb](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/stsimb/32/1108_2.png) [@stsimb](https://forum.hestiacp.com/u/stsimb)\
**Post date:** [December 21, 2020, 3:38pm UTC](https://forum.hestiacp.com/t/only-offer-smtp-auth-over-tls/2372/3 "2020-12-21T15:38:21Z")

</div>

Thank you very much for your reply.

Of course you support TLS out of the box, but you don’t make sure that credentials can _only_ be transmitted over TLS, they can _also_ be transmitted over plain text.

> stsimb@tesla4:~$ telnet [mail.hestiacp.com](http://mail.hestiacp.com) 25  
> Trying 116.203.78.202…  
> Connected to mail hestiacp com.  
> Escape character is ‘^]’.  
> 220 web02 hestiacp com  
> ehlo test  
> 250-web02 hestiacp com Hello  
> 250-SIZE 52428800  
> 250-8BITMIME  
> 250-PIPELINING  
> **250-AUTH PLAIN LOGIN**  
> 250-CHUNKING  
> 250-STARTTLS  
> 250 HELP  
> quit  
> 221 web02 hestiacp com closing connection  
> Connection closed by foreign host.

By adding the line I mentioned above in exim4.conf.template, the SMTP AUTH capability will only be available over TLS (i.e. client must use STARTTLS or connect to port 465), which is encrypted.

The behaviour I want is  
No AUTH capability offered on port 25 by default

> stsimb@tesla4:~$ telnet potato.irc.gr 25  
> Trying 95.111.231.144…  
> Connected to potato.irc.gr.  
> Escape character is ‘^]’.  
> 220 potato.irc.gr  
> ehlo test  
> 250-potato.irc.gr Hello  
> 250-SIZE 52428800  
> 250-8BITMIME  
> 250-PIPELINING  
> 250-CHUNKING  
> 250-STARTTLS  
> 250 HELP

but only available if I use STARTTLS

> ## stsimb@tesla4:~$ openssl s\_client -starttls smtp potato.irc.gr:25 CONNECTED(00000005) …
> 
> 250 HELP  
> ehlo test  
> 250-potato.irc.gr Hello  
> 250-SIZE 52428800  
> 250-8BITMIME  
> 250-PIPELINING  
> 250- **AUTH PLAIN LOGIN**  
> 250-CHUNKING  
> 250 HELP  
> quit

or is I connect on port 465

> stsimb@tesla4:~$ openssl s\_client -connect potato.irc.gr:465  
> CONNECTED(00000005)  
> …  
> 220 potato.irc.gr  
> ehlo test  
> 250-potato.irc.gr Hello  
> 250-SIZE 52428800  
> 250-8BITMIME  
> 250-PIPELINING  
> 250- **AUTH PLAIN LOGIN**  
> 250-CHUNKING  
> 250 HELP  
> quit

---

<div class="post-metadata">

**Author:** ![Raphael](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/raphael/32/5217_2.png) [@Raphael](https://forum.hestiacp.com/u/Raphael)\
**Post date:** [December 21, 2020, 4:10pm UTC](https://forum.hestiacp.com/t/only-offer-smtp-auth-over-tls/2372/4 "2020-12-21T16:10:57Z")

</div>

You’ll need to adjust your exim conf, probaly something like this could help: [https://serverfault.com/questions/780125/how-to-force-starttls-in-exim](https://serverfault.com/questions/780125/how-to-force-starttls-in-exim)

---

<div class="post-metadata">

**Author:** ![stsimb](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/stsimb/32/1108_2.png) [@stsimb](https://forum.hestiacp.com/u/stsimb)\
**Post date:** [December 21, 2020, 4:13pm UTC](https://forum.hestiacp.com/t/only-offer-smtp-auth-over-tls/2372/5 "2020-12-21T16:13:37Z")

</div>

Thank you very much for your answer.

Indeed, this is what I did and it works.

The question was if HestiaCP would like to do the same out-of-the box, i.e. don’t transmit credentials over plain text but only over TLS.

It’s the equivalent of what HestiaCP already does for pop3/imap, but for smtp.

> root@potato:~# head -1 /etc/dovecot/conf.d/10-auth.conf  
> disable\_plaintext\_auth = yes

Enabling this would break some very old smtp clients, e.g. microsoft outlook 2007 without service pack 3.
