# Setting up SMTP

**URL:** https://meta.discourse.org/t/setting-up-smtp/33885
**Category:** Support
**Created:** [29. September 2015 um 20:51 UTC](https://meta.discourse.org/t/setting-up-smtp/33885 "2015-09-29T20:51:35Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Mechanatrix](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@Mechanatrix](https://meta.discourse.org/u/Mechanatrix)
#### Post date: [29. September 2015 um 20:51 UTC](https://meta.discourse.org/t/setting-up-smtp/33885/1 "2015-09-29T20:51:35Z")

</div>

Hello people of discourse 😃

I’ve been trying for a while to get my SMTP routing working, and now I’m getting an interesting issue when I check mailgun send logs. It finally goes through, but it tries to send to what appears to be a redundant email. This is the send log.

```
{
  "severity": "permanent",
  "tags": [],
  "delivery-status": {
    "retry-seconds": 14400,
    "message": "Unable to connect to MX servers: [example.com]",
    "code": 499,
    "description": "Unable to connect to MX servers: [example.com]",
    "session-seconds": 0
  },
  "envelope": {
    "targets": "bar@example.com",
    "transport": "smtp",
    "sender": "postmaster@mg.mechanatrix.com"
  },
  "recipient-domain": "example.com",
  "id": "it was a random string..but i figure security",
  "campaigns": [],
  "reason": "old",
  "user-variables": {},
  "flags": {
    "is-routed": null,
    "is-authenticated": true,
    "is-system-test": false,
    "is-test-mode": false
  },
  "log-level": "error",
  "timestamp": 1443525153.274898,
  "message": {
    "headers": {
      "to": "myuser@gmail.com, bar@example.com",
      "message-id": "20150928231513.16585.98440@mg.mechanatrix.com",
      "from": "Excited User <mailgun@discourse.mechanatrix.com>",
      "subject": "Hello"
    },
    "attachments": [],
    "recipients": [
      "myuser@gmail.com",
      "bar@example.com"
    ],
    "size": 549
  },
  "recipient": "bar@example.com",
  "event": "failed"
} 

```

\*I’ve replaced my email with [myuser@gmail.com](mailto:myuser@gmail.com)  
as you can see, its sending to [bar@example.com](mailto:bar@example.com)

This is whats in my app.yml

```
DISCOURSE_DEVELOPER_EMAILS: 'myuser@gmail.com'

## TODO: The domain name this Discourse instance will respond to
DISCOURSE_HOSTNAME: 'discourse.mechanatrix.com'

## TODO: The mailserver this Discourse instance will use
DISCOURSE_SMTP_ADDRESS: smtp.mailgun.com # (mandatory)
DISCOURSE_SMTP_PORT: 465 # (optional)
DISCOURSE_SMTP_USER_NAME: myuser@gmail.com # (optional)
DISCOURSE_SMTP_PASSWORD: myPassword # (optional, WARNING the c$
#DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)

```

Sorry everyone for the pretty newb question 😋

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [30. September 2015 um 07:17 UTC](https://meta.discourse.org/t/setting-up-smtp/33885/2 "2015-09-30T07:17:21Z")

</div>

Did you rebuild the container after changing your e-mail address in `app.yml`? A quick `./launcher rebuild app` should do the trick.

---

<div class="post-metadata">

### Author: ![Mechanatrix](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@Mechanatrix](https://meta.discourse.org/u/Mechanatrix)
#### Post date: [30. September 2015 um 10:30 UTC](https://meta.discourse.org/t/setting-up-smtp/33885/3 "2015-09-30T10:30:39Z")

</div>

yep. I have a different error now though, that comes from sidekiq logs.

 ![](https://global.discourse-cdn.com/meta/original/3X/e/f/ef2420dd3797be43630fea59fb1a9f1f948724e4.png)

Any Idea what this might mean?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [30. September 2015 um 10:59 UTC](https://meta.discourse.org/t/setting-up-smtp/33885/4 "2015-09-30T10:59:12Z")

</div>

The `SSLError` means that mailgun needs to lrn2ssl – the connection to `smtp.mailgun.com` is presenting a certificate for `*.mailgun.org`, which isn’t the same thing at all. The `ReadTimeout` errors seem more like network problems; likely a flaky connection.

---

<div class="post-metadata">

### Author: ![Mechanatrix](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@Mechanatrix](https://meta.discourse.org/u/Mechanatrix)
#### Post date: [30. September 2015 um 23:08 UTC](https://meta.discourse.org/t/setting-up-smtp/33885/5 "2015-09-30T23:08:50Z")

</div>

it looks like mailgun has dropped ssl from their pop3 protocol due to POODLE vulnerability. (Don’t know what that is exactly…) Is there a way to disable SSL to avoid moving to another mail server, or is this something that’s required? Again, sorry for the complete newbness 😋

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [30. September 2015 um 23:13 UTC](https://meta.discourse.org/t/setting-up-smtp/33885/6 "2015-09-30T23:13:20Z")

</div>

If you want to disable TLS, you need to uncomment this line, and set it to `false`:

```
#DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)

```

However, there’s no relationship between POODLE and newer TLS protocol versions, nor is there any relationship between SMTP and POP3. Mailgun _does_ support TLS on SMTP connections, they just don’t support it correctly.

---

<div class="post-metadata">

### Author: ![Mechanatrix](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@Mechanatrix](https://meta.discourse.org/u/Mechanatrix)
#### Post date: [6. Oktober 2015 um 21:45 UTC](https://meta.discourse.org/t/setting-up-smtp/33885/7 "2015-10-06T21:45:02Z")

</div>

Thank you so much for the help! I ended up migrating to mandrill for the sake of simplicity though. Emails went through after updating the SMTP address server side. Parts working together is a beautiful thing! 😋

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [8. Juni 2024 um 12:46 UTC](https://meta.discourse.org/t/setting-up-smtp/33885/8 "2024-06-08T12:46:04Z")

</div>

Dieses Thema wurde nach 3174 Tagen automatisch geschlossen. Neue Antworten sind nicht mehr möglich.
