Re: bayes_path ignored

2019-05-28 Thread RW
On Mon, 27 May 2019 19:38:55 -0500
Andy Howell wrote:

> On 5/27/19 6:43 PM, Reindl Harald wrote:
> > Am 28.05.19 um 01:05 schrieb Andy Howell:  
> >> How do I get spamassassin to honor the setting of bayes_path in 
> >> /etc/spamassassin/local.cf ? bayes_path    
> >> /var/spool/postfix/spamassassin/bayes_db It never gets used. I can 
> >> get sa-learn to create the files there by specifying the path: 
> >> sa-learn --username=amavis 
> >> --dbpath=/var/spool/postfix/spamassassin/bayes_db/  >> path>   
> > this line with the trailing slash is wrong anyways, they bayes_db
> > is supposed to be the prefix of the files below 
> > /var/spool/postfix/spamassassin/   
> 
> 
> Reindl Harald,
> 
> I saw "path" and assumed it was a path, not a prefix. The --dbpath in 
> the sa-learn command is a path.

Not exactly, if you specify a directory here then the default file
prefix bayes is added automatically.


> I guess it should be /var/spool/postfix/spamassassin/bayes_db/bayes

Yes, if you omit the prefix here it's simply invalid and you fall back
to a value of '~/.spamassassin/bayes'. 

The '-u amavis' argument to sa-learn is wrong too, as this specifies a
virtual mail user, not a unix user to run as. If you are not using
per unix user files under ~/ you need to run sa-learn as the user that
owns the global files.

Do not run with 'bayes_file_mode 0775'  as suggested in the howto.
This is an ugly and insecure kludge to allow unix users to share a
single database.

Don't test as root as it will mask problems with permissions.



Re: bayes_path ignored

2019-05-27 Thread Andy Howell



On 5/27/19 8:11 PM, Reindl Harald wrote:


Am 28.05.19 um 02:38 schrieb Andy Howell:

On 5/27/19 6:43 PM, Reindl Harald wrote:

Am 28.05.19 um 01:05 schrieb Andy Howell:

How do I get spamassassin to honor the setting of bayes_path in
/etc/spamassassin/local.cf ? bayes_path
/var/spool/postfix/spamassassin/bayes_db It never gets used. I can
get sa-learn to create the files there by specifying the path:
sa-learn --username=amavis
--dbpath=/var/spool/postfix/spamassassin/bayes_db/ 

this line with the trailing slash is wrong anyways, they bayes_db is
supposed to be the prefix of the files below
/var/spool/postfix/spamassassin/


Reindl Harald,

I saw "path" and assumed it was a path, not a prefix

https://wiki.apache.org/spamassassin/SiteWideBayesSetup

Note that the argument to bayes_path is a combination of a directory
(/var/spamassassin/bayes_db/) and a filename prefix (bayes)

why can't you just set the userhome for the user everything including
your training runs unnder proper and so it's /.spamassassin/

works fine here since 2014


I had a look at the link. I think I have it setup correctly.

The reason for going sitewide is I thought that it would be easier. 
Silly me.


I used to run a few virtual mail servers, so everything is setup using 
postfix's virtual mail server functionality. Now I'm down to one, so I 
could move it back to a non-virtual setup. Its a question of which 
causes less pain. I go years without mucking with it. Lately I've been 
inundated with spam. I just don't care that much about the latest diet, 
ED treatment, or what Storm Danniels is up to! And I've fully accepted 
that fact that pushing 60, I will never have the hair I had when I was 20.


Thanks for your help.



Re: bayes_path ignored

2019-05-27 Thread Andy Howell



On 5/27/19 6:43 PM, Reindl Harald wrote:

Am 28.05.19 um 01:05 schrieb Andy Howell:
How do I get spamassassin to honor the setting of bayes_path in 
/etc/spamassassin/local.cf ? bayes_path    
/var/spool/postfix/spamassassin/bayes_db It never gets used. I can 
get sa-learn to create the files there by specifying the path: 
sa-learn --username=amavis 
--dbpath=/var/spool/postfix/spamassassin/bayes_db/  
this line with the trailing slash is wrong anyways, they bayes_db is 
supposed to be the prefix of the files below 
/var/spool/postfix/spamassassin/ 



Reindl Harald,

I saw "path" and assumed it was a path, not a prefix. The --dbpath in 
the sa-learn command is a path.


I guess it should be /var/spool/postfix/spamassassin/bayes_db/bayes then?

It still does not seem to be using bayes. When I run it on the command 
line, there is no mention of bayes:


spamassassin -t 

Content analysis details:   (7.4 points, 5.0 required)

pts rule name  description
 -- 
--

 2.5 URIBL_DBL_SPAM Contains a spam URL listed in the Spamhaus DBL
    blocklist
    [URIs: blondetournament.icu]
 3.6 RCVD_IN_SBL_CSS    RBL: Received via a relay in Spamhaus SBL-CSS
    [199.3.144.5 listed in zen.spamhaus.org]
-0.0 SPF_HELO_PASS  SPF: HELO matches SPF record
 0.0 HTML_MESSAGE   BODY: HTML included in message
 0.1 DKIM_SIGNED    Message has a DKIM or DK signature, not 
necessarily

    valid
 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
 1.3 RDNS_NONE  Delivered to internal network by a host 
with no rDNS


sa-learn ignores the bayes_path too. If I don't specify the --dbpath is 
makes the files in the user's .spamassassin directory. My mail users 
don't have home directories.


Thanks,

Andy




bayes_path ignored

2019-05-27 Thread Andy Howell
How do I get spamassassin to honor the setting of bayes_path in 
/etc/spamassassin/local.cf ?


bayes_path    /var/spool/postfix/spamassassin/bayes_db

It never gets used. I can get sa-learn to create the files there by 
specifying the path:


sa-learn --username=amavis 
--dbpath=/var/spool/postfix/spamassassin/bayes_db/  


But without it:

sa-learn --username=amavis --dump magic
ERROR: Bayes dump returned an error, please re-run with -D for more 
information


Specifying the path shows the sa-learn worked:

sa-learn --username=amavis 
--dbpath=/var/spool/postfix/spamassassin/bayes_db/ --dump magic

0.000  0  3  0  non-token data: bayes db version
0.000  0  83126  0  non-token data: nspam
0.000  0   3206  0  non-token data: nham
0.000  0    2610795  0  non-token data: ntokens
0.000  0 1390571060  0  non-token data: oldest atime
0.000  0 1558992503  0  non-token data: newest atime
0.000  0 1516395140  0  non-token data: last journal 
sync atime

0.000  0 1558984675  0  non-token data: last expiry atime
0.000  0   17058550  0  non-token data: last expire 
atime delta
0.000  0 445687  0  non-token data: last expire 
reduction count


If I try to test known spam email with spamassassin on the command line, 
it ignores the bayes_path setting.


spamassassin -D -t < spam.email

Gives the message:

bayes: no dbs present, cannot tie DB R/O: /root/.spamassassin/bayes_toks

I am using:

postfix 3.3.0-1ubuntu0.2

amavisd-new 1:2.11.0-1ubuntu1.1

spamassassin 3.4.2-0ubuntu0.18.04.1

Thanks,

Andy