github / email_reply_parser Goto Github PK
View Code? Open in Web Editor NEWSmall library to parse plain text email content
License: MIT License
Small library to parse plain text email content
License: MIT License
I've realized that the signature extraction that uses ML does not always work. I've tried it for 50 emails and it only worked for 16 of them. What is the success rate in more complex signatures? Like the one below.
"Name Surname
Job title
company name
website
telephone, mobile phone
fax
Address
email"
Is there something i can do to improve my results?
If you send an email reply in markdown (e.g. with backticks
or some kind of:
It is not converted into Markdown on the actual site.
Moreover, editing the comment/reply on Github still does not convert the email to markdown
Hi,
thanks for email_reply_parser. I've ported it to golang and was wondering if you'd like to mention it as a port in the README? I'll send a pull request if you're interested.
I ran into some random situations where emails were not parsed correctly. Part of the email was chopped out, for example:
Hi Test,\n\n-This is a test
Will result in -This is a test
fragment being hidden and considered as part of signature which it should not be. After digging more into the problem, we figured out that:
(?m)(--\s*$|__\s*$|\w-$)|(^(\w+\s*){1,3} ym morf tneS$)
The first matching group is testing against \w-
, which is causing the problem. I can't think out of a better way to solve the problem other than take \w-$
part out so it opens to any suggestion.
When you parse emails, you detect signature by --
(dash-dash-space). But, Gmail for some odd reason, adds asterisks before and after signature delimiter, you should, probably, support this as well. In raw email it looks like this: *-- *
.
The initial comment generated by the email reply did not include any line breaks. Even after trying to edit the comment, add line breaks/paragraphs, and saving -- it will not apply them.
See link below:
I'm getting an incompatible character encodings: UTF-8 and ASCII-8BIT
error using parse_reply
in a Rails view on certain strings.
I admittedly do not know much about encoding... so I spent a bunch of time googling but to no avail.
Here's an example of one offending string. I don't see anything wrong with it and hope Github isn't sanitizing any of it when I paste it in. But why not...
Hi Jaime, This just came in last night from the local Nantucket dive shop I contacted: \"We do lobster diving charters all the time in August- just call or pop in at least a week in advance and talk to Phil Sr. Thanks, The Sunken Ship crew\" If you'd like us to book something on your behalf, let me know, otherwise contact info is: [omitted] Thanks! Rachel On June 6 @ 01:19 PM, [omitted] wrote: Hey Jamie! Here is Mike's info: [omitted]
I'm getting these strings from my database which is UTF-8. I've tried to use force_encoding
and still get the error. Any clues? Am I not doing something foolishly obvious?
RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.
via e.g.
spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']
Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can image, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.
There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.
I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!
Appendix:
If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies
p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post aobut this project for more information.
As an example email body:
Here's a reply
On Tuesday, February 10, 2015 4:25 PM, TestAccount <test@_blank_.com> wrote:
And here's the parent
parse_reply() isn't able to separate the reply from the parent in this case, it appears because the parent is lacking '>' characters in front. I would have thought this case unusual, but it seems Yahoo mail uses this style by default. Has anyone gotten parse_reply to work with Yahoo mail replies?
I had an email come like the following
Quidem est perspiciatis omnis voluptatibus consequatur est et. Impedit occaecati quas voluptatem voluptas dolor eum consequatur.
Assumenda voluptatem tempore dignissimos. Id omnis nisi--ratione omnis qui suscipit.
Name
Since there is a new line and then a '--' embedded in the sentence, the emails were getting cut short.
I would like to make a pull request that recognizes "Kind regards" as a signature.
What is the best way for me to contribute?
See jdpopkin@bf9d5ce for an example of this.
Signatures of replies sent by Google Inbox are not detected because there are no empty line between the quatation and the signature such as the following email.
Hi,
This is a test reply from Google Inbox.
On Wed, May 25, 2016 at 3:13 PM <[email protected]> wrote:
> LGTM
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly or view it on GitHub
>
--
This is signature, but it is not detected.
This part of the gem: if text =~ /^(?!On.*On\s.+?wrote:)(On\s(.+?)wrote:)$/nm
works correctly for non-Dutch emails, but this is not correctly parsed as the end of the email:
Op zondag 31 mei 2015 heeft Name <[email protected]> het volgende geschreven:
It would be awesome if this could be added!
below is code, I am extracting the mail body using mailparser which is text/html content
and trying to get latest reply using EmailReplyParser.parse_reply, but it is extracting complete message not the reply only
mail = mailparser.parse_from_bytes(file.read()
reply_text = EmailReplyParser.parse_reply(mail.text_html[0])
it is working file for text/plain content
mail = mailparser.parse_from_bytes(file.read()
reply_text = EmailReplyParser.parse_reply(mail.text_plIn[0])
any suggestions are appreciated, thanks in adavnce
Hey,
I've had a quick look at the code and this doesn't look like it's possible. Just wanted to double check, there's no was to optionally turn off the signature removal right?
For example:
Hi! I'm replying to an email! let me end it with a quote:
> this is a quote!
On Oct 9, 2011, at 3:47 PM, Maboo <[email protected]> wrote:
> THIS IS THE ORIGINAL EMAIL!
> HI!
This produces the following fragments:
---
- !ruby/struct:EmailReplyParser::Fragment
quoted: false
signature: false
hidden: false
"@content": "Hi! I'm replying to an email! let me end it with a quote:"
"@lines":
- !ruby/struct:EmailReplyParser::Fragment
quoted: true
signature: false
hidden: true
"@content": |-
> this is a quote!
On Oct 9, 2011, at 3:47 PM, Maboo <[email protected]> wrote:
> THIS IS THE ORIGINAL EMAIL!
> HI!
"@lines":
Maybe ERP should look for the On Oct 9, 2011, at 3:47 PM, Maboo <[email protected]> wrote
business as well as the angle bracket?
When a person replies twice on the same thread via email consecutively, second time the email parsing seems buggy.
For example, see this.
So I may be making an incorrect assumption you all use this repo for also parsing the replies to issues and pull requests but I found this bug as visible here: moby/moby#16847 (comment)
Thanks!
E.g.
This is some example text.
I think we should use __setattr__ for that
Second sentence will be hidden.
I'm looking at the code and will submit a pull request if I figure out where the bug is, I have no ruby experience though so I might not be able to.
Where we type reply message at the bottom of the actual email, Gem is not able to parse such type of emails...
It is returning whole email as it is, without parsing...
I have just realized that GitHub displays wrong the comments that have been sent by email.
One sample would be jgm/pandoc#1765 (comment). I received the email message and only the first paragraph should be displayed as a comment (it contains the required >
in the message). The other two paragraphs are the actual reply (they aren’t formatted as comments in the email message).
Another sample is jgm/pandoc#1612 (comment). In that case, the paragraphs after the last shown without expansion are considered comments. The original message has no comments in that paragraphs.
I think this is an important issue. Otherwise it is really hard to make a distinction between what has been replied and which the reply itself is.
If the reply comes from Window Live Mail the parsing is wrong.
Example of the body received:
risposta da mail di notifica anche se ora non seguo più il post
From: Airesis Forum
Sent: Tuesday, November 19, 2013 12:03 AM
To: [email protected]
Subject: [gruppo prova] Ambarabà cicci Coccò
Airesis - Test
--------------------------------------------------------------
A topic you have subscribed to has received a reply. You can view it here: http://www.arengo.org/groups/805-gruppo-prova/forums/forum-pubblico/topics/ambaraba-cicci-cocco
mammarameo To unsubscribe from this topic, use the following link: http://www.arengo.org/groups/805-gruppo-prova/forums/forum-pubblico/topics/ambaraba-cicci-cocco/unsubscribe
follow us on Twitter | follow us on Facebook | follow us on Google+
Copyright © 2013 Airesis - Test.
You receive this email because you are registered on www.arengo.org.
Edit alarms and notifications preferences
A bottom-quoted email that has a line in the reply start with “On” will discard that line and everything below it.
The code responsible can be found on line #87-90 of email_reply_parser.rb:
if text =~ /^(On\s(.+)wrote:)$/nm
# Remove all new lines from the reply header.
text.gsub! $1, $1.gsub("\n", " ")
end
An example email that shows the issue follows:
On your remote host you can run:
telnet 127.0.0.1 52698
This should connect to TextMate (on your Mac, via the tunnel). If that
fails, the tunnel is not working.
On 9 Jan 2014, at 2:47, George Plymale wrote:
> I am having an odd issue wherein suddenly port forwarding stopped
> working in a particular scenario for me. By default I have ssh set to
> use the following config (my ~/.ssh/config file):
> […]
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/textmate/rmate/issues/29
When replying a GitHub mail, I usually do inline quoting.
Only recently I realised that lines starting with ">", the common quote character, will not show in issue comments. Thus replies created by emails may get a very different meaning.
Compare what is shown:
with the real content shown after clicking "edit":
Either GitHub should show both quote and answer or suppress any quoting to avoid confusion.
If quoting is not desired GitHub should state so in its emal notifications.
Hi,
Just wanted to let you know that I'm working on a Python port of this package, if you want to you can link to it from here. I've included your LICENSE file ✌️
bad_text = <<~EOF
>> I use Virtru to send and receive encrypted email. Click the "unlock
>> message" button below to decrypt and read my message. If you have any
>> questions, please contact me.
>> Unlock Message
>> <https://secure.virtru.com/start/?c=barebones&t=barebones-1-0-2&s=&p=0df370ca-d15d-4cb8-816f-cb598187af#v=3.0.0&d=https%3A%2F%2Fstorage.virtru.com%2Fapi%2Fpolicies%2F0df370ca-d15d-4cb8-816f-cb898187af%2Fdata%2Fmetadata&dk=IaLXRLoS0TX1W0uUofnFT0Ub7FyuCDKcgJqxFXXM%3D>
>> [image: virtru] Virtru encrypts emails to keep private information safe.
>> Learn more at Virtru.com <https://www.virtru.com>.
>>
>> Virtru Secure Email: v1.4.0
>>
>> Message ID: 0df370ca-d15d-4cb8-816f-81598187af
>>
>> Virtru Metadata: eyJ2ZXJzaW9uIjoiMS40LjAiLCJtZXNzYWdlSWQiOiIwZGYzNzBjYS1kMTVkLTRjYjgtODE2Zi1jYjgxNTk4MTg3YWYiLCJyZW1vdGVDb250ZW50TGluayI6Imh0dHBzOi8vc2VjdXJlLnZpcnRydS5jb20vc3RhcnQvP2M9YmFyZWJvbmVzJnQ9YmFyZWJvbmVzLTEtMC0yJnM9Y2hyaXMlNDBkYXRhNGFtZXJpY2Eub3JnJnA9MGRmMzcwY2EtZDE1ZC00Y2I4LTgxNmYtY2I4MTU5ODE4N2FmI3Y9My4wLjAmZD1odHRwcyUzQSUyRiUyRnN0b3JhZ2UudmlydHJ1LmNvbSUmFwaSUyRnBvbGljaWVzJTJGMGRmMzcwY2EtZDE1ZC00Y2I4LTgxNmYtY2I4MTU5ODE4N2FmJTJGZGF0YSUyRm1ldGFkYXRh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BRVS9WVGdIS1dIYkJ4Z0FrZXVGLzU0MFdUMExwTWJXcndMU0NVRmg1RU01cHZrakVGZ0thZlhuZUQ1VEIrTWF3dj
>>
>>
EOF
Timeout::timeout(2) { EmailReplyParser.read(bad_text) }
Hey guys! I am trying to use your gem with sendgrid's inbound email hook, and it errors in uninitialized constant Api::V1::PostsController::EmailReplyParser when I try to do:
post = Post.create(
...
body: EmailReplyParser.parse_reply(params['text']),
...
)
Thanks for any help!
Although #54 seems to fix one type of Outlook email reply, one with a quoted body, I don't believe that the following example reply from an Outlook mail client is currently working:
Outlook email reply with a team mention in the email body.
From: CRM Comments [[email protected]]
Sent: Friday, 23 March 2012 5:08 p.m.
To: John S. Greene
Cc: Jane Q. Codes
Subject: Re: [@organization/team] Discussion about mail replies. (#1)
Should the team mention from the subject line be parsed in the comment?
> Here is quoted text.
>
I've pushed up a test via 33ccba0 that fails locally on the example fixture (pushed in 5163940).
In the example here, I believe only the following string should be returned:
Outlook email reply with a team mention in the email body.
Does not parse iPad emails correctly.
Is there a test for iPhone?
The fix to #23 seems to have broken reply header handling in emails like this one, containing more reply headers in the quoted text below.
Expected Behavior: The first reply header gets its line breaks removed, and ends up in the second fragment along with all of the quoted text.
Observed Behavior: The line breaks aren't removed, and therefore it's not recognized as a reply header later on. So the reply header ends up in the first fragment instead of the second.
This link to the documentation in the readme appears to be broken:
https://help.github.com/code/email_reply_parser/
I found a copy of the documentation on rubydoc, perhaps we can link there instead?
http://rubydoc.info/gems/email_reply_parser/
(or more specifically http://rubydoc.info/gems/email_reply_parser/0.5.2 since 0.5.3 is still processing)
Man, so many apps are suffering from this issue. How about we make this a pretty website and get some more contributors onboard
Are there plans to support other languages in the On, wrote
regex?
One of our collaborators responded with the following email:
Just saw that when it stays in the valve panel, and the next measurement is done, it updates. Just as Jim expected.
Op 13 jan. 2015 om 17:02 heeft "Jim Graham" <[email protected]<mailto:[email protected]>> het volgende geschreven:
[previous comment]
—
Reply to this email directly or view it on GitHub<https://github.com/Capilix/Capella/issues/117>.
Although this email is in English, his email client is configured in Dutch, so it wrote Op 13 jan. 2015 om 17:02 heeft "Jim Graham"
See: https://github.com/jmoeller/itugameengine/commit/49b7cefb96b2372a7ab273a0dab25df4f436db30
Comments 3 and 4 were written via Gmail, and as you can see, the quoted text isn't removed.
Hi,
keep in mind 😂
This is a test reply from Google Inbox.
On Wed, May 25, 2016 at 3:13 PM [email protected] wrote:
LGTM
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
--
This is signature, but it is not detected.
While if I reply to any github email and add > within the reply it dos not ignore the line.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.