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/11/24 12:45:21 UTC

[Bug 6241] New: mkrules does not understand newer options and 'else'

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

           Summary: mkrules does not understand newer options and 'else'
           Product: Spamassassin
           Version: 3.3.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Building & Packaging
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: Mark.Martinec@ijs.si


Just so that it does not get forgotten:

On Friday November 20 2009 05:58:43 Apache Hudson Server wrote:
> See
>  <http://hudson.zones.apache.org/hudson/job/SpamAssassin-trunk/4361/changes
> Changes: 
> [khopesh] selections from my sa-update channels
> rulesrc/sandbox/wtogami/20_unsafe.cf: 0 active rules, 6 other
> rulesrc/sandbox/wtogami/20_vanity.cf: 0 active rules, 21 other
> lint: config: found else without matching conditional at build/mkrules line
>  253.
> 
> ERROR: LINT FAILED, suppressing output: rules/72_active.cf
> rules/72_active.cf: no rules promoted

That diagnostics is terribly useless!


hacked 20_khop_bl.cf, looks like the 'mkrules' does not understand an 'else'!?
Sending rulesrc/sandbox/khopesh/20_khop_bl.cf
Transmitting file data .
Committed revision 882811.

Looks like mkrules needs to be fixed.


Uncommenting in mkrules the:
  warn "unknown line in rules file '$f', saving to default: $orig";
reveals lots of warnings, such as unrecognized directives:

replace_rules
replace_tag
redirector_pattern
replace_inter
def_whitelist_from_rcvd

and the 'else', as in case of 20_khop_bl.cf, causing the make failure.

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

--- Comment #16 from Mark Martinec <Ma...@ijs.si> 2010-05-29 13:14:23 EDT ---
> Targeting to 3.3.2. Looks like target was changed to 3.4.0 instead of 3.3.2
> by mistake, this is already committed to trunk (future 3.4 branch)
> Note this is now ready to commit to 3.3 branch.

I moved target to 3.4 intentionally, solely based on the sheer size
of this change, assuming that 3.3.2 would only be a minor release.
I already voted a +1 on a 3.3, so I'd let Justin decide and roll-in
the patch.

-- 
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 6241] mkrules does not understand newer options and 'else'

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

--- Comment #3 from Mark Martinec <Ma...@ijs.si> 2009-12-16 04:46:15 UTC ---
> yep, this is pretty serious brokenness.

Actually, not only that it does not understand a nested if.
I tried replacing nested 'if's with four independent ifs
( rulesrc/sandbox/khopesh/20_khop_bl.cf ) :

if plugin(Mail::SpamAssassin::Plugin::SPF) &&
plugin(Mail::SpamAssassin::Plugin::DKIM)
  meta   __NOT_SPOOFED  ALL_TRUSTED || SPF_PASS || DKIM_VALID
endif
if plugin(Mail::SpamAssassin::Plugin::SPF) &&
!plugin(Mail::SpamAssassin::Plugin::DKIM)
  meta   __NOT_SPOOFED  ALL_TRUSTED || SPF_PASS
endif
if !plugin(Mail::SpamAssassin::Plugin::SPF) &&
plugin(Mail::SpamAssassin::Plugin::DKIM)
  meta   __NOT_SPOOFED  ALL_TRUSTED || DKIM_VALID
endif
if !plugin(Mail::SpamAssassin::Plugin::SPF) &&
!plugin(Mail::SpamAssassin::Plugin::DKIM)
  # Neither DKIM nor SPF ... ugh.
  meta   __NOT_SPOOFED  ALL_TRUSTED
endif
tflags   __NOT_SPOOFED  nice


and the:
  perl build/mkrules --exit_on_no_src --src rulesrc --out rules \
    --manifest MANIFEST --manifestskip MANIFEST.SKIP
produced the following single 'if' in rules/72_active.cf:

if plugin(Mail::SpamAssassin::Plugin::SPF) &&
plugin(Mail::SpamAssassin::Plugin::DKIM)
  meta   __NOT_SPOOFED  ALL_TRUSTED || SPF_PASS || DKIM_VALID
  meta   __NOT_SPOOFED  ALL_TRUSTED || SPF_PASS
  meta   __NOT_SPOOFED  ALL_TRUSTED || DKIM_VALID
  meta   __NOT_SPOOFED  ALL_TRUSTED
tflags   __NOT_SPOOFED  nice
endif

-- 
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 6241] mkrules does not understand newer options and 'else'

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

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

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

--- Comment #7 from Justin Mason <jm...@jmason.org> 2010-01-27 03:16:28 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 6241] [review] mkrules does not understand newer options and 'else'

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

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 #13 from Karsten Bräckelmann <gu...@rudersport.de> 2010-03-23 17:42:48 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 6241] mkrules does not understand newer options and 'else'

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
                 CC|                            |jm@jmason.org

--- Comment #2 from Justin Mason <jm...@jmason.org> 2009-12-07 12:56:40 UTC ---
yep, this is pretty serious brokenness.

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

--- Comment #10 from Warren Togami <wa...@togami.com> 2010-03-11 03:31:58 UTC ---
Is this vote for 3.3.x?

Will this result in 3.3.0 channel updates that remain compatible with 3.3.0?

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|mkrules does not understand |[review] mkrules does not
                   |newer options and 'else'    |understand newer options
                   |                            |and 'else'
  Status Whiteboard|                            |needs 2 votes

--- Comment #8 from Justin Mason <jm...@jmason.org> 2010-01-27 14:08:31 UTC ---
checked in on trunk:

: 130...; svn commit -m "bug 6241: build/mkrules needs to support nested
conditionals and 'else'"
Sending        MANIFEST
Sending        build/mkrules
Sending        rulesrc/sandbox/khopesh/20_khop_bl.cf
Adding         t/mkrules_else.t
Transmitting file data ....
Committed revision 903860.

please vote for checkin to 3.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 6241] mkrules does not understand newer options and 'else'

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

--- Comment #5 from Justin Mason <jm...@jmason.org> 2010-01-20 10:03:05 UTC ---
Created an attachment (id=4653)
 --> (https://issues.apache.org/SpamAssassin/attachment.cgi?id=4653)
working fix

I'm working on the fix for this.  Here's the current state of play; pending
'make test' and a bit of eyeballing, it probably works.

I'm not sure about checking it in straight away, though, as it's a very big
change to mkrules just before release.  But it may be necessary to fix the
other mkrules bug just uncovered.  It fixes several bugs in that script,
particularly surrounding "ifplugin" scopes.

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

Sidney Markowitz <si...@sidney.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sidney@sidney.com
   Target Milestone|3.4.0                       |3.3.2

--- Comment #15 from Sidney Markowitz <si...@sidney.com> 2010-05-25 19:21:20 EDT ---
Targeting to 3.3.2. Looks like target was changed to 3.4.0 instead of 3.3.2 by
mistake, this is already committed to trunk (future 3.4 branch)

Note this is now ready to commit to 3.3 branch.

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

--- Comment #18 from Mark Martinec <Ma...@ijs.si> 2011-05-09 17:25:57 UTC ---
3.3:
$ svn ci -m 'forgot to "svn add" the t/mkrules_else.t'
  Adding t/mkrules_else.t
Committed revision 1101121.

-- 
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 6241] mkrules does not understand newer options and 'else'

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P5                          |P3
   Target Milestone|3.3.1                       |3.3.0
           Severity|minor                       |normal

--- Comment #1 from Mark Martinec <Ma...@ijs.si> 2009-12-07 08:19:25 UTC ---
Don't know much about 'build/mkrules', except that it does not handle well
the nested if/else/endif in rules. The rulesrc/sandbox/khopesh/20_khop_bl.cf
is currently clobbered (by me - partly commented out) to at least pass syntax
checks (lint), but as a result we have a duplicate rule __NOT_SPOOFED in
72_active.cf and in the published tarball.

I'm changing target to 3.3.0 and bringing up priority.

Either the build/mkrules should be fixed (and 20_khop_bl.cf restored),
or nested ifs should be banned from rules and 20_khop_bl.cf (and
72_active.cf) changed accordingly.

Btw, the DKIM_VERIFIED in 20_khop_bl.cf should be renamed to DKIM_VALID
(because the DKIM_VERIFIED has a score 0 now, so the meta rule __NOT_SPOOFED
in 72_active.cf produces a warning).

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

Kevin A. McGrail <km...@pccc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kmcgrail@pccc.com
  Status Whiteboard|needs 1 more vote           |ready to commit

--- Comment #14 from Kevin A. McGrail <km...@pccc.com> 2010-05-25 17:53:23 EDT ---
(In reply to comment #11)
> (In reply to comment #10)
> > Is this vote for 3.3.x?
> > 
> > Will this result in 3.3.0 channel updates that remain compatible with 3.3.0?
> 
> yes.

+1

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

--- Comment #9 from Mark Martinec <Ma...@ijs.si> 2010-02-03 09:44:16 UTC ---
> please vote for checkin to 3.3...

+1

Results look alright, a major improvement!
Code changes make sense (I don't claim I fully understand
the fine details), and the added test was much 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 6241] mkrules does not understand newer options and 'else'

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

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

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

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|needs 2 votes               |needs 1 more vote

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

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

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

--- Comment #17 from Mark Martinec <Ma...@ijs.si> 2011-05-09 15:10:36 UTC ---
> > Targeting to 3.3.2. Looks like target was changed to 3.4.0 instead of 3.3.2
> > by mistake, this is already committed to trunk (future 3.4 branch)
> > Note this is now ready to commit to 3.3 branch.
> 
> I moved target to 3.4 intentionally, solely based on the sheer size
> of this change, assuming that 3.3.2 would only be a minor release.
> I already voted a +1 on a 3.3, so I'd let Justin decide and roll-in
> the patch.

I'm revoking my retargeting, let's do it for 3.3.2, votes are all there.

Although the change is large, it only affects build/mkrules (i.e.
a non-production component), fixes a serious flaw, and has proven
itself in the trunk during the last 15 months.

3.3:
  Bug 6241: mkrules does not understand newer options and "else"
  Sending MANIFEST
  Sending build/mkrules
Committed revision 1101053.

-- 
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 6241] mkrules does not understand newer options and 'else'

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

--- Comment #4 from Mark Martinec <Ma...@ijs.si> 2009-12-16 05:05:06 UTC ---
20_khop_bl.cf Bug 6241: comment out complex 'if's to work
 around a deficiency in mkrules (may be restored when fixed);
20_khop_bl.cf Bug 6258: replace DKIM_VERIFIED with DKIM_VALID
 to avoid a warning: "rules: meta test __NOT_SPOOFED has
 dependency 'DKIM_VERIFIED' with a zero score"
Sending lib/Mail/SpamAssassin/Timeout.pm
Sending rulesrc/sandbox/khopesh/20_khop_bl.cf
Sending t/timeout.t
Committed revision 891224.

oops, submitted too many files, reverting Timeout.pm and t/timeout.t
Sending lib/Mail/SpamAssassin/Timeout.pm
Sending t/timeout.t
Committed revision 891227.

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.3.2                       |3.4.0

-- 
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 6241] mkrules does not understand newer options and 'else'

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

-- 
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 6241] [review] mkrules does not understand newer options and 'else'

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

--- Comment #11 from Justin Mason <jm...@jmason.org> 2010-03-11 14:47:22 UTC ---
(In reply to comment #10)
> Is this vote for 3.3.x?
> 
> Will this result in 3.3.0 channel updates that remain compatible with 3.3.0?

yes.

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