Re: [exim] Varying message size limit according to sending h…

Top Page
Delete this message
Reply to this message
Author: John Burnham
Date:  
To: exim-users
Subject: Re: [exim] Varying message size limit according to sending host?
> Thanks Phil, that's pretty close to what I need - I will want
> to modify it to use a hostlist if possible, as I already have
>
> hostlist printer_ips = 10.4.250.0/24 : 10.5.250.0/24 :
> 10.6.250.0/24 : 10.7.250.0/24 : 10.8.250.0/24 : 10.9.250.0/24
> : 10.10.250.0/24 : 10.11.250.0/24 : 10.12.250.0/24 :
> 10.13.250.0/24 : 10.14.250.0/24 : 10.25.250.0/24 :
> 10.26.250.0/24 : 10.27.250.0/24 : 10.30.250.0/24 :
> 10.31.250.0/24 : 10.32.250.0/24 : 10.33.250.0/24 :
> 10.34.250.0/24 : 10.35.250.0/24 : 10.36.250.0/24 :
> 10.37.250.0/24 : 10.38.250.0/24 : 10.54.250.0/24 :
> 10.55.250.0/24 : 10.56.250.0/24 : 10.57.250.0/24 :
> 10.58.250.0/24 : 10.60.250.0/24 : 10.75.250.0/24 :
> 10.76.250.0/24 : 10.77.250.0/24 : 10.104.250.0/24 :
> 10.154.250.0/24 : 10.155.250.0/24 : 10.156.250.0/24
>
> Assuming that can be done, we're home and hosed :-)
>


>From the spec:

-------------------------
match_ip {<string1>}{<string2>}

    This condition matches an IP address to a list of IP address
patterns. It must be followed by two argument strings. The first (after
expansion) must be an IP address or an empty string. The second (after
expansion) is a restricted host list that can match only an IP address,
not a host name. For example:


    ${if match_ip{$sender_host_address}{1.2.3.4:5.6.7.8}{...}{...}}


    The specific types of host list item that are permitted in the list
are:


        An IP address, optionally with a CIDR mask.


        A single asterisk, which matches any IP address.


        An empty item, which matches only if the IP address is empty.
This could be useful for testing for a locally submitted message or one
from specific hosts in a single test such as


          ${if match_ip{$sender_host_address}{:4.3.2.1:...}{...}{...}}


        where the first item in the list is the empty string.


        The item @[] matches any of the local host's interface
addresses.


        Single-key lookups are assumed to be like "net-" style lookups
in host lists, even if net- is not specified. There is never any attempt
to turn the IP address into a host name. The most common type of linear
search for match_ip is likely to be iplsearch, in which the file can
contain CIDR masks. For example:


          ${if match_ip{$sender_host_address}{iplsearch;/some/file}...


        It is of course possible to use other kinds of lookup, and in
such a case, you do need to specify the net- prefix if you want to
specify a specific address mask, for example:


          ${if match_ip{$sender_host_address}{net24-dbm;/some/file}...


        However, unless you are combining a match_ip condition with
others, it is just as easy to use the fact that a lookup is itself a
condition, and write:


          ${lookup{${mask:$sender_host_address/24}}dbm{/a/file}...


    Consult section 10.11 for further details of these patterns.


-------------------------
So, yeah, CIDRs and hostlists shouldn't be a problem.
J