Tue 97-12-30 Vikas Agnihotri <VikasA(_at_)att(_dot_)com> list.procmail
| Jari's pm-tips.txt has the following recipe for counting the size of the
| file in bytes.
|
| :0 B # use HB to measure both head and body
| * 1^1 .
| * 1^1 ^.*$
| { textsize = $= }
|
| 2. If it is needed to count the new-lines, how is it working exactly? What
| about a mail with only 1 line WITHOUT a ending newline? In this case, the
| count of the characters in the line _is_ the content-length, right?
|
| 3. What about empty lines like "\n\n" ? The RE above wont match them,
| right? It needs something like '^$' :-), eh?
Hi Vikas.
You almost got it: yes, the first one count all characters, but "." regexp
won't include newlines.
The second regexp matches "lines", ie. it actually counts newlines as
a side effect. The ".*" matches zero or any number of character in the line,
so it covers the special case "^$".
| 4. Is the recipe 100% accurate that I can replace any existing
| Content-length headers with this score (after using HB to measure both head
| and body of course) and not have any MUA which relies completely on
| Content-Length: honk at me?
Yes. It's 100% accurate and fast.
At least Emacs based MUA's don't rely on Content-Length (VM,RMAIL,MH,GNUS..),
but I have heeard that Sun's mailtool goes beserk. Does anyone know
what elm, pine or mutt etc thinks about Content-Length ?
jari