# LAN SMTP 中继配置问题

**URL:** https://meta.discourse.org/t/lan-smtp-relay-configuration-issue/97473
**Category:** Self-hosting
**Created:** [2018年九月18日 17:02 UTC](https://meta.discourse.org/t/lan-smtp-relay-configuration-issue/97473 "2018-09-18T17:02:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Aleksey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aleksey/32/111367_2.png) [@Aleksey](https://meta.discourse.org/u/Aleksey)
#### Post date: [2018年九月18日 17:02 UTC](https://meta.discourse.org/t/lan-smtp-relay-configuration-issue/97473/1 "2018-09-18T17:02:24Z")

</div>

Hello,

I have installed the latest release on the latest release of Ubuntu (18.04)

As with many other people I have a problem configuring SMTP.  
We have a SMTP relay that runs in our network and Office 365 account that can be used, but I spent the last few days trying with no luck.

It appears that O365 does not support an authentication method supplied in Discourse, so I gave up on that.

When trying to configure the LAN relay, I found that the container (or perhaps the docker in general) [does not inherit the host DNS](https://development.robinwinslow.uk/2016/06/23/fix-docker-networking-dns/#the-permanent-system-wide-fix). I was getting errors that my local SMTP server was not found

```
tcpdump -i docker0 -n port 53

```

does show that 8.8.8.8 is being used, and all LAN addresses are invisible.

further efforts led me to create a /etc/docker/daemon.json with the following  
`{ "dns": ["192.168.1.33", "8.8.8.8"], }`

but once that file is created, the docker service does not start

I get exactly what is described in this topic - [https://stackoverflow.com/questions/45954460/docker-service-does-not-start-after-creating-daemon-json](https://stackoverflow.com/questions/45954460/docker-service-does-not-start-after-creating-daemon-json)

If anyone could assist me in resolving this issue, it would be much appreciated. We’d really like to use Discourse, but without SMTP, it’s pretty useless to us.

---

<div class="post-metadata">

### Author: ![Aleksey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aleksey/32/111367_2.png) [@Aleksey](https://meta.discourse.org/u/Aleksey)
#### Post date: [2018年九月18日 17:51 UTC](https://meta.discourse.org/t/lan-smtp-relay-configuration-issue/97473/2 "2018-09-18T17:51:39Z")

</div>

so far, we’ve given up and reconfigured to O365 and it suddenly worked… we’re at the point of making a few tweaks and not being sure what made it work… nevertheless - Office 365 config works with the following:

```
DISCOURSE_SMTP_ADDRESS: 'smtp.office365.com'
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: 'your.email@domain.com'
DISCOURSE_SMTP_PASSWORD: 'password'
DISCOURSE_SMTP_AUTHENTICATION: login
DISCOURSE_SMTP_ENABLE_START_TLS: true

```
