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...@spamassassin.apache.org on 2022/05/13 07:17:41 UTC

[Bug 7991] New: Channel rules load order

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

            Bug ID: 7991
           Summary: Channel rules load order
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: sa-update
          Assignee: dev@spamassassin.apache.org
          Reporter: giovanni@paclan.it
  Target Milestone: Undefined

Created attachment 5781
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5781&action=edit
sa-update channelprefix option

Channels are loaded in alphabetical order, this way an additional channels may
be loaded before the official one (named update.spamassassin.org) and it will
be impossible to change official rules' scores.
In sa-update I added a --channelprefix option in order to add a prefix to the
additional channel destination directory.
This way the user can decide if the additional channel will be loaded before or
after the official one.

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

[Bug 7991] Channel rules load order

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #5782|0                           |1
        is obsolete|                            |

--- Comment #7 from Giovanni Bechis <gi...@paclan.it> ---
Created attachment 5783
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5783&action=edit
Updated sort patch

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

[Bug 7991] Channel rules load order

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

--- Comment #4 from Henrik Krohns <ap...@hege.li> ---
(In reply to Giovanni Bechis from comment #3)
> Created attachment 5782 [details]
> Load official rules befor additional channels
> 
> Alternative patch that loads official SpamAssassin channel before additional
> ones.

I don't think the sort works as expected.

I'm seeing this in @cfs

kam_sa-channels_mcgrail_com.cf
updates_spamassassin_org.cf
spamassassin_snb_it.cf

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

[Bug 7991] Channel rules load order

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

--- Comment #11 from Henrik Krohns <ap...@hege.li> ---
Please add comment to the code and refer to this bug

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

[Bug 7991] Channel rules load order

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

Bill Cole <bi...@apache.org> changed:

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

--- Comment #12 from Bill Cole <bi...@apache.org> ---
+1 for commit.

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

[Bug 7991] Channel rules load order

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

Henrik Krohns <ap...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |apache@hege.li

--- Comment #1 from Henrik Krohns <ap...@hege.li> ---
Wouldn't it be much simpler to just change processing to --channel parameter
order? The prefix stuff seems much more kludgy and breaks expected directory
names.

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

[Bug 7991] Channel rules load order

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

--- Comment #10 from Henrik Krohns <ap...@hege.li> ---
As such, I'd say +1 for commit

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

[Bug 7991] Channel rules load order

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

--- Comment #6 from Henrik Krohns <ap...@hege.li> ---
Can this cause anything funny to KAM channel users, if it doesn't load first
anymore?

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

[Bug 7991] Channel rules load order

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #5781|0                           |1
        is obsolete|                            |
                 CC|                            |giovanni@paclan.it

--- Comment #3 from Giovanni Bechis <gi...@paclan.it> ---
Created attachment 5782
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5782&action=edit
Load official rules befor additional channels

Alternative patch that loads official SpamAssassin channel before additional
ones.

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

[Bug 7991] Channel rules load order

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

--- Comment #8 from Giovanni Bechis <gi...@paclan.it> ---
(In reply to Henrik Krohns from comment #6)
> Can this cause anything funny to KAM channel users, if it doesn't load first
> anymore?

The issue arose because KAM.cf rules tried to change some scores but it didn't
work because 72_scores.cf was loaded after KAM.cf rules.

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

[Bug 7991] Channel rules load order

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

--- Comment #2 from Henrik Krohns <ap...@hege.li> ---
Ah now I understood.. so SA itself is loading from /var according to directory
names. Maybe just hardcode it to be loaded first?

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

[Bug 7991] Channel rules load order

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

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

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

--- Comment #13 from Giovanni Bechis <gi...@paclan.it> ---
Sending        lib/Mail/SpamAssassin.pm
Transmitting file data .done
Committing transaction...
Committed revision 1900857.

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

[Bug 7991] Channel rules load order

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

--- Comment #9 from Henrik Krohns <ap...@hege.li> ---

Ignoring any score FOO 0 or meta FOO 0 from KAM, quick check seems these are
the only duplicates that differ. Probably nothing to worry about.

kam_sa-channels_mcgrail_com/nonKAMrules.cf:header    BOGUS_MIME_VERSION 
MIME-Version =~ /^(?!.*\b1\.0\b).+/
updates_spamassassin_org/72_active.cf:meta       BOGUS_MIME_VERSION         
__BOGUS_MIME_VER_02 || __MALF_MIME_VER

kam_sa-channels_mcgrail_com/nonKAMrules.cf:meta      RAND_HEADER_MANY          
  __RAND_HEADER > 4
updates_spamassassin_org/72_active.cf:meta      RAND_HEADER_MANY            
__RAND_HEADER_2

nonKAMrules.cf does contain many duplicates that are already in stock rules,
should probably be cleaned up.

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

[Bug 7991] Channel rules load order

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

--- Comment #5 from Henrik Krohns <ap...@hege.li> ---
I think this is correct

sub _reorder_dir {
  if ($a eq 'updates_spamassassin_org.cf') {
    return -1;
  } elsif ($b eq 'updates_spamassassin_org.cf') {
    return 1;
  }
  return $a cmp $b;
}

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