This discussion addresses an email loop issue in Discourse caused by auto-generated replies, particularly when the Contact Email and notification email settings are identical — a configuration Discourse now warns against, though the check wasn’t in place months ago. watchmanmonitor reported 244,276 emails in their POP inbox, many marked as Auto-Submitted: auto-replied, triggering rejection messages from Discourse that then bounced back, restarting the cycle. downey suggested filtering auto-submitted bounces at the mail server level. tgxworld identified the core issue: Discourse replies to auto-generated emails (e.g., bounce messages), which, if sent to a monitored inbox (like pop3_polling_username), restart the loop. They opened a PR to stop replying to no-reply addresses. sam and codinghorror proposed preserving feedback by allowing the first auto-reply but silently rejecting subsequent ones using a unique header or GUID. tgxworld implemented two fixes: detecting delivery status reports to avoid replying to bounced rejections, and adding a custom header to reject future replies containing it. The loop’s involvement of Microsoft’s server remains unexplained.
Apparently this has been going on for quite some time… the other email we see hundreds of is from discourse, to discourse,
We’re sorry, but your email message to [“discuss@forum.com”] (titled [Discussions] Email issue – Auto Generated Reply) didn’t work.
Your email was marked as “auto generated”, which we can’t accept. If you believe this is in error, contact a staff member.
Not sure what type of mail server you’re running, but can you set up some type of automation to delete auto-submitted bounces, etc., from the incoming POP3 inbox?
We ran into this as well. The cause of the infinite loop is because we are sending an “Auto Generated Reply” back to email addresses that we detect as “no-reply” or “auto-generated”. If pop3_polling_username is similar to notification_email, the email that bounced will be polled for and we end up starting another cycle.
It does seem really weird to me that we reply to email addresses that we detect as “no-reply” so I opened a PR to stop doing that.
I worry though that we lose out on some of the feedback we have now, I wonder if we should allow the first one of these through and then stop the loop thereafter?
Poison the “reply” with a magic header, if you ever see this header you silently reject?
Yeah Sam has the right idea here we cannot lose this feedback. Put in a guid (a constant will work) and if you see it in the reply coming back to you, cancel your reply.