# Current Mailgun API key does not work

**URL:** https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661
**Category:** Bug
**Created:** [1 augustus 2018 om 16:09 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661 "2018-08-01T16:09:49Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![oxxi](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@oxxi](https://meta.discourse.org/u/oxxi)
#### Post date: [1 augustus 2018 om 16:09 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/1 "2018-08-01T16:09:50Z")

</div>

It appears that Discourse has hard-coded a regex check for the Mailgun API key. Mailgun’s API keys have undergone a format change to prevent spammers from scrapping publicly accessible repositories for Mailgun API keys. The regex check would need to be addressed to allow API keys that do not match the old naming convention or remove the restriction on the discourse instance locally.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [1 augustus 2018 om 16:20 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/2 "2018-08-01T16:20:48Z")

</div>

This was discussed a few weeks ago! @techAPJ this was fixed at that time right?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [1 augustus 2018 om 16:49 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/3 "2018-08-01T16:49:35Z")

</div>

Can you link to the announcement so that we can check the new format?

---

<div class="post-metadata">

### Author: ![oxxi](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@oxxi](https://meta.discourse.org/u/oxxi)
#### Post date: [1 augustus 2018 om 16:57 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/4 "2018-08-01T16:57:50Z")

</div>

I’m not sure if there’s been an announcement from Mailgun but this is what they told me in an email yesterday. The format is like this but not sure if that helps.

```plaintext
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxx-xxxxxxxx
```

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [1 augustus 2018 om 16:58 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/5 "2018-08-01T16:58:57Z")

</div>

Is `x` a hexadecimal value?

---

<div class="post-metadata">

### Author: ![oxxi](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@oxxi](https://meta.discourse.org/u/oxxi)
#### Post date: [1 augustus 2018 om 17:02 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/6 "2018-08-01T17:02:30Z")

</div>

Obviously this is not my key but it’s like this:

325e2234f7d193364423712e74142145-1b7bf5f1-2167af0b

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [1 augustus 2018 om 17:05 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/7 "2018-08-01T17:05:10Z")

</div>

It’s now fixed 🍓

[https://github.com/discourse/discourse/commit/474a01f33803638cd1c4242da81f57ffdd601790](https://github.com/discourse/discourse/commit/474a01f33803638cd1c4242da81f57ffdd601790)

---

<div class="post-metadata">

### Author: ![oxxi](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@oxxi](https://meta.discourse.org/u/oxxi)
#### Post date: [1 augustus 2018 om 17:06 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/8 "2018-08-01T17:06:59Z")

</div>

Cool. Is it possible to update my current instance of Discourse with this fix? Or do I just edit that file and then do `./launcher rebuild app` ?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [1 augustus 2018 om 17:19 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/9 "2018-08-01T17:19:46Z")

</div>

Wait for the build to finish (a few minutes) and then you’ll be able to `rebuild` to get the fix.

---

<div class="post-metadata">

### Author: ![oxxi](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@oxxi](https://meta.discourse.org/u/oxxi)
#### Post date: [1 augustus 2018 om 17:44 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/10 "2018-08-01T17:44:31Z")

</div>

From reading some docs I would just do the following, right? (sorry, first time updating like this) Also I’m on v2.1.0.beta3 +64 if that makes any difference:

```plaintext
    cd /var/discourse
    git pull
   ./launcher rebuild app
```

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [1 augustus 2018 om 17:46 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/11 "2018-08-01T17:46:27Z")

</div>

No worries. Yup, just that.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2 augustus 2018 om 16:00 UTC](https://meta.discourse.org/t/current-mailgun-api-key-does-not-work/93661/12 "2018-08-02T16:00:09Z")

</div>

This topic was automatically closed after 22 hours. New replies are no longer allowed.
