"Marc G. Fournier" wrote:
> 
> I'm playing with the spam extension, and for POP3 users, I want to add, at
> its simplist, a 'X-Spam-Check: True' header to the email if its spam ...
> I've done some quick reads of the various drafts, and there appears to be
> no way of doing this within Sieve ... has anyone worked on something like
> this?
> 
> I've thought to modify the code, to extend the spam extension, so that it
> adds a simple:
> 
> X-Spam-Score: <True/False> <score> / <threshold>
> 
> so that if spam is enabled, then it auto-adds this header, but I can't
> find where in the code to actually add this ... The X-Sieve header is
> added in lmtpd.c, but before the scoring happens, so that doesn't help ...
> fillin_header() in sieve/script.c looks good, and is after the spam checks
> are run/scored, but am not 100% certain of how I should call add_header()
> for the above ...
> 
> Can anyone provide some insight on this?

It will be pretty difficult.  The current design of lmtpd/sieve was
never meant to do this.  The message is already spooled (in the staging
area of the first recipient) by the time the sieve filter is run.  You'd
have to have a callback which adds the headers to a NEW spool file and
then have lmtpd copy over the test of the existing message to this NEW
file when done (unless you can find some slick way of inserting data
into the head of a file).  You'd be adding a second message copy, which
I recently spent time correcting (messages used to be spooled to /tmp
and then copied to the stage).

I know the code pretty well, and personally I wouldn't even attempt it. 
Of course, I'm not a fan of the spam extension.

Ken
-- 
Kenneth Murchison     Oceana Matrix Ltd.
Software Engineer     21 Princeton Place
716-662-8973 x26      Orchard Park, NY 14127
--PGP Public Key--    http://www.oceana.com/~ken/ksm.pgp

Reply via email to