[exim] problem with Exim::expand_string

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Николаев А.Г.
Data:  
Para: exim-users
Asunto: [exim] problem with Exim::expand_string
Hi.

In routers configuration:
localuser:
driver = accept
address_data = ${perl{sendAuthReq}}
debug_print = $local_part
# check_local_user
transport = local_delivery
cannot_route_message = No such user here

Perl code cut from sendAuthReq sub:
sub sendAuthReq
{
...cut...
my $user = Exim::expand_string{'$local_part'};
Exim::log_write("Ive got user = " . $user . "\n");
...cut...
}

In exim mainlog:
2005-06-28 14:28:34 Ive got user = HASH(0x8136170)

In the documentation:
Within any Perl code called from Exim, the function
Exim::expand_string is available to call back into
Exim's string expansion function. For example, the Perl code

my $lp = Exim::expand_string('$local_part');

makes the current Exim $local_part available in the Perl
variable $lp. Note those are single quotes and not double
quotes to protect against $local_part being interpolated
as a Perl variable.

Now I trying to debug with flags -bd -q30m -d+exec+expand+route:

......... cut ......
37835 --------> localuser router <-------- 
37835 local_part=mail-test domain=myhost.mydomain.ru
37835 expanding: $local_part 
37835    result: mail-test 
37835 mail-test 
37835 processing address_data 
37835 expanding: sendAuthReq 
37835    result: sendAuthReq 
37835 Starting Perl interpreter 
37835 LOG: MAIN 
37835   Ive got user = HASH(0x8136170) 
37835 
.......... cut. ........


What is happen with $local_part in Exim::expand_string?