Post-By-Email: Signature removal sometimes removes valid content

Hi, this is – sort of – a follow-up to this discussion:

In our Discourse forum (v2.6.5), we encourage posting by email. Unfortunately, we’ve had multiple cases where the incoming email was cut off in the middle, or outright rejected with Email::Receiver::NoBodyDetectedError. There are multiple underlying issues. For example:

  • Seemingly harmless ways to separate the contents of the post cause the forum to discard the remainder
  • the signature detector seems to operate on the ASCII version of the email. We’ve seen the case where the HTML email starts with an empty <b/> statement. The emailer converted it to ** in the ASCII version of the email, and which was then “detected” as the beginning of the signature.

Ways to improve the situation:

  • don’t cut off the signature before adding the topic to the forum: keep the full post including signature editable. Then a wrongly removed portion could be brought back by editing the post.
  • make the signature detection smarter (how? I don’t know…)
  • let the signature detector use the HTML version
  • make the signature separators configurable
  • allow turning off entirely the removal of signatures in the forum settings

Thank you for considering. It will help us a lot.

We’re in the process of improving our incoming email parsing logic but in the meantime, can you try disabling the “trim incoming emails” site setting?

1 Like

Hi @zogstrip , thanks a lot! I missed that option.

It works to the degree that it’ll not reject or cut off emails. Now it shows a clickable ... which allows to view the full post. And I can manually edit the post to get rid of the ..., too.

Would still be great if you’d be able to fix the problems we’ve had with the signature detector.
Thanks!

It’s a new option :wink:

We’re working on it :wink:

2 Likes