thoughtbot / griddler

Simplify receiving email in Rails (deprecated)
http://griddler.io/
MIT License
1.38k stars 199 forks source link

parsing questions #86

Closed anazar closed 11 years ago

anazar commented 11 years ago

Just recently starting using griddler and I'm noticing that in a lot of cases it isn't excluding things from the original message.

Example:

John Smith responded with this note.

Sent via the Samsung Galaxy S™ III, an AT&T 4G LTE smartphone

-------- Original message --------
From: notifications@xyz.com 
Date: 
To: person@aol.com 
Subject: My New Subject 

Shouldn't it be checking for things like Original Message... or From: [email] ?

jayroh commented 11 years ago

Hey @anazar

We're actually checking for "Original Message", but we are not checking for "Original message". The lowercase "m" is throwing off the parser in the case of your sample email body. See here: https://github.com/thoughtbot/griddler/blob/master/lib/griddler/email_parser.rb#L77

This shouldn't be too bad to replicate with a failing test if you're up for the challenge :)

Starting here: https://github.com/thoughtbot/griddler/blob/master/spec/griddler/email_spec.rb#L110

craigsheen commented 11 years ago

I also was having this issue. Didn't realise what the actual issue was until I read this and now it makes perfect sense why it wasn't working.

Hope this pull request is satisfactory, it includes tests.

theycallmeswift commented 11 years ago

@craigsheen pull request is lookin' good. Thanks for your help on this one!

jayroh commented 11 years ago

Nice work on this @craigsheen :) :clap: :clap: :clap: