Infinite loop of: 'Email issue -- Unknown To: Address' emails

AI-generated summary

A user reports an email loop issue where nearly 200,000 identical bounce messages titled ‘Email issue – Unknown To: Address’ were generated in a few days, forcing them to disable all outbound emails. They traced the problem to the PollMailbox job and provided a sample email showing Discourse attempting to reply to itself. therubymug shared the email headers and noted that disabling ‘reply by email’ was a temporary fix. riking requested the original email that triggered the chain, but the user noted the difficulty in finding the single source among 200,000 identical copies. riking suggested setting up a Gmail filter to trash emails from that address to stop the loop. Finally, codinghorror confirmed that a fix has been implemented to test for and block email address configurations that cause such feedback loops.

Maybe not quite an infinite loop but I’m having trouble tracking down the core issue here. We’re up to almost 200K emails of just this type in the last few days. That could get expensive. :-/

Right now I’ve had to disable all outbound emails from Discourse.

I’ve traced it back to the PollMailbox job: discourse/app/jobs/scheduled/poll_mailbox.rb at main · discourse/discourse · GitHub

But I need a clue as to how to trace back further down the stack. I realize there’s a timer that runs this poll every SiteSetting.pop3_polling_period_mins.minutes but how can I clear the queue per se?

Any help would be appreciated.

Related topics: Creating topics by email to users.rust-lang.org or internals.rust-lang.org fails with 'Email Issue: Unknown To: Address' - #5 by brson and Creating topics by email to users.rust-lang.org or internals.rust-lang.org fails with 'Email Issue: Unknown To: Address' - #5 by brson

1 лайк

Can you post logs of the incoming mailbox that Discourse looks at to poll for email-in?

It’s gmail, what logs can I post to help? ( @therubymug and I admin the same forum)

To, stripped From and CC addresses of the first few email before the loop started.

I’m pasting a sample email. It’s thousands before and after. It looks like it’s attempting to email itself.

Does that give you a better clue as to what may be going on?

Our reply by email address: is reply+%{reply_key}@strats.co

Right now we’ve turned set: reply by email enabled to unchecked

Delivered-To: support@strats.co
From: <support@strats.co>
Subject: Email issue -- Unknown To: Address
Return-Path: <bounce-md_30190395.54c9c929.v1-18add8dfdf61458995484ef03caaf5e8@track.strats.co>
X-Discourse-Topic-Id: 
X-Discourse-Post-Id: 
X-Discourse-Reply-Key: 
Reply-To: <support@strats.co>
To: <support@strats.co>
Message-Id: <54c9c9297f55f_16e93fc7bfa5c21c33960275@daggerfall.strats.co-app.mail>
Auto-Submitted: auto-generated
Received: from [<redacted ip>] by mandrillapp.com id 18add8dfdf61458995484ef03caaf5e8; Thu, 29 Jan 2015 05:46:17 +0000
X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com
X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30190395.18add8dfdf61458995484ef03caaf5e8
X-Mandrill-User: md_30190395
Date: Thu, 29 Jan 2015 05:46:17 +0000

--_av-HFxtra1FlAEZjjWqa2XfEw
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

We're sorry, but your email message to ["support@strats.co"] (titled Email issue -- Unknown To: Address) didn't work.

None of the destination addresses are recognized. Please make sure that the site address is in the To: line (not Cc: or Bcc:), and that you are sending to the correct email address provided by staff.


--_av-HFxtra1FlAEZjjWqa2XfEw
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<p>We're sorry, but your email message to ["support@strats.co"] (titled Email issue -- Unknown To: Address) didn't work.</p>

<p>None of the destination addresses are recognized. Please make sure that the site address is in the To: line (not Cc: or Bcc:), and that you are sending to the correct email address provided by staff.</p>
<img src="http://track.strats.co/track/open.php?u=30190395&id=18add8dfdf61458995484ef03caaf5e8" height="1" width="1">
--_av-HFxtra1FlAEZjjWqa2XfEw--

No, I mean the first one that ISN’T identical to that. The one that started the chain.

@riking Ha! Yeah, it’s like the needle in the haystack. There are over 200K emails identical to that one spanning multiple days. :-/ This one’s a doozy. Is there any log file in the server I could look at?

Hm, how about this: Set up a gmail filter rule to trash any email sent from that same address. That’ll make sure it never happens.

1 лайк

Thanks to @zogstrip we now test for and block setting these email addresses in a way that causes feedback loops.

3 лайка