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 2009/09/30 16:51:03 UTC

[Bug 6213] New: parsing of eval-type rules: allow unquoted domain names, disallow unmatched quotes

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

           Summary: parsing of eval-type rules: allow unquoted domain
                    names, disallow unmatched quotes
           Product: Spamassassin
           Version: 3.3.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Libraries
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: Mark.Martinec@ijs.si


Instead of re-opening Bug 4419, here is a new entry.

Conf::Parser::pack_eval_method currently uses the following regexp:
  s/^\s*(?:['"](.*?)['"]|([\d\.:A-Za-z]+?))\s*(?:,\s*|$)//

1. The above allows most domain names to be given as arguments to eval rule
in unquoted form, except for domains with dashes. I propose we also allow
a minus in the character set, so that one can do:
  full T9 eval:check_dkim_valid(gmail.com, cc.yahoo-inc.com, yahoo.com)
instead of:
  full T9 eval:check_dkim_valid(gmail.com, 'cc.yahoo-inc.com', yahoo.com)

2. The current regexp allows argument with mismatched quotes like
'foo.com", and does now make it possible to specify a ' or " within
the quoted argument, e.g. "foo',bar" or 'foo",bar'.

Here is a proposed change to deal with both:

<<<
    while ($args =~ s/^\s*(?:['"](.*?)['"]|([\d\.:A-Za-z]+?))\s*(?:,\s*|$)//) {
      if (defined $1) {
        push @args, $1;
      }
      else {
        push @args, $2;
      }
    }

>>>
    local($1,$2,$3);
    while ($args =~ s/^\s* (?: (['"]) (.*?) \1 | ( [\d\.:A-Za-z-]+? ) )
                       \s* (?: , \s* | $ )//x) {
      if (defined $2) {
        push @args, $2;
      }
      else {
        push @args, $3;
      }
    }

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

[Bug 6213] parsing of eval-type rules: allow unquoted domain names, disallow unmatched quotes (test still needed)

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|parsing of eval-type rules: |parsing of eval-type rules:
                   |allow unquoted domain       |allow unquoted domain
                   |names, disallow unmatched   |names, disallow unmatched
                   |quotes                      |quotes (test still needed)

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

[Bug 6213] parsing of eval-type rules: allow unquoted domain names, disallow unmatched quotes

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|Undefined                   |3.3.0

--- Comment #1 from Mark Martinec <Ma...@ijs.si> 2009-09-30 08:01:29 PDT ---
Bug 6213: parsing of eval-type rules: allow unquoted
  domain names, disallow unmatched quotes
Sending        lib/Mail/SpamAssassin/Conf/Parser.pm
Sending        lib/Mail/SpamAssassin/Plugin/DKIM.pm
Committed revision 820289.

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

[Bug 6213] [test] parsing of eval-type rules: allow unquoted domain names, disallow unmatched quotes (test still needed)

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Group|security                    |
          Component|Security                    |Libraries
         AssignedTo|security@spamassassin.apach |dev@spamassassin.apache.org
                   |e.org                       |

--- Comment #8 from Karsten Bräckelmann <gu...@rudersport.de> 2010-03-23 17:42:17 UTC ---
Moving back off of Security, which got changed by accident during the mass
Target Milestone move.

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

[Bug 6213] [test] parsing of eval-type rules: allow unquoted domain names, disallow unmatched quotes (test still needed)

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

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|parsing of eval-type rules: |[test] parsing of eval-type
                   |allow unquoted domain       |rules: allow unquoted
                   |names, disallow unmatched   |domain names, disallow
                   |quotes (test still needed)  |unmatched quotes (test
                   |                            |still needed)

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

[Bug 6213] [test] parsing of eval-type rules: allow unquoted domain names, disallow unmatched quotes (test still needed)

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

Mark Martinec <Ma...@ijs.si> changed:

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

--- Comment #9 from Mark Martinec <Ma...@ijs.si> 2011-05-19 12:03:21 UTC ---
Seems noone ( :-} ) is willing to write a test for this rather trivial
change. As the fix is in 3.3 and in trunk and has already proven itself,
I'll just close it. Please reopen if someone wants to insist on
having a test.

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

[Bug 6213] parsing of eval-type rules: allow unquoted domain names, disallow unmatched quotes (test still needed)

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

Justin Mason <jm...@jmason.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|security@spamassassin.apach |dev@spamassassin.apache.org
                   |e.org                       |

--- Comment #6 from Justin Mason <jm...@jmason.org> 2010-01-27 03:16:00 UTC ---
reassigning, too

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

[Bug 6213] parsing of eval-type rules: allow unquoted domain names, disallow unmatched quotes

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

Justin Mason <jm...@jmason.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jm@jmason.org

--- Comment #2 from Justin Mason <jm...@jmason.org> 2009-09-30 08:15:58 PDT ---
Mark, could you add some tests for those?  seems like it should be easy to
test, and would be worth testing.

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