The discussion addresses issues with Discourse’s email reply parsing, stemming from the abandonment of the GitHub email_reply_parser library. techAPJ proposed integrating the library into the core to allow customization, noting it fixed several existing bugs. eviltrout and zogstrip suggested forking the project instead of importing it directly to maintain test coverage. Consequently, techAPJ created and released a new gem, discourse_email_parser, and the changes were merged into the codebase techAPJ. Later, concerns were raised regarding non-English language detection for reply headers fefrei. This was resolved when techAPJ announced the replacement of the parser with email_reply_trimmer, which supports common languages and has ongoing contributions for additional ones like German fefrei.
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 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:
Wow I did not realize that library was only about 280 lines of code!
One downside with importing it this way is you are not importing their tests. If we regress on something they already have a test for, we are not going to know are we?
Maybe it makes more sense to fork it as discourse-email-parser, and add your new functionality and tests to the suite in that project?