Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 tried following the tutorial at: to pipe incoming mail to a PHP script for a virtual host with Exim. I can't seem to get it working. Any ideas?

Here's my exim.conf setup:

I have created the directory:


And created a file: in it, with:

catch-all: |php -q /home/ysend/public_html/handler.php

I also tried:

*: |php -q /home/ysend/public_html/handler.php

As well as:




share|improve this question
up vote 1 down vote accepted

try a

exim -bt

Exim is quite talky about what it is doing.

You may add the following line to your exim.conf main section

trusted_users = yourapacheuser

(apacheuser may be www-data on debian/ubuntu, httpd on redhat/fedora)

and most importantly: move your vhost_alias from routers to directors. routers are for mails sent offsite, directors on how to handle local mails.

share|improve this answer
For the command: [root@server ~]# exim -bt <-- router = dnslookup, transport = remote_smtp host [] MX=5 host [] MX=10 host [] MX=20 host [] MX=30 host [] MX=40 And trusted_users = apache is already there :) Where is the directors section? Do I have to create it? – John Jun 26 '09 at 20:11
When I change the /etc/exim/vhosts/ file so that it says: catch-all: |php -q /home/ysend/public_html/handler.php and I run the exim -bt command, it says: Unrouteable address – John Jun 26 '09 at 20:22
I switched it from catchall to *, and now I get: [root@server ~]# exim -bt -> |php -q /home/ysend/public_html/handler.php transport = address_pipe – John Jun 26 '09 at 20:31

Your Answer


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