# Mail-receiver doesn't work with with some email sources

**URL:** https://meta.discourse.org/t/mail-receiver-doesnt-work-with-with-some-email-sources/349243
**Category:** Support
**Tags:** mail-receiver
**Created:** [January 27, 2025, 7:26pm UTC](https://meta.discourse.org/t/mail-receiver-doesnt-work-with-with-some-email-sources/349243 "2025-01-27T19:26:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![kmdalton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kmdalton/32/484875_2.png) [@kmdalton](https://meta.discourse.org/u/kmdalton)
#### Post date: [January 27, 2025, 7:26pm UTC](https://meta.discourse.org/t/mail-receiver-doesnt-work-with-with-some-email-sources/349243/1 "2025-01-27T19:26:19Z")

</div>

I’m really struggling to get the mail-receiver container to work reliably. I’m at the point where it works as intended for replies sent from my personal GMail account, but it rejects emails sent from my employer’s office 365 webapp. I can’t tell if this is a config issue on my end or something weird about how my employer routes email.

I’m new to looking at the output of `./launcher logs mail-receiver`, but I think this excerpt demonstrates the typical sequence of events during a failed delivery:

```plaintext
Jan 27 17:19:13 myvps-mail-receiver postfix/spawn[363]: warning: command /usr/bin/policyd-spf exit status 120
Jan 27 17:20:21 myvps-mail-receiver postfix/smtpd[356]: warning: problem talking to server private/policyd-spf: Connection timed out
Jan 27 17:20:21 myvps-mail-receiver postfix/smtpd[356]: NOQUEUE: reject: RCPT from mail-server.employer.tld[XX.XXX.XX.XX]: 451 4.3.5 <4eb16fb194e4f56c53b738dd8b3f3411@reply.my_domain.tld>: Recipient address rejected: Server configuration problem; from=<me@employer.tld> to=<4eb16fb194e4f56c53b738dd8b3f3411@reply.my_domain.tld> proto=ESMTP helo=<mail-server.employer.tld>
Jan 27 17:20:21 myvps-mail-receiver postfix/smtpd[356]: using backwards-compatible default setting smtpd_relay_before_recipient_restrictions=no to reject recipient "4eb16fb194e4f56c53b738dd8b3f3411@reply.my_domain.tld" from client "mail-server.employer.tld[XX.XXX.XX.XX]"
Jan 27 17:20:21 myvps-mail-receiver postfix/smtpd[356]: disconnect from mail-server.employer.tld[XX.XXX.XX.XX] ehlo=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=4/6
<22>Jan 27 17:20:56 policyd-spf[367]: : prepend Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=XX.XXX.XX.XX; helo=mail-server.employer.tld; envelope-from=me@employer.tld; receiver=reply.my_domain.tld <22>Jan 27 17:20:56 policyd-spf[367]: Traceback (most recent call last):
Jan 27 17:20:56 myvps-mail-receiver postfix/spawn[366]: warning: command /usr/bin/policyd-spf exit status 120

```

It seems like the spf policy daemon is not working based on the first, second, and final lines. I can’t find anything diagnostic as to why it isn’t working. I’m also not sure whether it is necessary. Emails from GMail seem to make it through just fine.

I’m self hosting on a VPS with Cloudflare DNS and transactional email from Brevo.

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [January 27, 2025, 7:41pm UTC](https://meta.discourse.org/t/mail-receiver-doesnt-work-with-with-some-email-sources/349243/2 "2025-01-27T19:41:09Z")

</div>

I’ve also noticed quite a few unpredictable bounces from Microsoft 365 sources over a long time, which is has been most irritating as so many companies use it. I’ve thusfar had no luck chasing the source end for issues.

Perhaps there is a problem with mail-receiver as you suggest; I’d be delighted if this was investigated!

---

<div class="post-metadata">

### Author: ![kmdalton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kmdalton/32/484875_2.png) [@kmdalton](https://meta.discourse.org/u/kmdalton)
#### Post date: [January 27, 2025, 7:55pm UTC](https://meta.discourse.org/t/mail-receiver-doesnt-work-with-with-some-email-sources/349243/3 "2025-01-27T19:55:17Z")

</div>

I’m not sure if my config, my employer’s, or the mail-receiver app are to blame 🤷. I would definitely appreciate any suggestions about how to wring more info out of the container.

---

<div class="post-metadata">

### Author: ![kmdalton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kmdalton/32/484875_2.png) [@kmdalton](https://meta.discourse.org/u/kmdalton)
#### Post date: [January 27, 2025, 10:25pm UTC](https://meta.discourse.org/t/mail-receiver-doesnt-work-with-with-some-email-sources/349243/4 "2025-01-27T22:25:58Z")

</div>

Can anyone tell me how to access the raw system log coming out of the mail-receiver container? I feel like there is supposed to be a traceback after this line:

```plaintext
<22>Jan 27 17:20:56 policyd-spf[367]: : prepend Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=XX.XXX.XX.XX; helo=mail-server.employer.tld; envelope-from=me@employer.tld; receiver=reply.my_domain.tld <22>Jan 27 17:20:56 policyd-spf[367]: Traceback (most recent call last):

```

which is being scrubbed? Maybe I’m mistaken.

[This](https://github.com/kmdalton/mail-receiver?tab=readme-ov-file#syslog-integration) looks relevant, but I’m afraid I don’t understand how to use it in practice.

---

<div class="post-metadata">

### Author: ![denvergeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denvergeeks/32/327671_2.png) [@denvergeeks](https://meta.discourse.org/u/denvergeeks)
#### Post date: [January 27, 2025, 11:14pm UTC](https://meta.discourse.org/t/mail-receiver-doesnt-work-with-with-some-email-sources/349243/5 "2025-01-27T23:14:57Z")

</div>

Here’s the response from pasting the entirety of those lines of the log into [ask.Discourse.com](http://ask.Discourse.com)…

> **Troubleshooting Postfix and Policyd-SPF Issues
AI**
>
> **denvergeeks:**
> 
> what this error indicates:  
> Jan 27 17:19:13 myvps-mail-receiver postfix/spawn[363]: warning: command /usr/bin/policyd-spf exit status 120  
> Jan 27 17:20:21 myvps-mail-receiver postfix/smtpd[356]: warning: problem talking to server private/policyd-spf: Connection timed out  
> Jan 27 17:20:21 myvps-mail-receiver postfix/smtpd[356]: NOQUEUE: reject: RCPT from mail-server.employer.tld[XX.XXX.XX.XX]: 451 4.3.5 \<4eb16fb194e4f56c53b738dd8b3f3411@reply.my\_domain.tld\>: Recipient address rejected: Server configuration problem; from=[me@employer.tld](mailto:me@employer.tld) to=\<4eb16fb194e4f56c53b738dd8b3f3411@reply.my\_domain.tld\> proto=ESMTP helo=\<mail-server.employer.tld\>  
> Jan 27 17:20:21 myvps-mail-receiver postfix/smtpd[356]: using backwards-compatible default setting smtpd\_relay\_before\_recipient\_restrictions=no to reject recipient “4eb16fb194e4f56c53b738dd8b3f3411@reply.my\_domain.tld” from client “mail-server.employer.tld[XX.XXX.XX.XX]”  
> Jan 27 17:20:21 myvps-mail-receiver postfix/smtpd[356]: disconnect from mail-server.employer.tld[XX.XXX.XX.XX] ehlo=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=4/6  
> \<22\>Jan 27 17:20:56 policyd-spf[367]: : prepend Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=XX.XXX.XX.XX; helo=mail-server.employer.tld; envelope-from=me@employer.tld; receiver=reply.my\_domain.tld \<22\>Jan 27 17:20:56 policyd-spf[367]: Traceback (most recent call last):  
> Jan 27 17:20:56 myvps-mail-receiver postfix/spawn[366]: warning: command /usr/bin/policyd-spf exit status 120
> 
> **DiscourseHelper:**
> 
> > **Searching**
> >
> > Searching for: postfix policyd-spf exit status 120 server configuration problem connection timed out reason and solution
> 
> It seems your error logs indicate issues with `postfix` and `policyd-spf`. Specifically:
> 
> 1. **Exit Status 120 for `policyd-spf`:**
> 
> 2. **Connection to `private/policyd-spf` Time Out:**
> 
> 3. **RCPT Rejection with Status 451:**
> 
> * * *
> 
> ### **Steps to Resolve:**
> 
> 1. **Check the `policyd-spf` Configuration:**
> 
> 2. **Service and Logs:**
> 
> 3. **Postfix Configuration:**
> 
> 4. **Test SPF:**
> 
> 5. **Socket Communication:**
> 
> 6. **Configuration Errors:**
> 
> 7. **Restart All Related Services:**
> 
> * * *
> 
> If you continue facing issues beyond configuration changes, reach out to your hosting provider or Discourse support to ensure server health and correct connectivity settings. You can also explore more from external SPF issue documentation or the postfix/policyd community forums.

And here’s a link to the response from Perplexity.ai…

[https://www.perplexity.ai/search/what-this-error-indicates-jan-fWurGemCTTezCPLfLNNSMg](https://www.perplexity.ai/search/what-this-error-indicates-jan-fWurGemCTTezCPLfLNNSMg)

---

<div class="post-metadata">

### Author: ![kmdalton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kmdalton/32/484875_2.png) [@kmdalton](https://meta.discourse.org/u/kmdalton)
#### Post date: [January 28, 2025, 4:16pm UTC](https://meta.discourse.org/t/mail-receiver-doesnt-work-with-with-some-email-sources/349243/6 "2025-01-28T16:16:44Z")

</div>

I tried what I could based on these responses, but nothing seems to fix the issue. I think what would be most helpful is if someone could tell me how to get the contents of the Python tracebacks from policyd-spf into the log files. Any suggestions? Is this just a red herring?

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [April 3, 2026, 6:25pm UTC](https://meta.discourse.org/t/mail-receiver-doesnt-work-with-with-some-email-sources/349243/7 "2026-04-03T18:25:10Z")

</div>

With apologies for waking up this old topic, I have a metoo situation. I recently moved my personal email from gmail to a self-hosted email setup, and am now bumping up against the same issue as the OP here. I can send email from gmail into my discourse site, but I cannot send email from my self-hosted mail server. Instead I get a bounce and the same error as the OP appears in my mail receiver log.

I expected a certain amount of trouble with self hosting email (email is hard!) but wanted to give it a shot anyway. It’s been a couple months now and email seems to be flowing everywhere else so far, and my [mxtoolbox.com](http://mxtoolbox.com) report is lighting up all green for my domain and IP.

Would appreciate any pointers!

Edit: actually, realizing my error message is a bit different.

```plaintext
<22>Apr 3 18:14:28 policyd-spf[130]: : 550 5.7.23 Message rejected due to: SPF fail - not authorized. Please see http://www.openspf.net/Why?s=mfrom;id=user@example.org;ip=192.0.2.1;r=example-site.example.orgApr 03 18:14:28 discourse-mail-receiver-example-site postfix/smtpd[122]: NOQUEUE: reject: RCPT from unknown[192.0.2.1]: 550 5.7.23 <staff@example-site.example.org>: Recipient address rejected: Message rejected due to: SPF fail - not authorized. Please see http://www.openspf.net/Why?s=mfrom;id=user@example.org;ip=192.0.2.1;r=example-site.example.org; from=<user@example.org> to=<staff@example-site.example.org> proto=ESMTP helo=<discourse.example.org>
Apr 03 18:14:28 discourse-mail-receiver-example-site postfix/smtpd[122]: using backwards-compatible default setting smtpd_relay_before_recipient_restrictions=no to reject recipient "staff@example-site.example.org" from client "unknown[192.0.2.1]"
Apr 03 18:14:28 discourse-multisite-mail-receiver-example-site postfix/smtpd[122]: disconnect from unknown[192.0.2.1] ehlo=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=4/6

```

That link to `http://www.openspf.net/Why?s=mfrom;id=user@example.org` doesn’t work. Seems [openspf.net](http://openspf.net) no longer exists.
