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

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: ROGERS Richard
Data:  
Para: 'exim-users@exim.org'
Assunto: Re: [exim] Varying message size limit according to sending host?


-----Original Message-----
From: Phil Pennock [mailto:exim-users@spodhuis.org]

On 2011-09-08 at 18:13 -0400, Phil Pennock wrote:
> On 2011-09-08 at 11:15 +0100, ROGERS Richard wrote:
> > Phil Pennock wrote:
> > =========
> > On 2011-09-08 at 10:14 +0100, ROGERS Richard wrote:
> > > Is it possible to vary the message size limit according to where the message is received from? I've had a bit of a look at this but it appears that message_size_limit is set globally - is this correct, or is there another way?
> >
> > +------------------+---------+-------------+------------+
> > |message_size_limit|Use: main|Type: string*|Default: 50M|
> > +------------------+---------+-------------+------------+
> >
> > "*" => expanded string
> >
> > message_size_limit = ${if
> > match_ip{$sender_host_address}{iplsearch;/some/file}{$value}{50M}}
> >
> > -Phil
> >
> > =========
> >
> > 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 =
>
> The second parameter for the match_ip{}{} expansion condition is a
> restricted hostlist; no hostnames, but otherwise a hostlist. So just
> replace "iplsearch;/some/file" with "+printer_ips" (without quotes)
> and you should be good to go.


Er, wait, not quite; I was tired last night originally had a lookup there, which I switched to match_ip and didn't notice that I'd left $value in place. I'm sorry.

I should have written:

message_size_limit = ${lookup {$sender_host_address}iplsearch{/some/file}{$value}{50M}}

In your case, there's no value associated with the value in a hostlist; it just is present or is not. So you want something like:

message_size_limit = ${if match_ip{$sender_host_address}{+printer_ips}{200M}{50M}}

Sorry for the misinformation.
-Phil
=====
No worries - between your earlier message and the on-line docs, I got it working yesterday afternoon, exactly as you describe above (give or take the actual values). Apologies for not posting back then; I got a bit over-run by other things =8-|

Thanks again, and regards

Richard