rmail header needs adjusting offset

Stefan Bellon sbellon at sbellon.de
Wed Dec 17 13:49:39 CET 2003


David Relson wrote:
> On Wed, 17 Dec 2003 13:24:48 +0100
> Stefan Bellon <sbellon at sbellon.de> wrote:

[snip]

> > I therefore need to add the length of that line to the rmail line
> > before writing it back in passthrough mode.
> > 
> > What's the correct place in Bogofilter to do that? write_header() in
> > passthrough.c?

> That sounds right.  I'd probably do it with code like:

> static bool firstline = true;
> if (firstline) {
>    firstline = false;
>    if (!memcmp(text, "#! rmail", ...))
>       fputs(text);
>    else {
>       uint len = ...
>       fprintf(...,"#! rmail ...", len);
>   }
> }

But if I do that somewhere in the middle of write_header, then I still
cannot be right all the time because the length varies depending on
seen_subj. It would be better if either

a) a Subject: line was inserted already in bogoreader if it's missing

or

b) a flag got set during reading that no Subject: line is present (I'm
   however not sure whether this would work for mailboxes and not only
   for single mail messages).

Of course, we're only talking about passthrough mode here.

Any ideas?

-- 
Stefan Bellon




More information about the bogofilter-dev mailing list