Simon <sdeba
...@googlemail.com> wrote:
> Complete newbie.
> Could you please tell me what to put in my aliases file, so that all
> incoming mail for *anythi...@domain.com is sent to a PHP script on my
> box.
> I have a number of domains hosted on my box, but usually my mail is
> hosted elsewhere. On this occasion, I need emails to be piped
> directly to a PHP script.
I would suggest you two stage configuration:
a) deliver *
...@domain.com to local account
You may use FEATURE(`virtusertable') with the following entry in
virtusertable file:
@domain.com user-n
b1) use ~user-n/.forward file to execute php script
"|exec /usr/bin/php -f _php-script_"
[remember about smrsh http://www.sendmail.org/faq/section3#3.11 ]
b2) if you use Linux then most likely your sendmail uses procmail as its
local mailer procmail => IMHO it would be better to execute php
script from procmail script
HOW TO TEST IT:
As root execute:
sendmail -d60.5 -d27.2 -bv j...@domain.com
It should show virtusertable lookups and ~/.forward processing
P.S.
You have forgotten to mention if you want to pass envelope sender and
envelope recipient(s) to the script => I have chosen simpler variant
without passing :-)
--
[pl>en Andrew] Andrzej Adam Filip : a...@onet.eu : Andrzej.Fi...@gmail.com
Open-Sendmail: http://open-sendmail.sourceforge.net/
I owe the public nothing.
-- J. P. Morgan