|
SA Bugzilla – Full Text Bug Listing |
Summary: | Migrate to using MIME::Tools | ||
---|---|---|---|
Product: | Spamassassin | Reporter: | Craig Hughes <craig> |
Component: | Libraries | Assignee: | SpamAssassin Developer Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | quinlan, schaefer, shanew |
Priority: | P2 | ||
Version: | 2.30CVS | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Bug Depends on: | |||
Bug Blocks: | 872, 885 |
Description
Craig Hughes
2002-03-25 17:26:07 UTC
*** Bug 18 has been marked as a duplicate of this bug. *** *** Bug 87 has been marked as a duplicate of this bug. *** *** Bug 115 has been marked as a duplicate of this bug. *** Reassigning to list -- originally accepted before bugzilla policy change/clarification What do you want done with MIME::Tools? I can work something together, it is a pretty easy to use module. Subject: Re: [SAdev] Migrate to using MIME::Tools What I want to do is replace all the kludgy base64 decoding and mime parsing hacks currently in the code with calls to MIME::Tools, then intelligently looks a each MIME part and do the right thing with them. Also do things like look at the encodings used, and stuff like that, as we're currently doing, but using the lib instead of our own version thereof so we don't hit all the weird border cases and have trouble with foreign charsets, odd encodings, etc, etc. Subject: Re: [SAdev] Migrate to using MIME::Tools What I want to do is replace all the kludgy base64 decoding and mime parsing hacks currently in the code with calls to MIME::Tools, then intelligently looks a each MIME part and do the right thing with them. Also do things like look at the encodings used, and stuff like that, as we're currently doing, but using the lib instead of our own version thereof so we don't hit all the weird border cases and have trouble with foreign charsets, odd encodings, etc, etc. _______________________________________________ Spamassassin-devel mailing list Spamassassin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spamassassin-devel *** Bug 310 has been marked as a duplicate of this bug. *** Aw bugger. I guess it failed to make it in for 2.30 -- sounds like 3.0 is going to have a bunch of changes to the core parsing stuff, so maybe it'll fit in with that stuff. To quote Shel Silverstein, my favorite poet: Lazy lazy lazy lazy lazy lazy Jane. She wants a drink of water so she waits and waits and waits and waits and waits for it to rain Please make sure the new code does the right thing for uuencoded text (that is, independent whether uuencoded files are part of a MIME section or not) as well. MIME::Tools doesn't look that hard to use, but there's a few things to discuss before I'll take a shot at it. First is that the full tests are given the original message, only modified by removing any non-text attachments. As far as I can tell, MIME::Parser can't be used for that, since it will decode MIME parts with base64, uuencode or Quoted-Printable decodings, so after removing the non-text parts, the text parts will all be decoded. However, among the current full tests, all but the check_signature() and check_for_faraway_charset_in_body() tests use $self->get_full_message_as_text() rather than the $fulltext argument, check_for_faraway_charset_in_body() only needs it to check the MIME headers (which can be done better by using MIME::Tools), and I don't think any signature checking tests need the full, unaltered body. So I would suggest that full tests be given the result of $self->get_full_message_as_text() as their argument, and check_signature() be made a normal body test. I can then start putting in MIME::Tools, and make a new "multipart" test for check_for_faraway_charset_in_body(), which will give it the result of MIME::Parser to play with. I receive quite many spams (~25%) with broken MIME-Boundaries. Eg Content-Type: multipart/mixed; boundary="----=_NextPart_000_00A0_51A14E8D.B2728A86" ... ------=_NextPart_000_00A0_51A14E8D.B2728A86 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: base64 SA triggers MIME_MISSING_BOUNDARY but does parse these right because it just ignores the boundary string and decodes each base64. Seems like Outlook does this too, else that spam wouldn't make any sense. Will MIME::Tools handle these, too? Looks like it deals with missing boundaries; even outputs a fixed-up version for you. That's very nice. Now I can finally read all my spam :) Hmmm... Although this would be nice, SA should not do so only if defang_mime is enabled. Are we going to be doing this for 3.0? The bugzilla version still says 2.30CVS... Subject: Re: [SAdev] Migrate to using MIME::Tools Possibly, but unlikely. SA3 CVS already has it's own MIME mail parser in it that I've tested on a few hundred thousand emails and it seems to work pretty well. Matt. I'm going to go ahead and close this, since I think it's supplanted by the new MIME parsing stuff. It's always nice to clear out very very old tickets. Actually, is there a ticket tracking the new MIME parser, so we can just mark this one as a dupe of that one? Closed, since nobody complained. Couldn't find a dupe. |