Can't email forward notifications from a different Discourse server

Reproduce

  • Receive a useful email notification from Discourse Site A, via a category you are “Watching First Post” for.
  • Forward that email notification into Discourse Site B, via an email address set up to create new messages to an existing group.

Expected result

The content is processed correctly and a private message is generated.

Actual result

The email is not processed, the message is not created, and this bounce back email notification to forwarder:

We’re sorry, but your email message to discourse-site-b@example.org (titled Fw: [Discourse Site A] [Announcements] Big News) didn’t work. There was an unrecognized error while processing your email and it wasn’t posted. You should try again, or contact a staff member.

2 Likes

My first thought is to check your setting for block auto generated emails.

Thanks for that thought. Since I forwarded the email by hand from my email client, I didn’t send that header, but your comment did inspire me to look to see if there was in fact something simiilar in the error logs.

The error turned up in /admin/email/rejected:

undefined method 'lines' for nil:NilClass

Not sure if that’s helpful for someone more clueful than I.


Update: Another data point. I got the same rejection email and same logged error as above, when trying to forward in another human’s email. This makes me think it might be something more related to how the Microsoft Outlook/Exchange client is processing forwarded messages. Investigation on my end will continue.

4 Likes

That certainly sounds like a bug we should fix, that said, even after that is fixed the email you are forwarding has some headers that make us think it is a bulk emailer of sorts, you would have to whitelist that somehow.

@zogstrip we should probably assign the lines nil class thing out?

3 Likes

Ostensibly if this bug is resolved, would I be able to gain some more insights why the mail is being blocked?

I will look more closely at the headers my server might be adding. Also happy to share them individually if others want a closer look; but it may be early for that.

3 Likes

Yeah the bug is probably the thing hiding the real issue. Solving it will roll the ball up the hill a bit.

5 Likes

5 Likes

@gerhard care to have a look since you’re the last one to have touched that code path?

5 Likes

I can’t reproduce the problem, but I see where the code might fail.
@downey Could you please send me the raw email in a PM? I’d like to make sure that I’m applying the correct fix.

5 Likes

I never got an example email, but I fixed the underlying issue.

https://github.com/discourse/discourse/commit/99181bb3b8b05f49c5a26fc81a04527b8d2974e6

Please create a new bug report if you are still having problems with forwarded emails.

4 Likes