Patrick Crosby
2006-Sep-05 16:19 UTC
ActionMailer, TMail: any way to strip quoted reply in receive?
I''m handling incoming mails with ActionMailer::receive. It''s working great, but I''d like to strip out the quoted reply from the email. I wrote some regexp thing to do it for the standard ascii mail where it puts ''>'' in front of the quoted text, but people who use html mail seem to have a multitude of different ways of quoting the original mail in their replies. I can parse these out as I find new ones, but I was wondering if something was already built into TMail or ActionMailer to do this. I looked through some of the TMail source and couldn''t find anything. Thanks. patrick --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Jonathan del Strother
2006-Sep-05 16:43 UTC
Re: ActionMailer, TMail: any way to strip quoted reply in receive?
On 5 Sep 2006, at 17:19, Patrick Crosby wrote:> > I''m handling incoming mails with ActionMailer::receive. It''s working > great, but I''d like to strip out the quoted reply from the email. I > wrote some regexp thing to do it for the standard ascii mail where it > puts ''>'' in front of the quoted text, but people who use html mail > seem to have a multitude of different ways of quoting the original > mail in their replies. > > I can parse these out as I find new ones, but I was wondering if > something was already built into TMail or ActionMailer to do this. I > looked through some of the TMail source and couldn''t find anything.TMail is fairly dumb - it''s just intended to give you access to the various segments of the email, without trying to interpret them in any special way. I''m not aware of any publicly available ruby stuff to do this for you. You might start with rfc3676, which is the specification on how this is *supposed* to be done. Whether mail clients correctly follow it or not is a different question... http://www.rfc-archive.org/getrfc.php?rfc=3676