[thelist] PHP (was Bash) script to handle email

Kasimir K evolt at kasimir-k.fi
Tue Nov 16 04:57:35 CST 2004


Seamus wrote on 2004-11-13 15:13:
> I'm using this script to handle email 
> 
> 
> #! /usr/bin/php -q
> <?
> 
> // read from stdin
> $lines = file("/dev/stdin");
...
> 
> ?>
>   but it doesn't work.
> Does any one have, or know where I would fing a shell script to do the same.
> Also what exactly should I have in my .forward file to forward all
> mail to this script

I haven't been playing with bash scripts, but PHP yes. Have a look at: 
http://www.evolt.org/article/Incoming_Mail_and_PHP/18/27914/

In what way your PHP script is not working? Would it happen to be along 
lines of:
smrsh: "your_addy" not available for sendmail programs
554 5.0.0 Service unavailable

It would be smrsh giving you headache. From 
http://www.sendmail.org/faq/section2.html#2.13
" smrsh is a restricted shell utility that provides the ability to 
specify, through a configuration, an explicit list of executable 
programs. When used in conjunction with sendmail, smrsh effectively 
limits sendmail's scope of program execution to only those programs 
specified in smrsh's configuration."

So it takes care that only allowed programs may use sendmail. But I 
found it difficult to convince it that I really wanted to allow PHP...

.k



More information about the thelist mailing list