$BOGOFILTER_DIR has no effect, rc example: bogofilter_dir not recognized

Christian Ebert bcc at phloxic.productions
Mon Apr 21 12:27:34 CEST 2025


* Christian Ebert on Saturday, April 19, 2025 at 09:25:30 +0100:
> * Christian Ebert on Friday, April 18, 2025 at 19:44:01 +0100:
>> I ran into issues when changing the BOGOFILTER_DIR location:
>> 
>> 1. $BOGOFILTER_DIR
>> 
>> works for testing when explicitly set, e.g. the following does not 
>> create the default $HOME/.bogofilter, but the desired location:
>> 
>> $ export BOGOFILTER_DIR=/Users/myself/some/location
>> $ bogofilter -QQ | grep bogofilter-dir
>> bogofilter-dir     = /Users/myself/some/location
>> 
>> However, when set e.g. in bashrc, and with new login shell:
>> $ echo $BOGOFILTER_DIR
>> /Users/myself/some/location
>> $ bogofilter -QQ | grep bogofilter-dir
>> bogofilter-dir     = /Users/myself/.bogofilter
> 
> Addendum: when set in systemwide /etc/bashrc
> 
> export BOGOFILTER_DIR="$HOME/some/location"

I actually got it to _report_ the custom location also when set 
in ~/.bashrc

> bogofilter -QQ reports the intended location, but running bogofilter 
> still creates $HOME/.bogofilter
> 
> Same with additionally setting BOGOFILTER_DIR for maildropfilter.

#v+
########### Sample BOGOFILTER Configuration File ###########################

# Default settings (as defined in the bogofilter source code) 
# have a single hash mark at the beginning of the line.

# Alternate values have two hash marks.

[...]

########### General Settings ########################################

#### BOGOFILTER_DIR
#
#	directory for wordlists
#
#bogofilter_dir=~/.bogofilter
##bogofilter_dir=/var/spool/bogofilter

#### name/location of user config file
#
#user_config_file=~/.bogofilter.cf
##user_config_file=~/.bogofilterrc
##user_config_file=~/.bogofilter/config
#v-

man 1 bogofilter:

#v+
ENVIRONMENT
        Bogofilter uses a database directory, which can be set in the config
        file. If not set there, bogofilter will use the value of
        BOGOFILTER_DIR. Both can be overridden by the -d dir option. If none of
        that is available, bogofilter will use directory $HOME/.bogofilter.
#v-

Hm, the behaviour I get is very much like:

If not set in a config file, bogofilter-dir will be set "as 
defined in the bogofilter source code" _regardless_ of what the 
BOGOFILTER_DIR environment says.

i.e., BOGOFILTER_DIR never overrides bogofilter-dir - unless when 
manually set before invocation.

-- 
LAST SHIP HOME                      🔗 https://lastshiphome.de/en
Official Selection                           DOK.fest Munich 2018
German Ocean Film Award                        CineMare Kiel 2019
Best Documentary Feature   Wales International Film Festival 2020


More information about the bogofilter mailing list