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

I am currently using Postfix to pipe incoming email form our support email address to our WHMCS install to the support department. This has been working great for sometime. Problem is now we have a live chat widget, and when someone sends an offline message it goes to the sales email but it's from Zopim:

From: Zopim «»

What I would like to do is filter in Postfix that if an incoming email to the sales address is from that email to send it to another script instead of WHMCS, a PHP script we have written to scrape the email and change sender to the actual sender that Zopim received from on the live chat widget:

From: Visitor xxxxxxx <>


Lorim Ipsum


We are currently doing the piping in the Aliases file /etc/aliases:

support:  "| /usr/bin/php -q /var/www/pipe/pipe.php"
abuse:  "| /usr/bin/php -q /var/www/pipe/pipe.php"
sales: "|/usr/bin/php -q /var/www/pipe/pipe.php"
share|improve this question
up vote 3 down vote accepted

Instead of piping email directly into your script, pipe it into procmail first. Procmail can look at the headers and route it accordingly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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