SA Bugzilla – Bug 1595
Someone broke BSMTP mode
Last modified: 2003-03-28 04:28:39 UTC
At some point, the meaning of the struct message is_spam field has changed. In particular, it used to be that the field was EX_ISSPAM if the message is spam, EX_NOTSPAM if the message is not spam, or EX_TOOBIG if we return a filtered message instead of a boolean is or is not spam (yes, i should have named it something more obvious than either is_spam or EX_TOOBIG. Sorry.) This appears to be in response to bug #1452. Unforunately, whoever "fixed" that bug didn't bother to notice that message_write uses this fact to determine whether to output only the CHECK_ONLY score (without any BSMTP headers), or to shove the filtered message back into the BSMTP envelope for output to the next process in line. The end result is that--instead of outputting a valid BSMTP file--it outputs the raw message even in BSMTP mode, which makes 'exim -bS' choke and causes ALL my mail to bounce. Congradulations, you've created a critical bug (i.e. loss of data with no easy workaround other than "don't use spamc"). I don't have time these days to fix it myself, except for a quick hack locally (i've broken -c so -B works). But i suggest someone look into adding some flag or another so message_write can determine whether it needs to produce CHECK_ONLY output or do full output processing. And add a test to see that -B actually outputs BSMTP output when -c is not given.
eh, crap -- I missed this during the move. it's a biggie, and we should have fixed it for 2.51. :( 2.52 it is then. BTW this will probably need a tester who uses -B. anomie, you OK to test any patches I may produce?
nope. 2.53. doh.
anomie, (or any other BSMTP user), could you test this patch? if it fixes it, I'll apply throughout and it'll be in 2.53. It adds a new EX_ type, EX_OUTPUTMESSAGE, and uses that when message_write() should output a message, and sets that for the non-SPAMC_CHECK_ONLY case. I've also figured out what a BSMTP transaction looks like ;) and added a "t" script, "spamc_B.t".
Created attachment 813 [details] fixes bsmtp
taking the bug
OKAY: I'm not really familiar with the code, but it looks okay to me.
BTW: is this ready for inclusion? there's no keyword set.
Subject: Re: Someone broke BSMTP mode > BTW: is this ready for inclusion? there's no keyword set. I want to get approval from anomie (or someone else using BSMTP) first. --j.
2.53 is due out RSN, so this is being pushed to 2.54
Subject: Re: Someone broke BSMTP mode On Thu, Mar 27, 2003 at 11:07:18AM -0800, bugzilla-daemon@hughes-family.org wrote: > > I want to get approval from anomie (or someone else using BSMTP) first. Works for me, but you'll probably get complaints from others about the is_spam field being useless again... Perhaps something like this? #define EX_ISSPAM_MASK 1 #define EX_OUTPUTMESSAGE_MASK 0x400 #define EX_NOTSPAM (0 | 0) #define EX_ISSPAM (EX_ISSPAM_MASK | 0) #define EX_OUTPUTMESSAGE_NOTSPAM (0 | EX_OUTPUTMESSAGE_MASK) #define EX_OUTPUTMESSAGE_ISSPAM (EX_OUTPUTMESSAGE_MASK | EX_ISSPAM_MASK) It's either that or add a new internal field to struct message. Hmmm... BTW, you might want to check for flags&SPAMC_REPORT, SPAMC_REPORT_IFSPAM, or SPAMC_SYMBOLS, and not return those as output messages (IOW, treat them like SPAMC_CHECK_ONLY as far as message_write() is concerned).
Subject: Re: Someone broke BSMTP mode > Hmmm... BTW, you might want to check for flags&SPAMC_REPORT, > SPAMC_REPORT_IFSPAM, or SPAMC_SYMBOLS, and not return those as output > messages (IOW, treat them like SPAMC_CHECK_ONLY as far as > message_write() is concerned). gross ;) What I think I'll do is apply patch as-is for 2.53, ignore the is_spam thing not being set for certain modes (because that's how it worked in 2.4x anyway), and in 2.60 expand the struct message to allow this to be done less kludgily. (I'll also include room for an expansion field in the struct message to keep binary compat from then on.) --j.
oh BTW -- just to make it clear -- the m.is_spam field is not broken by this patch. it just goes back to what it did in 2.4x, which is have a special type to indicate "the result from the operation is in the 'out' string as a full message, instead of using this boolean to indicate spam/nonspam status". This is what's documented in the API, and it's what -B requires. So there's no breakage from this patch.
alright! Just in time for 2.53... now checked in on that branch.