[imp] Problems with 'imp_expand_fromaddress'

Jordi jordi at sirt.es
Thu Jan 9 10:09:56 PST 2003


Hi all,

Im working with linux red hat 8 and imp 3.1.
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.
Any idea will be welcome!!

Thanks!


Jordi Mariné




More information about the imp mailing list