You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2017/07/25 00:03:10 UTC

[Bug 7446] New: DKIM-Signature increases URI cont

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

            Bug ID: 7446
           Summary: DKIM-Signature increases URI cont
           Product: Spamassassin
           Version: 3.4 SVN branch
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: spamassassin
          Assignee: dev@spamassassin.apache.org
          Reporter: mysqlstudent@gmail.com
  Target Milestone: Undefined

It appears that when DKIM is involved, any URI in the DKIM-Signature causes
__HAS_ANY_URI to always hit, increasing the total count of URIs listed in the
email. This impacts me by increasing by one my (__KAM_COUNT_URIS >= 1) rules...

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI cont

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

--- Comment #9 from Karsten Bräckelmann <gu...@rudersport.de> ---
*** Bug 7440 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI cont

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

Alex <my...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mysqlstudent@gmail.com

--- Comment #1 from Alex <my...@gmail.com> ---

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=dicomexpress.com; s=google;
        h=date:from:to:message-id:subject:mime-version;
        bh=7c++UH2JFU8XRxiQfAK/XRsTnNpDIn6Hck84MOZPfCo=;
        b=CSUiNh7YfNj2cRMB/MKxKIfaLvGFJic44SJdKJUD2Qy8XArlAFkSk8dALOI5aqy8E3
         LZAr+FCgqmktPLb02Ea8hP8L3KHHtzihVjgVwv4OVr0to+RK0NIAMjacv8zVlm+y+xZI
         LzYUxLWuBKHRZN8iBr+6IBTZh8mGRo/eZyLpU=


Jul 24 19:54:47.738 [16657] dbg: rules: ran uri rule __KAM_COUNT_URIS ======>
got hit: "dicomexpress.com"
Jul 24 19:54:47.738 [16657] dbg: rules: ran uri rule __KAM_COUNT_URIS ======>
got hit: "http://thesamschwartz.com/ONBP132044/"

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI count

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

Bill Cole <sa...@billmail.scconsult.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sa-bugz-20080315@billmail.s
                   |                            |cconsult.com

--- Comment #12 from Bill Cole <sa...@billmail.scconsult.com> ---
(In reply to Karsten Bräckelmann from comment #10)

> To fix this stock sub-rule to hit as intended regardless of parse_dkim_uris
> option, I'm +1 on the proposed change by RW:
> 
>   uri __HAS_ANY_URI  /^\w+:\/\//
> 
> That is, make that test check for a protocol (possibly prepended by SA),
> instead of using /./ to check for its mere existence.

+1

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI count

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

Karsten Bräckelmann <gu...@rudersport.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|DKIM-Signature increases    |DKIM-Signature increases
                   |URI cont                    |URI count

--- Comment #10 from Karsten Bräckelmann <gu...@rudersport.de> ---
For reference, see bug 6700 (disabling this behavior) and bug 7087 (adding it
back in as option parse_dkim_uris) and their discussions.


(In reply to Alex from comment #0)
> It appears that when DKIM is involved, any URI in the DKIM-Signature causes
> __HAS_ANY_URI to always hit, increasing the total count of URIs listed in
> the email. This impacts me by increasing by one my (__KAM_COUNT_URIS >= 1)
> rules...

Please note that this initial report is not correct as stated. The observed
behavior is not due to the existence of DKIM headers, but those headers with
the parse_dkim_uris option enabled.

While potentially confusing, the behavior is exactly as documented: Enabling
parse_dkim_uris results in DKIM headers being "parsed for URIs to process
alongside URIs found in the body with some rules and moduels", see M::SA::Conf.

It is also worth pointing out, that this option is enabled as part of
third-party rules and configuration, and effects a custom rule. Generally
outside this bugzilla's scope.


There is one side to this though, that definitely could be considered a SA
issue: The stock __HAS_ANY_URI sub-rule is affected by this behavior. While
adding the domain found in the DKIM header for uri tests by this option is
intended and exactly as documented, it most likely is *not* intended that uri
rule to fire on the DKIM header domain without any other domain in a textual
part.

The work around mentioned by RW in comment 6 and duplicate bug 7440 should fix
this immediate issue: Domains parsed from textual parts are added to the uri
lists in multiple variants, including with and without a protocol. The domain
parsed from the DKIM header is bare only, no protocol prepended.

To fix this stock sub-rule to hit as intended regardless of parse_dkim_uris
option, I'm +1 on the proposed change by RW:

  uri __HAS_ANY_URI  /^\w+:\/\//

That is, make that test check for a protocol (possibly prepended by SA),
instead of using /./ to check for its mere existence.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI cont

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

--- Comment #8 from RW <rw...@googlemail.com> ---

One caveat, with  an HTML link without a protocol you get both versions
so for <a href="example.com">test</a>

__ALL_URI ======> got hit: "http://example.com"
__ALL_URI ======> got hit: "example.com"

with plain  "\nexample.com" it's simply

__ALL_URI ======> got hit: "http://example.com"

This  doesn't affect the detection of a link though.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI count

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

Giovanni Bechis <gi...@paclan.it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovanni@paclan.it

--- Comment #13 from Giovanni Bechis <gi...@paclan.it> ---
Created attachment 5557
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5557&action=edit
rule fix

Rule fix as suggested by RW.
As a second step __HAS_ANY_URI and __DOS_HAS_ANY_URI could be merged in a
single rule fixing meta rules accordingly.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI cont

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

--- Comment #5 from Alex <my...@gmail.com> ---
Yes, this was from back around Jun 20th, but I forgot to file a bug report
then.

There was also something relating to parse_dkim_uris=1 that is specified in the
KAM.cf rules that causes this to happen. Users without this setting (or the
KAM.cf file) are not impacted by this.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI cont

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

John Hardin <jh...@impsec.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jhardin@impsec.org

--- Comment #4 from John Hardin <jh...@impsec.org> ---
I seem to remember this being discussed about a week back, and there being a
note on the original bugzilla ticket that added URI capture from the DKIM
header recognizing this behavior.

I remember suggesting maybe there needs to be a segregated URI list for the
ones captured from DKIM so they are used in URIBL lookups but are not visible
to URI rules...

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI cont

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

RW <rw...@googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rwmaillists@googlemail.com

--- Comment #6 from RW <rw...@googlemail.com> ---
As I pointed out in the user list, it's easy to tell them apart as domains in
the body are prepended with  http://, domains from DKIM signatures aren't.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI count

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

--- Comment #11 from Karsten Bräckelmann <gu...@rudersport.de> ---
(In reply to documentation quote from comment #10)
> alongside URIs found in the body with some rules and moduels", see
> M::SA::Conf.

Typo in the documentation fixed: revision 1804259 trunk and revision 1804260
stable branch.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI cont

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

Kevin A. McGrail <km...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kmcgrail@apache.org

--- Comment #2 from Kevin A. McGrail <km...@apache.org> ---
Hi Alex, So do any other headers increase the URI_COUNT?  My guess is no as
they shouldn't.  It's an interesting bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI cont

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

Benny Pedersen <me...@junc.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |me@junc.eu

--- Comment #7 from Benny Pedersen <me...@junc.eu> ---
http://foo,example.org
bar.example.net

sa see them all as url

why is it a problem dkim domain is part of url testing ?

also headers is url tested, i dont see this as a bug, but a hidded feature

we could make the dkim if valid au say use this info on same premiss as url
skipped if dkim is local whitelisted not just whitelisted

imho change it will open a can of worms without any benefit to have it working
better then it already does

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI cont

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

--- Comment #3 from Alex <my...@gmail.com> ---
No, I don't believe other headers affect this. I've tested it with SPF.

As a temporary work-around, I've created separate rules that adjust plus/minus
one for with/without the existence of __DKIM_EXISTS.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7446] DKIM-Signature increases URI count

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7446

Giovanni Bechis <gi...@paclan.it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #14 from Giovanni Bechis <gi...@paclan.it> ---
Committed in r1826769.

-- 
You are receiving this mail because:
You are the assignee for the bug.