Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

show matcching element in hostlist

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


exim-users at ficos

May 15, 2008, 6:35 AM

Post #1 of 4 (244 views)
Permalink
show matcching element in hostlist

Hello,

can anybody please tell me a way to find out which element in a
(host)?list caused a match?

I'm using something like this:

hostlist sender_whitelist = CONFDIR/lists/sender_whitelist_byIP \
: CONFDIR/lists/sender_whitelist_byName
...

accept
hosts = : 127.0.0.1 : +relay_from_hosts : +sender_whitelist
logwrite = DEBUG: SHAP CH early accepted

where the hostlists are using CIDR and regex. Everything works fine,
it's just that I would like to be able to log what matched ...

# sender_whitelist_byIP:
207.171.160.0/19
87.238.80.0/21
...

# sender_whitelist_byName:
^\S+.csx\.cam\.ac\.uk$
^\S+\.amazon\.com$
...


Many thanks

- Karl



--
## List details at http://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/


dot at dotat

May 15, 2008, 8:47 AM

Post #2 of 4 (225 views)
Permalink
Re: show matcching element in hostlist [In reply to]

On Thu, 15 May 2008, Karl Fischer wrote:
>
> can anybody please tell me a way to find out which element in a
> (host)?list caused a match?

The closest you'll get is $host_data, but that requires that the matching
element is a lookup which has useful information in the right-hand-side of
the relevant table entry - i.e. simple host lists won't do it for you.

Tony.
--
<fanf[at]exim.org> <dot[at]dotat.at> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}

--
## List details at http://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-users at ficos

May 15, 2008, 9:16 AM

Post #3 of 4 (224 views)
Permalink
Re: show matcching element in hostlist [In reply to]

Tony Finch wrote:
> On Thu, 15 May 2008, Karl Fischer wrote:
>> can anybody please tell me a way to find out which element in a
>> (host)?list caused a match?
>
> The closest you'll get is $host_data, but that requires that the matching
> element is a lookup which has useful information in the right-hand-side of
> the relevant table entry - i.e. simple host lists won't do it for you.

Thanks Tony,

that means I need to use a lookup condition instead of a hostlist?

condition = ${lookup{$sender_host_name}lsearch{CONFDIR/lists/sender_whitelist_byName}}

or

condition = ${lookup{$sender_host_address}lsearch{CONFDIR/lists/sender_whitelist_byIP}}

instead of

hostlist sender_whitelist = CONFDIR/lists/sender_whitelist_byIP \
: CONFDIR/lists/sender_whitelist_byName

hosts = +sender_whitelist

But that won't do any CIDR net-range oder regex match for me, right?

- Karl


--
## List details at http://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/


dot at dotat

May 16, 2008, 5:29 AM

Post #4 of 4 (202 views)
Permalink
Re: show matcching element in hostlist [In reply to]

On Thu, 15 May 2008, Karl Fischer wrote:
>
> that means I need to use a lookup condition instead of a hostlist?

You can put lookups in host lists, e.g.

hostlist sender_whitelist = \
net-iplsearch;CONFDIR/lists/sender_whitelist_byIP \
nwildlsearch;CONFDIR/lists/sender_whitelist_byName

> But that won't do any CIDR net-range oder regex match for me, right?

It does if you use the right lookup type :-)

Tony.
--
<fanf[at]exim.org> <dot[at]dotat.at> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}

--
## List details at http://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 users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.