spamassassin-dev November 2011 archive
Main Archive Page > Month Archives  > spamassassin-dev archives
spamassassin-dev: [Bug 6708] New: Message get_decoded_body_text_

[Bug 6708] New: Message get_decoded_body_text_array() injects empty MIME-part

From: <bugzilla-daemon_at_nospam>
Date: Fri Nov 25 2011 - 23:39:15 GMT
To: dev@spamassassin.apache.org

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6708

             Bug #: 6708
           Summary: Message get_decoded_body_text_array() injects empty
                    MIME-part
           Product: Spamassassin
           Version: 3.3 SVN branch
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Libraries
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: guenther@rudersport.de
    Classification: Unclassified

M::SA::Message get_decoded_body_text_array() injects an empty (chunk of a)
MIME-part between all textual MIME-parts (or their chunks) into the returned
array of strings. Used for rawbody rules.

See this line in the function.

  push(@{$self->{text_decoded}}, "\n") if ( @{$self->{text_decoded}} );

I didn't find any purpose this might serve. However, rawbody rules will
actually be applied against these almost empty strings. No big impact, but
needless RE matching nonetheless.

Moreover, these empty rawbody lines prevent short-body size checks from working
as expected. Non-intuitively, the following rule matches any message with 2
textual MIME-parts, regardless how long.

  rawbody __MIMEPART_LE_200 /^.{0,200}$/s

It matches the injected almost empty string. To prevent that, the minimum needs
to be 2 rather than 0.

There is one caveat: Plugin/BodyEval.pm check_blank_line_ratio(). The ratio of
empty lines is affected by this, since we introduce some empty lines ourself.
Probably not intended, but it will be effected by eliminating these empty lines
between MIME-parts.

-- Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.