Re: how to process incoming mails?
| From: | David Robley | Date: | Wed, 28 May 2003 09:29:52 +0000 |
| Subject: | Re: how to process incoming mails? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-149205@lists.php.net to get a copy of this message | ||
In article <20030526172757.68863.qmail@pb1.pair.com>, me@celebrate.lu
says...
> Hi,
>
> i'm using SuSE Linux 8.1 with Apache 2 and PHP 4...
> here is what i want to do:
> if someone writes a mail to theaddress@somehost.com it should be directly
> processed by a PHP script...
> (I need it for a simple script, that validates email addresses... (similar
> to the PHP newsgroups validation...))
>
> how can i do that?
>
> is there a way, that sendmail directly passes incoming mails to a
> PHP-script, when they arrive?
>
> Thanks in advance for any help...
>
> - Marco Weber -
Yes - you need to set up an alias entry which points to the script. Add a
line like
theaddress: "| /path/to/script.php"
to your alias file - IIRC its /etc/alias.txt on Slackware - and as root
run the command newaliases to update the aliases database. Subsequently
all mail to theaddress will be piped to the script. Then I think you need
to open /dev/stdin in your script to access the data from the pipe.
--
Quod subigo farinam
$email =~ s/oz$/au/o;