title: Parsing email "Received:" headers
body: <p>We need to parse <code>Received:</code> email headers according to RFC 5321. We need to extract domain\IPs through which the mail has traversed.Also, we need to figure if an IP is an internal IP. Is there already a library which can help out , especially in C\C++. </p>
  
  <p>For example,</p>
  
  <pre><code>Received: from server.mymailhost.com (mail.mymailhost.com [126.43.75.123])
      by pilot01.cl.msu.edu (8.10.2/8.10.2) with ESMTP id NAA23597;
      Fri, 12 Jul 2002 16:11:20 -0400 (EDT)
  </code></pre>
  
  <p>We need to extract the "by" server.</p>
  
  <p>thanks</p>