I have sent this to Qbik support direct and was wondering if anyone in the community has managed to successfully extract IpToCountry.CountryForIP from the Message.GetHeader("X-SF-Originating-IP") and compare it to a data list lookup.
While I know it is a chore to get the originating IP from a message header the main issue here is that I want to be able to parse this info without physically inputting the IP address, but rather by using Wingates embedded symbols.
I can obtain the IP address from Message.GetHeader("X-SF-Originating-IP").
When I try and put it into the IPToCountry.CountryForIp function it unfortunately looks at me like I’m mad.
I have tried the following to parse the information :
I have tried using the policy directly via
{{IPToCountry.CountryForIp({{Message.GetHeader("X-SF-Originating-IP")}})}} – ERROR : unable to convert IpToCountryManager to Text
I have also attempted to set a session variable using Javascript
function filter(Session, Envelope, Message, Event)
{
Session.SetData("IncMailIP",Message.GetHeader("X-SF-Originating-IP"));
if(Session.GetData("IncMailIP")==Message.GetHeader("X-SF-Originating-IP"))
{
return true;
}
}
And then call this via the policy
{{IPToCountry.CountryForIp({{Session.GetData("IncMailIP")}})}} – ERROR : unable to convert IpToCountryManager to Text
I have tried numerous variations
{{IPToCountry.CountryForIp(Message.GetHeader("X-SF-Originating-IP"))}}
{{IPToCountry.CountryForIp(Session.GetData("IncMailIP"))}}
The policy just doesn’t seem to want to accept any other form of input other than a direct string.
Anyone have any joy with this ?
Thanks
J