title: Mail gem - how to clean up the body string
body: <p>I'm trying to read an email using ruby mail gem. 
  But <code>mail.body.decoded</code> returns me not just the body message. How can I clean up this body message and remove unwanted text like:</p>
  
  <p><code>
  -20cf30433c9a437cc304939017ef\nContent-Type: text/plain; charset=ISO-8859-1\nContent-
  </code></p>
  
  <pre><code>message = $stdin.read
  mail = Mail.read_from_string(message)
  puts mail.body.decoded
  </code></pre>
  
  <p><code>
  --20cf30433c9a437cc304939017ef\nContent-Type: text/plain; charset=ISO-8859-1\nContent-Transfer-Encoding: quoted-printable\n\n REAL BODY TEXT \\n\n--20cf30433c9a437cc304939017ef\nContent-Type: text/html; charset=ISO-8859-1\nContent-Transfer-Encoding: quoted-printable\n\n&lt;br clear=3D\"all\"&gt;--20cf30433c9a437cc304939017ef--
  </code></p>
  
  <p>How can I clean up this email body mail message extracting only the REAL BODY TEXT , without ANY header ?</p>
  
  <p>I'm creating a simple Ticket System based in Ruby on Rails, and a ticket is created when an email is received by ticket@mydomain.com. But when the message is in HTML format the BODY TEXT is surrounded by HEADERs text.</p>