Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 «noreply@zopim.com»

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 <useremail@hotmail.com>

URL: http://www.domain.com/

Lorim Ipsum

----
Zopim
http://www.zopim.com

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.