# Failed to POST the e-mail (301 error)

**URL:** https://meta.discourse.org/t/failed-to-post-the-e-mail-301-error/146613
**Category:** Support
**Created:** [April 2, 2020, 7:25pm UTC](https://meta.discourse.org/t/failed-to-post-the-e-mail-301-error/146613 "2020-04-02T19:25:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![TomWFox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tomwfox/32/139103_2.png) [@TomWFox](https://meta.discourse.org/u/TomWFox)
#### Post date: [April 2, 2020, 7:25pm UTC](https://meta.discourse.org/t/failed-to-post-the-e-mail-301-error/146613/1 "2020-04-02T19:25:12Z")

</div>

Hi,

I’m having an issue setting up reply by email after following [this guide](https://meta.discourse.org/t/straightforward-direct-delivery-incoming-mail/49487). I’ve followed the troubleshooting suggestions and found that the email are stuck in the queue and there are errors in the mail receiver logs…

`Failed to POST the e-mail to http://community.parseplatform.org/admin/email/handle_mail: 301`

Apologies if this is a duplicate but I couldn’t find a topic with the same issue.

---

<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: [April 2, 2020, 8:28pm UTC](https://meta.discourse.org/t/failed-to-post-the-e-mail-301-error/146613/2 "2020-04-02T20:28:01Z")

</div>

Error is very simple to fix  
You need to use the link with https in the yml configuration for the mail receiver

301 at the end of error is correct as the http link is being 301 redirected to https causing the `POST` to not get the correct 200 response.

---

<div class="post-metadata">

### Author: ![TomWFox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tomwfox/32/139103_2.png) [@TomWFox](https://meta.discourse.org/u/TomWFox)
#### Post date: [April 3, 2020, 9:55am UTC](https://meta.discourse.org/t/failed-to-post-the-e-mail-301-error/146613/3 "2020-04-03T09:55:43Z")

</div>

Thanks, simple fix indeed! Perhaps the mail receiver template should be updated - everyone is running discourse with https, right?

It didn’t occur to me that this was a standard HTTP response code 🤦‍♂️

Although off topic, I must say that Discourse is a wonderful piece of software, I’ve had a few issues getting setup, but given its underlying complexity and my lack of experience with this it has been remarkably easy!

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [April 13, 2020, 10:21am UTC](https://meta.discourse.org/t/failed-to-post-the-e-mail-301-error/146613/4 "2020-04-13T10:21:43Z")

</div>

I have the same problem, tried to modify the URL to https (and rebuild app) but still having that problem:

```
<22>Apr 13 10:18:10 postfix/smtpd[323]: connect from mail-vs1-f50.google.com[209.85.217.50]
<22>Apr 13 10:18:11 postfix/smtpd[323]: 403AF81D15: client=mail-vs1-f50.google.com[209.85.217.50]
<22>Apr 13 10:18:11 postfix/cleanup[329]: 403AF81D15: message-id=<XXXXXXXXX@mail.gmail.com>
<22>Apr 13 10:18:11 postfix/qmgr[80]: 403AF81D15: from=<XXXXXXXXX@gmail.com>, size=2555, nrcpt=1 (queue active)
<22>Apr 13 10:18:11 postfix/smtpd[323]: disconnect from mail-vs1-f50.google.com[209.85.217.50] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
<23>Apr 13 10:18:11 receive-mail[331]: Recipient: testing@mydomain.com
<19>Apr 13 10:18:11 receive-mail[331]: Failed to POST the e-mail to http://forum.mydomain.com/admin/email/handle_mail: 301
<22>Apr 13 10:18:11 postfix/pipe[330]: 403AF81D15: to=<testing@mydomain.com.ar>, relay=discourse, delay=0.72, delays=0.55/0.01/0/0.16, dsn=4.3.0, status=deferred (temporary failure)

```

Maybe I need to enable SSL options in e-mail template? My discourse it’s behind a global nginx instance (I see port 25 exposed in mail-reciever.template).

Thanks for your time, as always.

---

<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: [April 13, 2020, 10:28am UTC](https://meta.discourse.org/t/failed-to-post-the-e-mail-301-error/146613/5 "2020-04-13T10:28:32Z")

</div>

> [@satonotdead](#):
>
> Failed to POST the e-mail to [http://forum.mydomain.com/admin/email/handle\_mail:](http://forum.mydomain.com/admin/email/handle_mail:) 301

Here is Your problem.  
Edit mail-receiver.yml to use `https://forum.mydomain.com` and it should work.

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [April 13, 2020, 10:33am UTC](https://meta.discourse.org/t/failed-to-post-the-e-mail-301-error/146613/6 "2020-04-13T10:33:32Z")

</div>

I tried to add http **s** as you stated before but **rebuild mail-receiver** is needed (not global app 😅).

Every day I learn something new about Linux, Docker, Discourse.

Guys you’re the best community that I seen in a very long time. Thanks again!

---

<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: [April 13, 2020, 10:35am UTC](https://meta.discourse.org/t/failed-to-post-the-e-mail-301-error/146613/7 "2020-04-13T10:35:29Z")

</div>

That’s generally a given that if we’re making changes to the yml we must rebuild the relevant container.

Glad that you could figure it out and apologies for not making it clear in my answer.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 13, 2020, 10:35am UTC](https://meta.discourse.org/t/failed-to-post-the-e-mail-301-error/146613/8 "2020-05-13T10:35:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
