Discourse Email Issue - AutoGeneratedEmailError on All Outgoing Emails

Hi,

I’m experiencing an issue with my Discourse forum and hoping someone can help.

Problem: All outgoing emails (digests, notifications, PMs) are being rejected with the error Email::Receiver::AutoGeneratedEmailError. This happens to 100% of emails across different domains.

What I’m seeing:

  • Email logs under “Rejected” showing dozens of entries
  • All with the same error: Email::Receiver::AutoGeneratedEmailError
  • Affected emails: Digests, welcome messages, etc.
  • Timeframe: Last 6 minutes, but likely ongoing longer

Error message from logs:

Email::Receiver::AutoGeneratedEmailError
Occurs when the "precedence" header is set to list, junk, bulk or auto_reply, 
or when any other header contains auto-submitted, auto-replied or auto-generated.

Sample headers:

Auto-Submitted: auto-generated
Precedence: list
List-ID: [My Forum] <forum.example.com>
X-Auto-Response-Suppress: All

Additional stack trace:

activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:130:in `block in warn'
/var/www/discourse/lib/email/processor.rb:183:in `log_email_process_failure'
/var/www/discourse/plugins/msgraph-poll-discourse-plugin/plugin.rb:70:in `call`

My setup:

  • Discourse version: Latest
  • Email provider: Office 365 / Exchange
  • Plugin: Microsoft Graph Poll Plugin active
  • SMTP configured through Office 365

Email deliverability: When I send test emails from the forum to https://www.mail-tester.com/, I get a 9/10 score, so the basic email configuration and deliverability seems to be working fine.

My suspicion: The Microsoft Graph Plugin or Discourse’s default headers are causing receiving email servers to classify emails as “auto-generated” and reject them.

Questions:

  1. Has anyone experienced similar issues with Office 365 and Discourse?
  2. Can I suppress the problematic headers?
  3. Should I disable the Microsoft Graph Plugin and switch to standard POP3/IMAP?
  4. Are there Discourse settings that might help?

What I’ve tried so far:

  • Verified email configuration
  • Checked SMTP settings
  • Tested deliverability (9/10 score on mail-tester.com)

Does anyone have experience with this issue or suggestions for solutions?

Thanks in advance!

The Rejected tab of the email logs should be showing incoming emails that have been rejected, rather than outgoing ones. There’s an admin setting Block auto generated emails that is enabled by default, which may account for the ones you’re seeing in there.

Are there any other errors in your /logs about failed email jobs, or similar?

1 Like

First of all, thank you for your help.

I emptied the logs yesterday and today I have this.

might also be helpful.

I think your real problem is those Net::SMTPServerBusy errors.

That still leaves the weird incoming emails.
Can you click on the :information_source: icon and tell us what it says?

It seems you edited all those email domains and forum/category names? I’d rather have you black out stuff than making things up, since it is hard to tell which parts have been made up and which parts are real now.

Ok I thought that would be better. I didn’t make it up completely, I just wanted to make it anonymous.

From is always the e-mail address of the forum.
To is the email address of the user
Subject is often the activity summary but also PNs or notifications when someone replies to a thread.
Error is always Email::Receiver::AutoGeneratedEmailError

Email can not be processed: Email::Receiver::AutoGeneratedEmailError