SA Bugzilla – Bug 6213
[test] parsing of eval-type rules: allow unquoted domain names, disallow unmatched quotes (test still needed)
Last modified: 2011-05-19 12:03:21 UTC
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; } }
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.
Mark, could you add some tests for those? seems like it should be easy to test, and would be worth testing.
moving most remaining 3.3.0 bugs to 3.3.1 milestone
these were not supposed to go to security! moving back out of that component, but now probably to the wrong components :( , but better than nothing.
reassigning, too
moving all open 3.3.1 bugs to 3.3.2
Moving back off of Security, which got changed by accident during the mass Target Milestone move.
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.