[imp] Problems with 'imp_expand_fromaddress'

Jan Schneider jan at horde.org
Thu Jan 9 14:28:26 PST 2003


Zitat von Jordi <jordi at sirt.es>:

> I' ve created a simple linux script which gets the user email adress from
> a poppasswd file.
> Basically is that: grep ^$1 poppasswd | awk 'BEGIN { FS = "/" } { print
> $(NF-1) }'
> 
> The {print $(NF-1)} prints the left side from the @ of the email adress.
> $1 is the argument passed from php, i did it with:
>         escapeShellCmd($imp['user']
> 
> The script works fine when i call from linux,  but  when calling from
> php, dont work. I never worked with PHP, so probably im doing something
> wrong.
> I tried  to do the call in two ways_:
>     1- function imp_expand_fromaddress ($imp) {
>             $cmd = '/usr/.../script ' . escapeShellCmd($imp['user']);
>             $name = `$cmd`;
>             return ($name);
>         }
> 
>     2- function imp_expand_fromaddress ($imp) {
>            return (system("/usr/.../script ".
> escapeshellarg($imp['user'])));
>     }
> 
> And always get that message in the from line:
> INVALID_ADDRESS at .SYNTAX-ERROR.

Do you know where exactly it fails? Is the value for $imp['user'] correct?
Does your script get the correct parameter? Is it returning the correct
value? Does php recieve the correct value?

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft


More information about the imp mailing list