[exim-dev] [Bug 2072] New: Support network matching in singl…

Góra strony
Delete this message
Reply to this message
Autor: admin
Data:  
Dla: exim-dev
Temat: [exim-dev] [Bug 2072] New: Support network matching in single key lookups
https://bugs.exim.org/show_bug.cgi?id=2072

            Bug ID: 2072
           Summary: Support network matching in single key lookups
           Product: Exim
           Version: N/A
          Hardware: x86
                OS: All
            Status: NEW
          Severity: wishlist
          Priority: medium
         Component: Lookups
          Assignee: nigel@???
          Reporter: andrew@???
                CC: exim-dev@???


Hi

It would be very useful to be able to use:

${lookup{$sender_host_address}net-cdb{/tmp/ratelimit.cdb}{$value}{DEFAULT_RATE}}

Or

${lookup{$sender_host_address}cdb+{/tmp/ratelimit.cdb}{$value}{DEFAULT_RATE}}

In /tmp/ratelimit.cdb the keys would be ip addresses or ip networks in CIDR.

The search_find function would take an extra param indicating if it is a
network search (based on either the net- or the + which ever is choosen)
which in turn is passed to the lookup type via internal_search_find.
The lookup type then checks if the keystring is an IP address and performs
a ip_match instead of an equality match.

With the above you are then able to have keys such us 192.168.1.0/24
if $sender_host_address is in that network then the lookup would
return the $value

The only option to do this at the moment seems to be using a perl
routine.

The current net<number>-<single-key-search-type>;<search-data> lookup
for lists would not work in this scenario as the <number> needs to be
known/set in advance.

The suggested implementation would work without having to know which
networks are in <search-data>.

I am willing to work on this if there is agreement on the principle.

--
You are receiving this mail because:
You are on the CC list for the bug.