Re: [EXIM] Exim imposed quotas

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Philip Hazel
Fecha:  
A: zilbauer
Cc: exim-users
Asunto: Re: [EXIM] Exim imposed quotas
On Thu, 10 Sep 1998, Robert Zilbauer wrote:

> I've been playing around with Exim imposed quotas and haven't had much luck
> getting them to work. Perhaps someone can point out what I'm doing wrong?


Which operating system?

> lookup yielded: 20k
>
> The delivery proceeded with --
>
> appendfile transport entered
> appendfile: mode=600 notify_comsat=0 quota=572579840
> file=/var/spool/mail/cpl
>
> Looking at that quota value, I'm guessing my value was discarded?


When I tried this, it said "quota=20480". I'm asking which operating
system because the code that turns the quota text into an integer uses
floating point arithmetic (to allow for strings like "3.5M"), and maybe
there is some difference there that is screwing things up. Look at the
code around line 195 of transports/appendfile.c. It looks like this:

d = strtod(s, &rest);                  
if (tolower(*rest) == 'k') { d *= 1024.0; rest++; }                         
if (tolower(*rest) == 'm') { d *= 1024.0*1024.0; rest++; }
while (isspace(*rest)) rest++;     


if (*rest != 0)                                                                
  {                                                                        
  *errmsg = string_sprintf("Malformed quota setting \"%s\" for "               
    "%s transport", s, tblock->name);   
  return FAIL;                                                                 
  }                                          


ob->quota_value = (int)d;                                  


... where s contains the string you have looked up, that is, "20k". I
think the thing to do would be to insert some printing statements into
that code to check that the correct values are being put into the double
variable d and that it is then correctly being cast back into an int at
the end.


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



--
*** Exim information can be found at http://www.exim.org/ ***