Re: [EXIM] message_size ?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Pieter Immelman
CC: exim-users
Subject: Re: [EXIM] message_size ?
On Sun, 23 Nov 1997, Pieter Immelman wrote:

> Just ran into one small snag today. Want to add Content-Length headers
> to the messages, but I must be doing it wrong, since I don't get the
> correct values:


My understanding is that Content-Length is deprecated, mainly because
its definition is unclear. (Do you, or do you not, count the character
or characters used to delimit lines? What if some things in headers get
changed by quoting/unquoting as messages pass through different regimes?
And stuff like that.)

> add_headers = "Content-Length: $message_size",


Oh dear. $message_size is not precise; it was intended for gross kind of
checking like "is this message over 20K?" and not for precision. The
manual is not at all clear on this point; I will try to improve it.

> This message contains the single word "hello". So where is the 288
> coming from? Unless "message_size" means size of message including
> the headers?


Yes, it includes the headers that are stored on the spool with the
message.

> >From root@??? Sun Nov 23 00:07:07 1997
> >Return-path: <root@???>
> >Envelope-to: x@???
> >Delivery-date: Sun, 23 Nov 1997 00:07:07 +0200
> >Received: from root by ns1.atio.co.za with local (Exim 1.73 #2)
> >        id 0xZNQo-0005Wx-00; Sat, 22 Nov 1997 23:49:41 +0200
> >Message-Id: <E0xZNQo-0005Wx-00@???>
> >From: Super-User <root@???>
> >To: x@???
> >Date: Sat, 22 Nov 1997 23:49:41 +0200
> >Content-Length: 288

> >
> >hello
> >
>
> Now this message is 453 characters, so where is the 288 coming from?


What was stored on the spool would have been

Received: from root by ns1.atio.co.za with local (Exim 1.73 #2)
        id 0xZNQo-0005Wx-00; Sat, 22 Nov 1997 23:49:41 +0200
Message-Id: <E0xZNQo-0005Wx-00@???>
From: Super-User <root@???>
To: x@???
Date: Sat, 22 Nov 1997 23:49:41 +0200


hello

which is 277 bytes when I copy it to a file. The additional 11 could
have been trailing spaces or additional newlines after the hello. Or a
bug in Exim, of course...

Oh, hang on. I can see where this arises. Exim just adds the size of the
body file to what it has got for the headers. The body file nowadays
contains its own name at the front, so that would make the number 17 too
big. Hmm; 270 is even smaller then 288.

I'll check up that Exim is actually doing what it is supposed to do
here.

> Now if message_size is not what I hoped it was, is there something like
> the message_body_size? In fact, the more I read TFM, the more certain
> I am that what I'm trying to do is not possible (yet :). Help?


There could be $message_body_size, I suppose, but I really wouldn't
advise you to tangle with Content-Length.


-- 
Philip Hazel                   University Computing Service,
ph10@???             New Museums Site, Cambridge CB2 3QG,
P.Hazel@???          England.  Phone: +44 1223 334714




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