title: rails - Parsing an Email Message for just the reply, not the old thread?
body: <p>I set my app to receive incoming emails via a post from a service. The controller that receives the posts looks a little like this:</p>
  
  <pre><code>    class IncomingMailsController &lt; ApplicationController    
        require 'mail'
        skip_before_filter :verify_authenticity_token
  
        def create
          message = Mail.new(params[:message])
          message_plain = (params[:plain])
          Rails.logger.info   'message2.plain:'
          Rails.logger.info   message2
  
          render :text =&gt; 'success', :status =&gt; 200 # a status of 404 would reject the mail
        end
      end
  </code></pre>
  
  <p>That successfully is delivering the entire email message, replies,forward history etc. The issue is I'd like to be able to extract just the actual reply text. </p>
  
  <p>Currently I get:</p>
  
  <pre><code>That's not a bad idea. Lets try that out.
  
  On Nov 17, 2010, at 4:18 PM, XXXXX @ XXXXXXXX wrote:
  &gt; There's a new reply:
  </code></pre>
  
  <p>And I'd like to know how rails devs get just the reply:</p>
  
  <pre><code>That's not a bad idea. Lets try that out.
  </code></pre>
  
  <p>Ideas? Thanks</p>