Problems with mailscaner.cf

Report bugs and workarounds
Post Reply
ovizii
Posts: 463
Joined: 11 May 2016 08:08

Problems with mailscaner.cf

Post by ovizii »

Going to GUI => Tools/Links => MailScanner Lint

I see the following lines I am concerned about:

Code: Select all

Connected to SpamAssassin cache database 	0.00081
config: failed to parse line, skipping, in "/etc/mail/spamassassin/mailscanner.cf": use_auto_whitelist 0 	0.6575
config: failed to parse line, skipping, in "/etc/mail/spamassassin/mailscanner.cf": auto_whitelist_factory Mail::SpamAssassin::SQLBasedAddrList 	0.00084
SpamAssassin reported an error. 	12.94365
those lines looks like this in mailscanner.cf:

Code: Select all

use_auto_whitelist 0
auto_whitelist_factory          Mail::SpamAssassin::SQLBasedAddrList
Not sure what's wrong here...
Can anyone spot the problem?
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Problems with mailscaner.cf

Post by shawniverson »

Any problems with the whitespace around those entries?
ovizii
Posts: 463
Joined: 11 May 2016 08:08

Re: Problems with mailscaner.cf

Post by ovizii »

No idea, it literally looks like this:

Code: Select all

# If you are using a UNIX machine with all database files on local disks,
# and no sharing of those databases across NFS filesystems, you can use a
# more efficient, but non-NFS-safe, locking mechanism.   Do this by adding
# the line "lock_method flock" to the /etc/mail/spamassassin/local.cf
# file. This is strongly recommended if you're not using NFS, as it is
# much faster than the NFS-safe locker.

lock_method flock

# The --auto-whitelist and -a options for "spamd" and "spamassassin" to
# turn on the auto-whitelist have been removed and replaced by the
# "use_auto_whitelist" configuration option which is also now turned on by
# default.

use_auto_whitelist 0

# =============== RBSL related items ===============

Code: Select all

#Begin E.F.A. mods for MySQL
bayes_store_module              Mail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn                   DBI:mysql:sa_bayes:localhost
bayes_sql_username              sa_user
bayes_sql_password              XXX
auto_whitelist_factory          Mail::SpamAssassin::SQLBasedAddrList
user_awl_dsn                    DBI:mysql:sa_bayes:localhost
user_awl_sql_username           sa_user
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Problems with mailscaner.cf

Post by shawniverson »

There's a strange whitespace character at the end of each of these lines.
ovizii
Posts: 463
Joined: 11 May 2016 08:08

Re: Problems with mailscaner.cf

Post by ovizii »

I've copied the text straight from my ssh session.
could you share your mailscanner.cf via pastebin (minus anything confidential of course) - that way I coudl copy/paste the relevant sections and see if anything changes.
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Problems with mailscaner.cf

Post by shawniverson »

ovizii
Posts: 463
Joined: 11 May 2016 08:08

Re: Problems with mailscaner.cf

Post by ovizii »

Thanks, I've opened the paste, switched to RAW view and copied the lines I was interested in, then pasted them into my config, deleting my original lines. Restarted Mailscanner.

Same problem still.

Can you check your Mailscanner Lint results from the GUI? Is your's OK?
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Problems with mailscaner.cf

Post by shawniverson »

Yes, no errors.
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Problems with mailscaner.cf

Post by shawniverson »

Is your editor using UNIX line termination?

What happens if you dos2unix the spam.assassin.prefs.conf file?
ovizii
Posts: 463
Joined: 11 May 2016 08:08

Re: Problems with mailscaner.cf

Post by ovizii »

Not all that familiar with dos2unix, is this correct?

Code: Select all

dos2unix -n /etc/MailScanner/spam.assassin.prefs.conf mailscanner.cf.unix
dos2unix: converting file /etc/MailScanner/spam.assassin.prefs.conf to file mailscanner.cf.unix in UNIX format ...

cp /etc/MailScanner/spam.assassin.prefs.conf /etc/MailScanner/spam.assassin.prefs.conf.bckp
cp mailscanner.cf.unix /etc/MailScanner/spam.assassin.prefs.conf
restarted Mailscanner

Problem persists.
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Problems with mailscaner.cf

Post by shawniverson »

Hmm......I must be mistaken....let's proceed with your config as ok.

use_auto_whitelist and auto_whitelist_factory depend on a spamassassin plugin.

/etc/mail/spamassassin/v310.pre

Code: Select all

loadplugin Mail::SpamAssassin::Plugin::AWL
Is this plugin enabled?
ovizii
Posts: 463
Joined: 11 May 2016 08:08

Re: Problems with mailscaner.cf

Post by ovizii »

NOPE, the plugins is disabled as I enabled TXREP instead:

v310.pre

Code: Select all

# AWL - do auto-whitelist checks
# disabled by ovi because I enabled TXREP in v341.pre
#loadplugin Mail::SpamAssassin::Plugin::AWL
v341.pre

Code: Select all

# TxRep - Reputation database that replaces AWL
 loadplugin Mail::SpamAssassin::Plugin::TxRep
mailscanner.cf

Code: Select all

# TXREP DATABASE
txrep_factory                   Mail::SpamAssassin::SQLBasedAddrList
user_awl_sql_table              txrep
user_awl_dsn                    DBI:mysql:sa_bayes:localhost
user_awl_sql_username           sa_user
user_awl_sql_password           secret
but also still contains as I didn't think that would be a problem after disabling the AWL plugin:

Code: Select all

auto_whitelist_factory          Mail::SpamAssassin::SQLBasedAddrList
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Problems with mailscaner.cf

Post by shawniverson »

Then you need to comment out those two options, they are not valid without the plugin enabled. :naughty:
ovizii
Posts: 463
Joined: 11 May 2016 08:08

Re: Problems with mailscaner.cf

Post by ovizii »

Thanks for solving the mystery. Lesson learned, keep things together not in different files, makes for easier tracking :-)
Post Reply