[imp] Problems with 'imp_expand_fromaddress'
Jordi
jordi at sirt.es
Thu Jan 9 17:01:55 PST 2003
----- Original Message -----
From: "Jan Schneider" <jan at horde.org>
To: <imp at lists.horde.org>
Sent: Thursday, January 09, 2003 2:28 PM
Subject: Re: [imp] Problems with 'imp_expand_fromaddress'
> 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?
The script gets the correct parameter, so the value for $imp['user'] is
right.
I think the problem is when PHP has to receive the value from the script.
I did some tests, and if i add a "echo 'string'" in the script,
the function 'imp_expand_fromaddress' works fine and i get the following
adress email : string at domain.com
The problem is that i can do an "echo $(NR-1)" , seems like "echo" only
print strings in awk.
> Jan.
>
> --
> http://www.horde.org - The Horde Project
> http://www.ammma.de - discover your knowledge
> http://www.tip4all.de - Deine private Tippgemeinschaft
>
> --
> IMP mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe at lists.horde.org
More information about the imp
mailing list