Philip Hazel wrote:
> I was assuming you would be doing something like replacing "freeze"
> with
> testprint "would have frozen"
> for the purposes of testing the lookup.
Ah! Now _that_ works - at least in testing. But then I tried
the "real-world" scenario you presented...
> exim -odq <bad address>
> .
> exim -d10 -M <message id>
> That should produce masses of output,
Yep, sure does. Now I just have to figure out why on earth
the filter mechanism doesn't seem to be seeing the
$local_part and $domain variables... :( Here's the beginning
of the -d10 output. The parts that bother me are indented with
">" signs, the rest with ".".
---
. Exim version 1.82 debug level set to 10
. probably Berkeley DB version 1.8x (compatibility mode)
. set_process_info: 3471 1.82 delivering specified messages
. delivering message 0xxBmx-0000to-00
. set_process_info: 3471 1.82 delivering 0xxBmx-0000to-00
. Opened spool file 0xxBmx-0000to-00-H
. user=root uid=0 gid=0 sender=root@???
. sender_local=1 resent=no ident=root
. Non-recipients:
. Empty Tree
. ---- End of tree ----
. recipients_count=1
. LOG: 0 MAIN
. Unfrozen by forced delivery
. running system filter as uid=0 gid=0
. Filter: start of processing
. Filter: condition is false: error_message
. Filter: condition is false: $header_from: is "root"
> Filter: testprint: to @
> search_open (0) /etc/bar
> search_find: file="/etc/bar" type=0 key="@:foo" partial=-1
> internal_search_find: file="/etc/bar" type=0 key="@"
> file lookup required for @:foo in /etc/bar
> Filter: testprint:
> search_open found (0) /etc/bar cached
> search_find: file="/etc/bar" type=0 key="@:foo" partial=-1
> internal_search_find: file="/etc/bar" type=0 key="@"
> cached data used for lookup of @:foo in /etc/bar
> Filter: condition is false:
> ${lookup{$local_part@$domain:foo}lsearch{/etc/bar}{$value}} is "baz"
. Filter: at end "delivered" is false
. Filter: end of processing
> Delivery address list:
> djb@???
---
It doesn't seem to really lose track of the address, since
it's still on the delivery address list at the end - but
the testprint doesn't include the local_part or domain, and
the lsearch doesn't either.
Here's my (updated) filter file:
---
# Exim filter <- Do not edit or remove this line!
if error_message then finish endif
if $header_from: is "root" then finish endif
testprint "to $local_part@$domain"
testprint ${lookup{$local_part@$domain:foo}lsearch{/etc/bar}{$value}}
if ${lookup{$local_part@$domain:foo}lsearch{/etc/bar}{$value}} is "baz"
then testprint "would have frozen" endif
---
And here's /etc/bar:
---
djb: foo=baz
djb@???: foo=baz
djb@???: foo=baz
root@???: foo=baz
---
Any more ideas from anyone?
-Dan
--
Dan Birchall - Internet Sysadmin - 16 Straight Communications
Your source for great graphic design, web design and hosting.
http://www.16straight.com - 609.231.7887 - djb@???
AntiSpam. Populus Iamdudam Defutatus Est - Spam Delenda Est!
--
*** Exim information can be found at
http://www.exim.org/ ***