W dniu 2010-10-26 16:03, Timo Sirainen pisze:
On Tue, 2010-10-26 at 16:00 +0200, Maciej Uhlig wrote:
I'd like to write post-login script using PHP. I noticed every shell
post-login script ends with: exec "$@", which effectively executes
dovecot's script-login.
$@ is all parameters.

In case of shell script echo "$@" gives me /usr/local/dovecot-2.0.6/libexec/dovecot/script-login

However, while I try to do the same (?) in PHP: $prog = $argv[1]; exec
("$prog"); it doesn't work.
Here you're executing the program, but not giving it any parameters from
$argv[2] etc. I don't know what is the correct way to do that in PHP.

In case of PHP I get:

            [argv] => Array
                (
                    [0] => /data/etc/dovecot/pop-postlogin.php
[1] => /usr/local/dovecot-2.0.6/libexec/dovecot/script-login
                )

            [argc] => 2

In both cases there are no more parameters. Is it possible my config is incorrect? What parameters should I give to script-login?

My config is simple for the beginning:

service pop-postlogin {
  executable = script-login /data/etc/dovecot/pop-postlogin.php
#  executable = script-login /data/etc/dovecot/pop-postlogin.sh
  unix_listener pop-postlogin {
  }
}


MU

Reply via email to