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

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: https://github.com/discourse/discourse/blob/master/app/jobs/scheduled/poll_mailbox.rb#L46-47

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 Like

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 Like

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

3 Likes