Bug 905847 - SpamAssassin rawbody multiline rules do not work in base64 encoded e-mail
Summary: SpamAssassin rawbody multiline rules do not work in base64 encoded e-mail
Keywords:
Status: CLOSED DUPLICATE of bug 906804
Alias: None
Product: Fedora
Classification: Fedora
Component: spamassassin
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kevin Fenzi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 892350
Blocks: 893629
TreeView+ depends on / blocked
 
Reported: 2013-01-30 10:08 UTC by Filip Krska
Modified: 2016-11-28 16:46 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 892350
Environment:
Last Closed: 2016-11-24 22:25:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Comment 1 Filip Krska 2013-03-14 13:46:36 UTC
Reproduced also in latest version on F18.

Need to assess with upstream if RFE (reopen https://issues.apache.org/SpamAssassin/show_bug.cgi?id=3131 ?) is viable or just make the documentation in line with reality.

BR

Filip

+++ This bug was initially created as a clone of Bug #892350 +++

Description of problem:
SpamAssassin rawbody multiline rules do unfortunately not work in base64
encoded e-mails as they should. Two compressed spam samples attached, which
do not match, while the regular expression itself matches properly, if the
base64 is decoded manually.

Put the following three lines into "/etc/mail/spamassassin/local.cf":

rawbody  ETES_TEST_BLIZZARD /<a[^>]+href="http:\/\/[^"]+\/[^"]+\?[^"]+\.battle\.net[^"]+"[^>]*>https:\/\/(us|www)\.battle\.net\/[^<]+<\/a>/i
describe ETES_TEST_BLIZZARD Fraud link for https://(us|www).battle.net/ pointing to a completely other domain
score    ETES_TEST_BLIZZARD 2.0

Running "spamassassin --lint" will confirm that everything is fine with
the syntax.

Version-Release number of selected component (if applicable):
spamassassin-3.3.1-2.el5
spamassassin-3.3.1-2.el6

How reproducible:
Everytime, see above and below.

1. Enable the SpamAssasin rule as above
2. xzcat sample1.eml.xz | spamassassin
3. xzcat sample2.eml.xz | spamassassin
4. xzcat sa-verification.pl.xz | perl
  
Actual results:
SpamAssassin rawbody multiline rule does not work in base64 encoded e-mail.

Expected results:
SpamAssassin rawbody multiline rule works in base64 encoded e-mail.

Additional info:
The problem exists in RHEL 5 and RHEL 6 and might be related to bug #892348,
but right now, I do not treat this as a duplicate.

--- Additional comment from Robert Scheck on 2013-01-06 15:16:58 EST ---

Created attachment 673466 [details] https://bugzilla.redhat.com/attachment.cgi?id=673466
sample1.eml.xz

--- Additional comment from Robert Scheck on 2013-01-06 15:17:28 EST ---

Created attachment 673467 [details] https://bugzilla.redhat.com/attachment.cgi?id=673467
sample2.eml.xz

--- Additional comment from Robert Scheck on 2013-01-06 15:19:33 EST ---

Created attachment 673468 [details] https://bugzilla.redhat.com/attachment.cgi?id=673468
sa-verification.pl.xz

--- Additional comment from Robert Scheck on 2013-01-06 16:21:13 EST ---

We have worked out meanwhile a procedural workaround for this specific case:

ifplugin Mail::SpamAssassin::Plugin::URIDetail
uri_detail ETES_TEST_BLIZZARD raw =~ /^http:\/\/.+\/.+\?.+\.battle\.net.+/  text =~ /^https:\/\/(us|www)\.battle\.net\/.+/
describe   ETES_TEST_BLIZZARD Fraud link for https://(us|www).battle.net/ pointing to a completely other domain
score      ETES_TEST_BLIZZARD 2.0
endif

However, we still expect that rawbody multiline rules do work proper - always.

Comment 2 Filip Krska 2013-03-14 13:47:22 UTC
--- Additional comment from Filip Krska on 2013-01-23 03:51:55 EST ---

My observation so far:

the base64 encoding doesn't matter, reproduced on decoded body too.

The issue reproduces if spamassassin divides the body in chunks (about 15 lines long in our case) so that the multiline (split into 4 lines) string expected to match the rawbody pattern is split into two chunks.

If we decode the body from sample1.eml.xz attachment and delete one line before the ocurrence of the matching string, the rule is matched.

--- Additional comment from Filip Krska on 2013-01-23 10:23:21 EST ---

If i got it right from

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

the purpose of 

split_into_array_of_short_paragraphs()

which splits the body into hardcoded 1k-2k chunks and is used in

get_decoded_body_text_array()

in

Mail/SpamAssassin/Message.pm

is the performance.

But then at least the documentation change after

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

is not accurate.

Comment 3 Fedora End Of Life 2013-04-03 18:00:50 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 4 Filip Krska 2013-10-08 15:34:46 UTC
Reported upstream:

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

Comment 5 Fedora Admin XMLRPC Client 2014-08-08 07:43:09 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 6 Fedora Admin XMLRPC Client 2014-08-08 07:45:38 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Fedora End Of Life 2015-01-09 17:37:42 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Robert Scheck 2015-01-10 15:23:15 UTC
Could somebody please re-assign this to Fedora 21 or Rawhide? This issue is
IMHO still valid.

Comment 9 Filip Krska 2015-01-12 09:40:15 UTC
Kevin, thanks for re-assigning to rawhide.

Comment 10 Jan Kurik 2015-07-15 14:52:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 11 Fedora End Of Life 2016-11-24 10:54:39 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Robert Scheck 2016-11-24 21:57:14 UTC
Could somebody please re-assign this to Fedora 25 or Rawhide? This issue is
IMHO still valid.

Comment 13 Kevin Fenzi 2016-11-24 22:25:52 UTC

*** This bug has been marked as a duplicate of bug 906804 ***

Comment 15 Kevin Fenzi 2016-11-28 16:46:31 UTC
What information are you requesting from me here?


Note You need to log in before you can comment on or make changes to this bug.