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 2025/01/07 22:43:45 UTC

[Bug 8306] New: spamassassin/spamd can't find rules if initial sa-update run fails

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

            Bug ID: 8306
           Summary: spamassassin/spamd can't find rules if initial
                    sa-update run fails
           Product: Spamassassin
           Version: 4.0.1
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: spamassassin
          Assignee: dev@spamassassin.apache.org
          Reporter: frodo@morgul.net
  Target Milestone: Undefined

This was originally reported to Debian ages ago in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739489. I've confirmed that
the behavior is still present.

If spamassassin is installed entirely through tarballs or distro packages
(including rules in the DEF_RULES_DIR), then it will use the installed rules as
expected. If sa-update runs at a later time but is unable to download rules for
some reason, then spamassassin will no longer start successfully. It will try
using rules from the LOCAL_STATE_DIR, which exists because sa-update created
it, but it will fail because there aren't actually any rules there.

This could happen due to misconfiguration of the local system (e.g. the network
being offline) or transient upstream issues, e.g. DNS resolution problems.

Easiest way to reproduce this:

1. Download and install the Mail-SpamAssassin-4.0.1.tar.gz and
Mail-SpamAssassin-rules-4.0.1.r1916528.tgz files from the spamassassin web site
2. Verify with `spamassassin -D --lint` that the installation is successful and
that SA is using /usr/local/share/spamassassin for rules
3. Disconnect the system from the network
4. Run sa-update.  This will fail because the update servers are unreachable
5. Run `spamassassin -D --lint`.  This will now fail with "config: no rules
were found!  Do you need to run 'sa-update'?"

A couple of possible solutions come to mind.  sa-update could (and probably
should) not create any final paths until it has successfully retrieved content.
 Or spamassassin/spamd could fall back from the LOCAL_STATE_DIR to the
DEF_RULES_DIR if attempts to read rules from the former fail.

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

[Bug 8306] spamassassin/spamd can't find rules if initial sa-update run fails

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |billcole@apache.org
           Severity|minor                       |enhancement
           Priority|P2                          |P5
                 OS|Linux                       |All
           Hardware|PC                          |All

--- Comment #1 from Bill Cole <bi...@apache.org> ---
DEF_RULES_DIR (a.k.a. DATADIR) does NOT contain a ruleset in a normal
SpamAssassin installation. No rules are distributed in release packages because
they change daily. Falling back to DEF_RULES_DIR can only ever work at all if
the system has had rules installed manually at some time. If one intends to be
using the current rules (by running sa-update) then it would be wrong to fall
back to using a ruleset manually installed at some earlier time.

IMHO this is not a bug so much as it is a reasonable way to fail when the
system is in a state that SA *should not* work. I don't see any clearly better
behavior, but maybe others disagree with my view that using any old
manually-installed ruleset (especially without warnings) is worse than
explicitly failing because the intended rules are non-existent.  Also, this is
only a problem at first installation. If sa-update has ever run successfully,
there will be a ruleset in LOCAL_STATE_DIR that will be used as long as the
release version hasn't changed. 

Leaving this open as others with more imagination may see an actually better
behavior in this circumstance. My instinct says this is a problem for
downstream packagers to address, as it is essentially an external failure in
the install process.

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

[Bug 8306] spamassassin/spamd can't find rules if initial sa-update run fails

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

Noah Meyerhans <fr...@morgul.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |frodo@morgul.net
         Resolution|---                         |WONTFIX

--- Comment #2 from Noah Meyerhans <fr...@morgul.net> ---
> Leaving this open as others with more imagination may see an actually better behavior in this circumstance. My instinct says this is a problem for downstream packagers to address, as it is essentially an external failure in the install process.

I think that's reasonable. It's definitely an edge case. In the standard
installation process, sa-update must complete successfully in order for
SpamAssassin to run, so it's unlikely to come up there.

I can avoid this in the distro package by making the installation process look
more like an offline installation with respect to the default ruleset. That is,
I'd install the bundled rules using sa-update as documented in the offline
variant of "Installing Rules" in the INSTALL doc.  This will ensure a
successful sa-update run even if the cached rules are in use.

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