title: Modifying & Relaying Mail
body: <p>Is there any way to simply relay mails received by a PHP script? Instead of being received normally into a mailbox, I have routed all incoming mails to a PHP script that would parse and log them (from, subject, message text) into a text file.</p>
  
  <p>This is the <strong><em>truncated</em></strong> version of the script:.</p>
  
  <pre><code>    &lt;?php
  
          $feed = fopen ("php://stdin", 'r');
          $email = '';
          while (!feof($feed))
          {
              $email .= fread($feed, 1024);
          }
          fclose($feed);
  
          $to = explode...
          $from = explode..
          $subject = explode...
          $message = utf8_encode...
  
          $log = fopen("/home/.../log.txt", "a+");
          fwrite($log,...);
          fclose($log);   
  
      ?&gt;
  </code></pre>
  
  <p>Would it be possible <strong><em>to relay the entire message, as is, to another recipient, but not as a forward</em></strong>?</p>
  
  <p>TIA.</p>