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 tried following the tutorial at: http://www.phpshare.org/articles/Piping-Incoming-Mail-with-PHP.html 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:

http://www.ysend.com/exim.txt

I have created the directory:

/etc/exim/vhosts

And created a file: ysend.com 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:

catch-all: my.email.address@site.com

and

*: my.email.address@site.com

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

try a

exim -bt someaddress@site.com

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 test@ysend.com Zhay07@gmail.com <-- test@ysend.com router = dnslookup, transport = remote_smtp host gmail-smtp-in.l.google.com [209.85.217.71] MX=5 host alt1.gmail-smtp-in.l.google.com [209.85.210.21] MX=10 host alt2.gmail-smtp-in.l.google.com [209.85.201.114] MX=20 host alt3.gmail-smtp-in.l.google.com [209.85.133.114] MX=30 host alt4.gmail-smtp-in.l.google.com [209.85.218.27] 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/ysend.com file so that it says: catch-all: |php -q /home/ysend/public_html/handler.php and I run the exim -bt test@ysend.com 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 lol@ysend.com lol@ysend.com -> |php -q /home/ysend/public_html/handler.php transport = address_pipe –  John Jun 26 '09 at 20:31
add comment

Your Answer

 
discard

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