Re: [exim] ${lookup{value}lsearch{file}{yes}{no}} tricks help request

2018-11-13 Thread Lena--- via Exim-users
> From: supportsob...@mail.ru

> Could someone help with syntax of?${lookup{value}lsearch{file}{yes}{no}}
> 
> I'm trying to write a condition that will return "FALSE" if either of hosts
> from "Received:" headers (yes, any on the way from sender's server to me)
> is listed in?/etc/whitelist_networks, otherwise "TRUE".

deny !condition = ${if forany{<\n $h_Received:}\
 {match{$item}\
   {\N\B(\d+\.\d+\.\d+\.\d+)\B\N}\
   {$lookup{$1}iplsearch{/path/file}{1}{0}}\
   {0}\
 }\
   }

-- 
Lena

-- 
## 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/


Re: [exim] ${lookup{value}lsearch{file}{yes}{no}} tricks help request

2018-11-13 Thread Jeremy Harris via Exim-users
On 10/11/2018 23:52, supportsobaka--- via Exim-users wrote:
> I'm trying to write a condition that will return "FALSE" if either of hosts 
> from "Received:" headers (yes, any on the way from sender's server to me) 

Where there are multiple headers of name requested using $h_foo:
you get a newline-separated list.  You could walk that list in
an expansion condition "forany", calling your lookup for each one.

http://exim.org/exim-html-current/doc/html/spec_html/ch-string_expansions.html#SECTexpcond

-- 
Cheers,
  Jeremy

-- 
## 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/


[exim] ${lookup{value}lsearch{file}{yes}{no}} tricks help request

2018-11-13 Thread supportsobaka--- via Exim-users
Could someone help with syntax of ${lookup{value}lsearch{file}{yes}{no}}

I'm trying to write a condition that will return "FALSE" if either of hosts 
from "Received:" headers (yes, any on the way from sender's server to me) is 
listed in /etc/whitelist_networks, otherwise "TRUE".

This will work:

deny
 condition = ${if !match{$h_Received:}{1.1.1.1}}
But I want to have a whitelist file, so I'm trying this:

deny 
 condition = \
 ${lookup{$h_Received:}\
 lsearch*{/etc/whitelist_networks}\
 {no}{yes}} This obviously will not work.

Is there an opposite to above way to say exim: "search a partial match of the 
line  from  /etc/whitelist_networks  in  $h_Received?"

Thanks
-- 
## 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/