# Better email reply parsing 📧

**URL:** <https://meta.discourse.org/t/better-email-reply-parsing-e-mail/36495>\
**Category:** Feature\
**Tags:** email, feedback\
**Created:** [9 Diciembre, 2015 18:49 UTC](https://meta.discourse.org/t/better-email-reply-parsing-e-mail/36495 "2015-12-09T18:49:18Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)\
**Post date:** [9 Diciembre, 2015 18:49 UTC](https://meta.discourse.org/t/better-email-reply-parsing-e-mail/36495/1 "2015-12-09T18:49:18Z")

</div>

There are many open bugs on meta related to incorrect email reply parsing and I have been looking into them since past few days.

Almost everytime the fix is to correct/modify something in GitHub’s [email\_reply\_parser](https://github.com/github/email_reply_parser) library.

The GitHub’s email\_reply\_parser library is now abandoned. The last commit was over a year ago, and there are many open issues / pull requests.

I propose that we include the email\_reply\_parser in core Discourse email library so that we can customize it as per our requirements, without depending on GitHub’s library.

I have laid the groundwork for this, and in process fixed these bugs:

> [@Email parsing reply not correctly stripping \`----Original message----\` marker](https://meta.discourse.org/t/email-parsing-reply-not-correctly-stripping-original-message-marker/24112):
>
> Email parsing reply not correctly handling ----Original message---- marker. Here is a modified example (to protect privacy): I have two examples of this now with the same user. I’m willing to send via PM the raw original email replies to a one of the Discourse Team to help resolve this. Cheers, Dean.

[https://meta.discourse.org/t/html-email-signature-not-being-stripped-out-of-notification-reply/21351](https://meta.discourse.org/t/html-email-signature-not-being-stripped-out-of-notification-reply/21351)

> [@Email-created reply including reply preamble](https://meta.discourse.org/t/email-created-reply-including-reply-preamble/25472):
>
> Reproduce: Reply using Gmail to a post notification. bulbGet a separate rejection error because your reply is less than the default 20 character minimum. facepunchReply to your first attempt to reply (which still is addressed to Discourse) with a longer response. angryExpected: Only the response content appears. Actual: Your email address is exposed. astonished Pastebin of original message content available to those who request.

> [@Malformed bullet causes emailed in topic to be incorrectly truncated](https://meta.discourse.org/t/malformed-bullet-causes-emailed-in-topic-to-be-incorrectly-truncated/25374):
>
> I know that a line with two dashes truncates everything below it. -- But it turns out that a line with a single dash immediately followed by text (no space) will also truncate everything below it. See screenshots.

Here is the PR for the same:

[https://github.com/discourse/discourse/pull/3918](https://github.com/discourse/discourse/pull/3918)

Looking forward to hear [@team](https://meta.discourse.org/groups/team)’s feedback/suggestions.

---

_[View the full topic](https://meta.discourse.org/t/better-email-reply-parsing-e-mail/36495)._
