Re: [exim] Variable expansion in Error Messages

Page principale
Supprimer ce message
Répondre à ce message
Auteur: George L. Yermulnik
Date:  
À: exim-users
Sujet: Re: [exim] Variable expansion in Error Messages
Hello!

On Wed, 06 Sep 2017 at 16:34:30 (+0100), Jonathan Gilpin via Exim-users wrote:

> 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}}

----------------------------^dollar-sign is missing?

> 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


--
George L. Yermulnik
[YZ-RIPE]