Failed to POST the e-mail (301 error)


I’m having an issue setting up reply by email after following this guide. 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 301

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

1 Like

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.


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 :man_facepalming:

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!


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[]
<22>Apr 13 10:18:11 postfix/smtpd[323]: 403AF81D15:[]
<22>Apr 13 10:18:11 postfix/cleanup[329]: 403AF81D15: message-id=<>
<22>Apr 13 10:18:11 postfix/qmgr[80]: 403AF81D15: from=<>, size=2555, nrcpt=1 (queue active)
<22>Apr 13 10:18:11 postfix/smtpd[323]: disconnect from[] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
<23>Apr 13 10:18:11 receive-mail[331]: Recipient:
<19>Apr 13 10:18:11 receive-mail[331]: Failed to POST the e-mail to 301
<22>Apr 13 10:18:11 postfix/pipe[330]: 403AF81D15: to=<>, 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.

Here is Your problem.
Edit mail-receiver.yml to use and it should work.

1 Like

I tried to add https as you stated before but rebuild mail-receiver is needed (not global app :sweat_smile:).

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!

1 Like

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.


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