Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How do I get Postfix to deliver ALL mail to a custom script?

I've followed this series of tuts on rackspace and have set up a Ubuntu Lucid email server. Now, I can send emails from command line and receive emails to a file in /var/mail. What I'd like to do is either

  • direct incoming emails to a script to parse the email, or
  • find a script that will parse that file in /var/mail

Can anyone point me in the right direction? I'm not finding what I need through Google. Thanks!

share|improve this question

marked as duplicate by mailq, Shane Madden, Scott Pack, Jacob, voretaq7 Jan 14 '12 at 5:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 1 down vote accepted

As you're using Postfix, have a look at pipe(8). This is configured in

Pipe is a delivery agent designed to handle mail accepted by smtpd which is then passed to an external command rather than delivered straight to a file.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.