https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7358
Bug ID: 7358
Summary: MIMEHeader problem: Content-Type: multipart/mixed with
an empty part
Product: Spamassassin
Version: 3.4.1
Hardware: Sun
OS: Solaris
Status: NEW
Severity: major
Priority: P2
Component: Plugins
Assignee: [email protected]
Reporter: [email protected]
Created attachment 5409
--> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5409&action=edit
Sample e-mail where SpamAssassin failed to detect a Zip file attachment.
We have a set of custom rules that use the mimeheader directive, one of which
is:
mimeheader __ZIP_CONTENT_TYPE_1 Content-Type =~ /\bapplication\/zip;/
This plugin will work most of the time, but is not always catching attachments
with this Content-Type. An e-mail that got through our filter is attached
(mimeheader.eml). The e-mail has a Content-Type of multipart/mixed, with a
boundary. Between each boundary are the following parts:
Part 1: Content-Type: multipart/alternative;
boundary="6479071-26388092-1648650284=:2907"
Part 2: Content-Type: text/plain; charset="windows-1252"
Part 3: Content-Type: text/html; charset="windows-1252"
Part 4: (Empty)
Part 5: Content-Type: application/zip; name="Copy of
img-8913555729.jpg.zip"
Running this sample e-mail through "spamassassin -D" shows that the mime parser
detects parts 1-3, but not parts 4 and 5:
Oct 10 11:54:22.460 [13693] dbg: message: ---- MIME PARSER START ----
Oct 10 11:54:22.460 [13693] dbg: message: parsing multipart, got boundary:
6479071-26388092-1648650284=:2907
Oct 10 11:54:22.460 [13693] dbg: message: found part of type
multipart/alternative, boundary: 6479071-26388092-1648650284=:2907
Oct 10 11:54:22.460 [13693] dbg: message: added part, type:
multipart/alternative
Oct 10 11:54:22.460 [13693] dbg: message: found part of type text/plain,
boundary: 6479071-26388092-1648650284=:2907
Oct 10 11:54:22.460 [13693] dbg: message: added part, type: text/plain
Oct 10 11:54:22.460 [13693] dbg: message: found part of type text/html,
boundary: 6479071-26388092-1648650284=:2907
Oct 10 11:54:22.461 [13693] dbg: message: added part, type: text/html
Oct 10 11:54:22.461 [13693] dbg: message: parsing multipart, got boundary:
6479071-26388092-1648650284=:2907
Oct 10 11:54:22.461 [13693] dbg: message: parsing normal part
Oct 10 11:54:22.461 [13693] dbg: message: storing a body to memory
Oct 10 11:54:22.461 [13693] dbg: message: parsing normal part
Oct 10 11:54:22.461 [13693] dbg: message: storing a body to memory
Oct 10 11:54:22.461 [13693] dbg: message: ---- MIME PARSER END ----
Oct 10 11:54:22.462 [13693] dbg: message: decoding quoted-printable
Oct 10 11:54:22.462 [13693] dbg: message: decoding quoted-printable
Oct 10 11:54:22.462 [13693] dbg: message: 'normalize_charset' is off,
encoding will likely be misinterpreted; declared charset: windows-1252
When I manually remove part 4, the mimeheader directive detects the
Content-Type in the multipart/mixed message:
Oct 10 14:03:23.556 [28654] dbg: message: ---- MIME PARSER START ----
Oct 10 14:03:23.556 [28654] dbg: message: parsing multipart, got boundary:
6479071-26388092-1648650284=:2907
Oct 10 14:03:23.556 [28654] dbg: message: found part of type
multipart/alternative, boundary: 6479071-26388092-1648650284=:2907
Oct 10 14:03:23.556 [28654] dbg: message: added part, type:
multipart/alternative
Oct 10 14:03:23.556 [28654] dbg: message: found part of type text/plain,
boundary: 6479071-26388092-1648650284=:2907
Oct 10 14:03:23.556 [28654] dbg: message: added part, type: text/plain
Oct 10 14:03:23.557 [28654] dbg: message: found part of type text/html,
boundary: 6479071-26388092-1648650284=:2907
Oct 10 14:03:23.557 [28654] dbg: message: added part, type: text/html
Oct 10 14:03:23.569 [28654] dbg: message: found part of type
application/zip, boundary: 6479071-26388092-1648650284=:2907
Oct 10 14:03:23.569 [28654] dbg: message: added part, type: application/zip
Oct 10 14:03:23.570 [28654] dbg: message: parsing multipart, got boundary:
6479071-26388092-1648650284=:2907
Oct 10 14:03:23.571 [28654] dbg: message: parsing normal part
Oct 10 14:03:23.571 [28654] dbg: message: storing a body to memory
Oct 10 14:03:23.571 [28654] dbg: message: parsing normal part
Oct 10 14:03:23.571 [28654] dbg: message: storing a body to memory
Oct 10 14:03:23.571 [28654] dbg: message: parsing normal part
Oct 10 14:03:23.571 [28654] dbg: util: secure_tmpfile created a temporary
file /tmp/.spamassassin28654t6QWFAtmp
Oct 10 14:03:23.571 [28654] dbg: message: storing a message part to file
/tmp/.spamassassin28654t6QWFAtmp
Oct 10 14:03:23.575 [28654] dbg: message: ---- MIME PARSER END ----
--
You are receiving this mail because:
You are the assignee for the bug.