parsing - RAILS: How to strip contents of an email(signature, etc) from an E-mail body? -
i'm wondering how i'd strip contents of email , perhaps gmail-like threading when have email body html returned in ruby on rails.
for example, following text sent app:
hey xyz, i've fixed error , tested couple of times, seems working fine now. on fri, feb 18, 2011 @ 7:44 am, joe david <joe@david.com> wrote: initial thread starts here... -- joe@david.com
email format tricky thing. use find boundaries between emails using regex detects strings on fri, feb 18, 2011 @ 7:44 am, joe david <joe@david.com> wrote:
. can't guarantee incoming messages have string between emails.
another option check >
character, may appear @ beginning of each quoted line. however, once again, have worry happens if receive message doesn't follow convention.
yet option--and think gmail this--is matches between incoming message , previous messages. i.e. if see initial thread starts here...thanks, joe@david.com
in message, , have in previous message in database, infer it's quote earlier in thread.
Comments
Post a Comment