extract relevant reply from email

238 views
Skip to first unread message

Jeppe Liisberg

unread,
May 21, 2012, 3:16:14 AM5/21/12
to copenhagen-ruby-user-group
Hi ruby brigadiers

I need some clever approach to extract relevant replies from emails (without original email, signatures etc.)

I know Zendesk does this pretty well but how (hoping some of you Z-guys can help out)?

I found this on stackoverflow, but it does not seem bulletproof:

Any xp, hints, tips etc. will be very appreciated.

Jeppe Liisberg
Engineer, IT

Liisberg Consulting
Flæsketorvet 68, 1.
1711 København V

Tel:    +45 29 27 23 81
Mail:    je...@liisberg.net
Web:    http://jeppe.liisberg.dk
www.linkedin.com/in/liisberg

Jesper Christiansen

unread,
May 21, 2012, 4:01:52 AM5/21/12
to copenhagen-ru...@googlegroups.com
Extracting meaningful replies without signatures is almost impossible. Only if the signatures correspond to the known formats (as is also mentioned in the stackoverflow post) that is possible. Zendesk uses the reply above this line approach to filter out the old email.

Thomas Dippel

unread,
May 21, 2012, 4:04:16 AM5/21/12
to copenhagen-ru...@googlegroups.com
It might be a long shot but try asking http://twitter.com/#!/thomasfuchs
He is doing this very successfully in his helpdesk solution: http://charmhq.com/

Med venlig hilsen / Best regards
Thomas Dippel

Jakob Skjerning

unread,
May 21, 2012, 5:02:29 AM5/21/12
to copenhagen-ru...@googlegroups.com

On 21/05/2012, at 9:16, Jeppe Liisberg wrote:

> I need some clever approach to extract relevant replies from emails (without original email, signatures etc.)
>
> I found this on stackoverflow, but it does not seem bulletproof:
> http://stackoverflow.com/questions/1372694/strip-signatures-and-replies-from-emails

Nothing that does this will probably ever be bulletproof. Github has outsourced their way of doing it, though, so that might be a good starting point at least: https://github.com/github/email_reply_parser

--
Jakob Skjerning
www.mentalized.net | www.substancelab.com

Teddy K. Nielsen

unread,
May 21, 2012, 4:31:55 PM5/21/12
to copenhagen-ru...@googlegroups.com

 

Thomas Fuchs writes as follows in a blog post on Charm:

 

As an email support application, Charm obviously reads email. We’re using a custom fetcher (called Fido) for fetching email from IMAP servers, combined with the Mail gem to parse email. The state of email parsing on Ruby is sadly not as well advanced as on some other platforms, and there are bugs and kinks, mostly having to do with parsing broken email and working around encoding problems. We hope to contribute back some fixes for the Mail gem at a future date—we aim to parse any and all email without errors and have a pretty good collection of tests by now (thanks to our awesome beta testers!).”

 

mvh Teddy

 

 

Amager, København S

@teddynielsen | +45 2144 1533 | www.teddynielsen.dk

Reply all
Reply to author
Forward
0 new messages