title: Save mail message as a file on Linux using sendmail
body: <p>I have an application running on several RHEL 5.8 systems which monitors and alerts (via email).  I need to create a durable log of these alerts locally on each node.  </p>
  
  <p>I think the easiest way to do this would be to add a local email user to the alerts and then use <strong>mailbox settings or a script</strong> (if needed) to save each message on a local filesystem</p>
  
  <p>I would settle for message body dumped to a text file (one file per email.)</p>
  
  <p>It would be better if it could extract time, host, subject, &amp; body as seperate fields for consumption by an open source log reader.</p>
  
  <p>My systems are using sendmail 8.1 and I would prefer to stick with it, although I also have postfix 2.3.3 available.</p>