rmail header needs adjusting offset

Stefan Bellon sbellon at sbellon.de
Wed Dec 17 14:46:36 CET 2003


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

> > 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.

[snip]

> > Any ideas?

> Good!  You're considering the various additional complications.  I
> think it's going to get messy :-(

Hm.

> The firstline flag will need to be initialized with each message. 
> The corrected length will need to use the seen_subj flag.  You'll
> also need to allow for spam_subject_tag, unsure_subject_tag, and the
> X-Bogosity line.  

> If you force passthrough mode to keep the message in memory, it might
> make it easier.  That would give you access to all the lines, allow
> changes, counting characters, etc.

What about this idea: In write_header, do one pass over the header just
to find out by how much the header gets longer than the original one
and remember the difference. Then do the following:

    switch (passmode) {
        case PASS_MEM:
            *((textdata_t**)rfarg) = textblock_head();
            break;
        case PASS_SEEK:
            rewind(rfarg);
            break;
        default:
            abort();
    }

Afterwards, use the code that is in write_header at present and add the
above stored difference to the rmail header like you suggested earlier.

Would this work?

-- 
Stefan Bellon




More information about the bogofilter-dev mailing list