Page 1 of 1

Problems with mailscaner.cf

Posted: 14 May 2016 09:32
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?

Re: Problems with mailscaner.cf

Posted: 14 May 2016 15:37
by shawniverson
Any problems with the whitespace around those entries?

Re: Problems with mailscaner.cf

Posted: 14 May 2016 15:43
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

Re: Problems with mailscaner.cf

Posted: 14 May 2016 15:47
by shawniverson
There's a strange whitespace character at the end of each of these lines.

Re: Problems with mailscaner.cf

Posted: 14 May 2016 16:01
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.

Re: Problems with mailscaner.cf

Posted: 14 May 2016 16:05
by shawniverson

Re: Problems with mailscaner.cf

Posted: 14 May 2016 16:14
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?

Re: Problems with mailscaner.cf

Posted: 14 May 2016 16:14
by shawniverson
Yes, no errors.

Re: Problems with mailscaner.cf

Posted: 14 May 2016 16:15
by shawniverson
Is your editor using UNIX line termination?

What happens if you dos2unix the spam.assassin.prefs.conf file?

Re: Problems with mailscaner.cf

Posted: 14 May 2016 16:22
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.

Re: Problems with mailscaner.cf

Posted: 14 May 2016 16:27
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?

Re: Problems with mailscaner.cf

Posted: 14 May 2016 17:22
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

Re: Problems with mailscaner.cf

Posted: 14 May 2016 21:08
by shawniverson
Then you need to comment out those two options, they are not valid without the plugin enabled. :naughty:

Re: Problems with mailscaner.cf

Posted: 14 May 2016 21:19
by ovizii
Thanks for solving the mystery. Lesson learned, keep things together not in different files, makes for easier tracking :-)