# Connecting to a SMTP server on localhost:25 without auth?

**URL:** https://meta.discourse.org/t/connecting-to-a-smtp-server-on-localhost-25-without-auth/156849
**Category:** Self-hosting
**Tags:** email
**Created:** [November 7, 2019, 1:32pm UTC](https://meta.discourse.org/t/connecting-to-a-smtp-server-on-localhost-25-without-auth/156849 "2019-11-07T13:32:21Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![rrit](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@rrit](https://meta.discourse.org/u/rrit)
#### Post date: [February 12, 2022, 9:53pm UTC](https://meta.discourse.org/t/connecting-to-a-smtp-server-on-localhost-25-without-auth/156849/13 "2022-02-12T21:53:39Z")

</div>

I’m glad you got your mail setup running!

There are some updates on the email troubleshooting guide since yesterday. If you’re still not happy with your mail setup, maybe give it a try again!

> [@Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326):
>
> You just installed Discourse via [the install guide](https://github.com/discourse/discourse/blob/main/docs/INSTALL.md), but email doesn’t seem to work. Unfortunately this means you can’t log in as an admin to finalize the install. cry Let’s troubleshootize! Try the doctor woman_health_workerIf you run ./discourse-doctor it will check several ways that your mail configuration might be broken, and offer advice. Try that first. Did you enter email settings correctly? The simplest way is to run ./discourse-setup again. Did you enter everything correctly? B…

* * *

> [@Jeremiah\_van\_Oosten](#):
>
> If I use the Docker host IP address (172.17.0.1), I get
> 
> `hostname "172.17.0.1" does not match the server certificate`

> [@Jeremiah\_van\_Oosten](#):
>
> In the end, I accept the fact that I **cannot** use TLS to communicate with SMTP running on the docker host (without getting certificates using a different hostname)

Can be solved by using:

> [@Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326/1):
>
> `DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none`

* * *

> [@Jeremiah\_van\_Oosten](#):
>
> So any attempt to use the same hostname for the running container and the docker host will cause all requests issued from the container to go to the container itself and not the docker host.
> 
> What a fiasco!

… just default DNS resolving of domain name to IP.

> [@Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326/1):
>
> ### 2. Check dns resolving for your smtp server name via `getent hosts` :
> 
> ( `dig` , `nslookup` , `ping` etc. are not installed inside the container.)
> 
> `getent hosts your.smtp.server`

---

_[View the full topic](https://meta.discourse.org/t/connecting-to-a-smtp-server-on-localhost-25-without-auth/156849)._
