Re: [exim] Variable expansion in Error Messages

Top Page
Delete this message
Reply to this message
Author: Jonathan Gilpin
Date:  
To: exim-users
Subject: Re: [exim] Variable expansion in Error Messages
I figured it out and added the $

warn set acl_c_geoip_c = ${perl{get_country_code_from_ip}{$sender_host_address}}

Jonathan

> On 6 Sep 2017, at 16:34, Jonathan Gilpin via Exim-users <exim-users@???> wrote:
>
> hi,
>
> Hopefully this is a very simple question, I have some code to do a geoIP lookup and some rules which act upon it:
>
>
> warn set acl_m_geoip_c = {perl{get_country_code_from_ip}{$host_address}}
>
>
> deny  message = sender is from {$acl_m_geoip_c} country outside of approved list
>      authenticated     = *
>      condition         = ${if !match {$acl_m_geoip_c}{GB}}

>
> The message returned and logged is as follows:
>
> 2017-09-06 16:23:11 H=cloudserver039962.home.net.pl (onthepeak.pl) [89.161.205.84] X=TLSv1:ECDHE-RSA-AES256-SHA:256 CV=no F=<sales@domainame> A=fixed_login:sales@domainname rejected RCPT <gio107@???>: sender is from {{perl{get_country_code_from_ip}{}}} country outside of approved list
>
> What I really wanted was the actual country code to be logged not : {{perl{get_country_code_from_ip}{}}}
>
> How can I achieve this? or rather what have I done wrong?
>
> The perl code I am using, which should not be relevant is:
>
> use Geo::IP;
>
>  sub get_country_code_from_ip ($) {
>         my $ip = shift;
>         our $geoip;
>         $geoip ||= new Geo::IP(GEOIP_STANDARD);
>         return $geoip->country_code_by_addr($ip);
>   }

>
> Kind Regards,
>
>
> Jonathan
>
>
>
>
> --
> ## List details at https://lists.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/