Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

ruby email reply text parser

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.textile
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 bodyparts.gemspec


Splits the body of replied email messages into the actual new message and the included reply chain.


BodyParts.find_reply_in( valid raw email string, TMail or Mail object)


Given that you have the following raw email string stored in the variable message:

    MIME-Version: 1.0
    Received: by with HTTP; Tue, 22 Jun 2010 10:37:09 -0700 (PDT)
    In-Reply-To: <>
    References: <>
    Date: Tue, 22 Jun 2010 10:37:09 -0700
    Message-ID: <>
    Subject: Re: how is babby formed?
    From: Max Ogden <>
    To: Max Ogden <>
    Content-Type: multipart/alternative; boundary=0016361e87c2efdb680489a1de8e

    Content-Type: text/plain; charset=ISO-8859-1

    i saw on the news this mroing

    On Tue, Jun 22, 2010 at 10:36 AM, Max Ogden <> wrote:

    > how girl get pragnent?

    Content-Type: text/html; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable

    i saw on the news this mroing<br><br><div class=3D"gmail_quote">On Tue, Jun=
     22, 2010 at 10:36 AM, Max Ogden <span dir=3D"ltr">&lt;<a href=3D"mailto:mo="></a>&gt;</span> wrote:<br><blockquote class=
    =3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
    how girl get pragnent?


If you run BodyParts.find_reply_in message you will receive the following as output:

      :new_message    => "i saw on the news this mroing", 
      :rest_of_thread => "On Tue, Jun 22, 2010 at 10:36 AM, Max Ogden <> wrote:> how girl get pragnent?"


Copyright © 2010 Max Ogden. See LICENSE for details.

Something went wrong with that request. Please try again.