Re: Bayes refuses to work despite best efforts
On Fri, 31 Mar 2017 15:02:46 +0100 RW wrote: > On Fri, 31 Mar 2017 14:40:10 +0100 > RW wrote: > > > On Fri, 31 Mar 2017 15:21:59 +0200 > > Matus UHLAR - fantomas wrote: > > > > > > > >bayes_path /var/bayes/ > > > >bayes_file_mode 0777 > > > > > > you do not need those, just check the above. > > > spamd uses home directory of the user it's running under. > > > > I thought that, but I tried it and it doesn't. Even if you run > > "spamd -u spamd" the Bayes directory is still governed by spamc just > > as it does when it's setup for ordinary unix users. > > I just rechecked that and couldn't reproduce it, so I probably did > something wrong. Actually I can, and I know what's happening now, The OP missed out this: -x, --nouser-config Disable user config files I have it my config because ironically you have to set it to use virtual home directories. The actual meaning is don't look for files in unix home directories, and if you don't set it in combination with -u, SA still looks for user config and bayes files in the inaccessible home directory of the user running spamc.
Re: Bayes refuses to work despite best efforts
On Fri, 31 Mar 2017 14:40:10 +0100 RW wrote: > On Fri, 31 Mar 2017 15:21:59 +0200 > Matus UHLAR - fantomas wrote: > > > > >bayes_path /var/bayes/ > > >bayes_file_mode 0777 > > > > you do not need those, just check the above. > > spamd uses home directory of the user it's running under. > > I thought that, but I tried it and it doesn't. Even if you run > "spamd -u spamd" the Bayes directory is still governed by spamc just > as it does when it's setup for ordinary unix users. I just rechecked that and couldn't reproduce it, so I probably did something wrong.
Re: Bayes refuses to work despite best efforts
RWwrote .. > On Fri, 31 Mar 2017 15:21:59 +0200 > Matus UHLAR - fantomas wrote: > > > > >bayes_path /var/bayes/ > > >bayes_file_mode 0777 > > > > you do not need those, just check the above. > > spamd uses home directory of the user it's running under. > > I thought that, but I tried it and it doesn't. Even if you run > "spamd -u spamd" the Bayes directory is still governed by spamc just as > it does when it's setup for ordinary unix users. I agree. Matus had asked if my spamd home was /root. It isn't, yet it still tries to create user_prefs in /root/.spamassassin. Regardless, bayes seems to be working with the correction to the bayes_path per previous emails. I consider the issue solved. Thank you, gentlemen, for your help. Very much appreciated!
Re: Bayes refuses to work despite best efforts
On Fri, 31 Mar 2017 15:21:59 +0200 Matus UHLAR - fantomas wrote: > >bayes_path /var/bayes/ > >bayes_file_mode 0777 > > you do not need those, just check the above. > spamd uses home directory of the user it's running under. I thought that, but I tried it and it doesn't. Even if you run "spamd -u spamd" the Bayes directory is still governed by spamc just as it does when it's setup for ordinary unix users.
Re: Bayes refuses to work despite best efforts
Reindl Haraldwrote .. you said in your other mail "This is for sitewide filtering" and for that a own wiki page exists which can be found by type "spamassassin sitewide" in search engines did you consider click at this link? https://wiki.apache.org/spamassassin/SiteWideBayesSetup In local.cf, tell SpamAssassin where to find the Bayesian database files: bayes_path /var/spamassassin/bayes_db/bayes bayes_file_mode 0777 this stuff has no business to live under /root On 31.03.17 08:38, dav...@shopblt.com wrote: Yes, I read the wiki page. I had no bayes_path setting in my local.cf. Spamassassin put the bayes database under /root on its own. what's the "spamd" user's home directory? Isn't it /root/ ? To keep it simple, I created /var/bayes, did chown spamd:root on it, copied the bayes files and user_prefs from /root/.spamassassin, chmod 777 all of it (for now to get this working) and made these changes to local.cf: bayes_path /var/bayes/ bayes_file_mode 0777 you do not need those, just check the above. spamd uses home directory of the user it's running under. -- Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/ Warning: I wish NOT to receive e-mail advertising to this address. Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu. Linux is like a teepee: no Windows, no Gates and an apache inside...
Re: Bayes refuses to work despite best efforts
RWwrote .. > On Fri, 31 Mar 2017 08:38:28 -0400 (EDT) > dav...@shopblt.com wrote: > > > Reindl Harald wrote .. > > > > > > you said in your other mail "This is for sitewide filtering" and > > > for that a own wiki page exists which can be found by type > > > "spamassassin sitewide" in search engines > > > > > > did you consider click at this link? > > > https://wiki.apache.org/spamassassin/SiteWideBayesSetup > > > > > > In local.cf, tell SpamAssassin where to find the Bayesian database > > > files: > > > > > > bayes_path /var/spamassassin/bayes_db/bayes > > > bayes_file_mode 0777 > > > > > > this stuff has no business to live under /root > > > > Yes, I read the wiki page. I had no bayes_path setting in my > > local.cf. Spamassassin put the bayes database under /root on its own. > > > BTW you should check that out because it means that spamc is either > been run as root or being run as spamc -u root. > I'll have to investigate this, I guess. I recall researching whether it should run as root or not, but there seemed to be arguments both ways. Like I said, Linux isn't my first love, or even a close friend, so I'll need to go find out even how the service is started from what obscure text file and fix that, since SA is still complaining about the user_prefs file. > > > > bayes_path /var/bayes/ > > You missed the following line in the wiki: "Note that the argument to > bayes_path is a combination of a directory > (/var/spamassassin/bayes_db/) and a filename prefix (bayes)." > You're right, I did miss that. Corrected and now I'm seeing bayes referenced in the log now. Not sure if it's actually working correctly as I see "bayes=1.00,autolearn=no autolearn_force=no" every email now. Here's some log: Fri Mar 31 09:10:26 2017 [7739] info: spamd: connection from localhost [::1]:51072 to port 783, fd 6 Fri Mar 31 09:10:26 2017 [7739] info: spamd: creating default_prefs: /root/.spamassassin/user_prefs Fri Mar 31 09:10:26 2017 [7739] info: spamd: failed to create readable default_prefs: /root/.spamassassin/user_prefs Fri Mar 31 09:10:26 2017 [7739] info: spamd: processing message for root:1010 Fri Mar 31 09:10:26 2017 [7739] info: spamd: identified spam (6.5/3.0) for root:1010 in 0.1 seconds, 1775 bytes. Fri Mar 31 09:10:26 2017 [7739] info: spamd: result: Y 6 - BAYES_99,BAYES_999,DEAR_SOMETHING,RDNS_NONE,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED scantime=0.1,size=1775,user=root,uid=1010,required_score=3.0,rhost=localhost,raddr=::1,rport=51072,mid=,bayes=1.00,autolearn=no autolearn_force=no Seems like the BAYES_99,BAYES_999 entries means it's doing something. BTW, thanks for being patient with me and for the help!
Re: Bayes refuses to work despite best efforts
On Fri, 31 Mar 2017 08:38:28 -0400 (EDT) dav...@shopblt.com wrote: > Reindl Haraldwrote .. > > > > you said in your other mail "This is for sitewide filtering" and > > for that a own wiki page exists which can be found by type > > "spamassassin sitewide" in search engines > > > > did you consider click at this link? > > https://wiki.apache.org/spamassassin/SiteWideBayesSetup > > > > In local.cf, tell SpamAssassin where to find the Bayesian database > > files: > > > > bayes_path /var/spamassassin/bayes_db/bayes > > bayes_file_mode 0777 > > > > this stuff has no business to live under /root > > Yes, I read the wiki page. I had no bayes_path setting in my > local.cf. Spamassassin put the bayes database under /root on its own. BTW you should check that out because it means that spamc is either been run as root or being run as spamc -u root. > To keep it simple, I created /var/bayes, did chown spamd:root on it, > copied the bayes files and user_prefs from /root/.spamassassin, chmod > 777 all of it (for now to get this working) and made these changes to > local.cf: > > bayes_path /var/bayes/ You missed the following line in the wiki: "Note that the argument to bayes_path is a combination of a directory (/var/spamassassin/bayes_db/) and a filename prefix (bayes)." > bayes_file_mode 0777 Don't do that. It's not necessary, and shouldn't be in the wiki, it's just a cheesy hack. > After restarting the service, spamassassin continues with the same > complaints and still no bayes processing:
Re: Bayes refuses to work despite best efforts
RWwrote .. > The parent process running as root is normal, it's the child processes > that do the work. If you want the parent to run as spamd, you can > simply start it as spamd, but if you do that you have to switch to a > high port or use a unix socket. > > The reason it's looking in root is that the default is to look in the > unix home directory of the user specified in spamc -u or the user > running spamc (without -u). To use a file-based global database you > need to tell SA where to put the files by setting bayes_path. Okay, thank you for the explanation. Based on this and other feedback, I did make those changes to local.cf, copied files, changed permissions, and restarted the service, but it's ignoring them and using /root/.spamassassin. See my last email to the group on this. Also, it was recommended to use the format: bayes_path /var/bayes but SA complained that the path was invalid until I changed it to /var/bayes/ (with the trailing slash). Regardless, it's still using the /root/.spamassassin folder.
Re: Bayes refuses to work despite best efforts
Antony Stonewrote .. > On Friday 31 March 2017 at 00:07:56, David wrote: > > > I'm getting no bayes score on any email and there appears to be no bayes > > filtering despite my best efforts. > > > sa-learn --dump magic > > 0.000 0 3 0 non-token data: bayes db version > > 0.000 0 1727 0 non-token data: nspam > > 0.000 0111 0 non-token data: nham > > You need at least 200 spam tokens and at least 200 ham tokens for Bayes to > start working. > > > Antony. Original email: I have built up these settings in local.cf in attempts to get bayes working: use_bayes 1 bayes_auto_learn 1 bayes_min_ham_num 100 <-- right here bayes_auto_learn_threshold_nonspam -0.001
Re: Bayes refuses to work despite best efforts
Reindl Haraldwrote .. > > you said in your other mail "This is for sitewide filtering" and for > that a own wiki page exists which can be found by type "spamassassin > sitewide" in search engines > > did you consider click at this link? > https://wiki.apache.org/spamassassin/SiteWideBayesSetup > > In local.cf, tell SpamAssassin where to find the Bayesian database files: > > bayes_path /var/spamassassin/bayes_db/bayes > bayes_file_mode 0777 > > this stuff has no business to live under /root Yes, I read the wiki page. I had no bayes_path setting in my local.cf. Spamassassin put the bayes database under /root on its own. To keep it simple, I created /var/bayes, did chown spamd:root on it, copied the bayes files and user_prefs from /root/.spamassassin, chmod 777 all of it (for now to get this working) and made these changes to local.cf: bayes_path /var/bayes/ bayes_file_mode 0777 After restarting the service, spamassassin continues with the same complaints and still no bayes processing: Fri Mar 31 08:34:13 2017 [26563] info: spamd: creating default_prefs: /root/.spamassassin/user_prefs Fri Mar 31 08:34:13 2017 [26563] info: spamd: failed to create readable default_prefs: /root/.spamassassin/user_prefs Fri Mar 31 08:36:49 2017 [26562] info: spamd: result: {snip} autolearn=no autolearn_force=no
Re: Bayes refuses to work despite best efforts
Hi Antony, If you look at his Bayes Configuration, he made it so that he only requires 100 Ham messages. So that isn't the issue here. - Markus On 03/31/2017 12:56 PM, Antony Stone wrote: On Friday 31 March 2017 at 00:07:56, David wrote: I'm getting no bayes score on any email and there appears to be no bayes filtering despite my best efforts. sa-learn --dump magic 0.000 0 3 0 non-token data: bayes db version 0.000 0 1727 0 non-token data: nspam 0.000 0111 0 non-token data: nham You need at least 200 spam tokens and at least 200 ham tokens for Bayes to start working. Antony.
Re: Bayes refuses to work despite best efforts
On Friday 31 March 2017 at 00:07:56, David wrote: > I'm getting no bayes score on any email and there appears to be no bayes > filtering despite my best efforts. > sa-learn --dump magic > 0.000 0 3 0 non-token data: bayes db version > 0.000 0 1727 0 non-token data: nspam > 0.000 0111 0 non-token data: nham You need at least 200 spam tokens and at least 200 ham tokens for Bayes to start working. Antony. -- The truth is rarely pure, and never simple. - Oscar Wilde Please reply to the list; please *don't* CC me.
Re: Bayes refuses to work despite best efforts
On Fri, 31 Mar 2017 05:37:26 -0400 (EDT) dav...@shopblt.com wrote: > This is for sitewide filtering. Users don't need any options in the > scenario. Can you elaborate on what I need to change in what file to > get this parent process running properly as user spamd, instead of > root? The parent process running as root is normal, it's the child processes that do the work. If you want the parent to run as spamd, you can simply start it as spamd, but if you do that you have to switch to a high port or use a unix socket. The reason it's looking in root is that the default is to look in the unix home directory of the user specified in spamc -u or the user running spamc (without -u). To use a file-based global database you need to tell SA where to put the files by setting bayes_path.
Re: Bayes refuses to work despite best efforts
Matus UHLAR - fantomaswrote .. > On 30.03.17 18:07, David wrote: > >I'm getting no bayes score on any email and there appears to be no bayes > >filtering > despite my best efforts. I am not a linux and spamassassin guru, so I'm asking > for some help. > > >Fri Mar 3 12:36:27 2017 [10104] info: spamd: creating default_prefs: > >/root/.spamassassin/user_prefs > >Fri Mar 3 12:36:27 2017 [10104] info: spamd: failed to create readable > >default_prefs: > /root/.spamassassin/user_prefs > > >My spamd launch command explicitly sets the user as spamd, but the main > >service > is still running as root while children appear to be spawning properly. Here's > ps output: > > > >root10093 0.0 1.5 145988 66952 ?Ss 02:25 0:05 /usr/sbin/spamd > --create-prefs --max-children=5 --username=spamd > --helper-home-dir=/var/log/spamassassin/ > --syslog=/var/log/spamassassin/spam.log -d --pidfile=/var/run/spamd.pid > >spamd10104 0.0 1.8 155348 75544 ?S02:25 0:22 spamd child > >spamd23753 0.0 1.7 151732 72000 ?S10:30 0:02 spamd child > > your spamd process runs under spamd user, but wants to update files in > root's home directory? I doubt /root is accessible by anyone but root. > the same should apply for /root/.spamassassin. > > change spamd's home directory to something other than /root/ > > even better, run it without --username parameter so it can set UID to user > it's currencly checking. this way different users can have different bayes > databases, different options etc. > This is for sitewide filtering. Users don't need any options in the scenario. Can you elaborate on what I need to change in what file to get this parent process running properly as user spamd, instead of root? Thanks, in advance.
Re: Bayes refuses to work despite best efforts
Reindl Haraldwrote .. > > > Am 31.03.2017 um 00:07 schrieb David: > > The spamassassin log file shows one error consistently: > > > > Fri Mar 3 12:36:27 2017 [10104] info: spamd: creating default_prefs: > > /root/.spamassassin/user_prefs > > Fri Mar 3 12:36:27 2017 [10104] info: spamd: failed to create readable > > default_prefs: > /root/.spamassassin/user_prefs > > > > and one error sporadically: > > > > warn: plugin: eval failed: bayes: (in learn) locker: safe_lock: cannot > > create > tmp lockfile /root/.spamassassin/bayes.lock.[mydomain.com].27903 for > /root/.spamassassin/bayes.lock: > Permission denied > > > > > > The user_prefs file in /root/.spamassassin/ does exist, and I've given > > everyone > permissions to it to attempt to resolve this problem, with no effect: > > -rwxrwxrwx 1 root root1273 Mar 1 14:46 user_prefs* > > and you gave also /root/ everyone access? > no - don't do that, but this is not windows and hence when one folder of > the path don't allow access than access is denied for anything below > > how does one come to the conclusion put *anyhting* service related below > /root? > > https://wiki.apache.org/spamassassin/SiteWideBayesSetup Cut me a little break here. I did not come to any conclusion to run it as root. I specified the user to run as in the command line. Why it's running as root, I don't know. As I said, I'm not a guru with linux or spamassassin which is why I'm reaching out for help. Can you elaborate on what I need to change in what file to get the parent to run as user spamd?
Re: Bayes refuses to work despite best efforts
On 30.03.17 18:07, David wrote: I'm getting no bayes score on any email and there appears to be no bayes filtering despite my best efforts. I am not a linux and spamassassin guru, so I'm asking for some help. Fri Mar 3 12:36:27 2017 [10104] info: spamd: creating default_prefs: /root/.spamassassin/user_prefs Fri Mar 3 12:36:27 2017 [10104] info: spamd: failed to create readable default_prefs: /root/.spamassassin/user_prefs My spamd launch command explicitly sets the user as spamd, but the main service is still running as root while children appear to be spawning properly. Here's ps output: root10093 0.0 1.5 145988 66952 ?Ss 02:25 0:05 /usr/sbin/spamd --create-prefs --max-children=5 --username=spamd --helper-home-dir=/var/log/spamassassin/ --syslog=/var/log/spamassassin/spam.log -d --pidfile=/var/run/spamd.pid spamd10104 0.0 1.8 155348 75544 ?S02:25 0:22 spamd child spamd23753 0.0 1.7 151732 72000 ?S10:30 0:02 spamd child your spamd process runs under spamd user, but wants to update files in root's home directory? I doubt /root is accessible by anyone but root. the same should apply for /root/.spamassassin. change spamd's home directory to something other than /root/ even better, run it without --username parameter so it can set UID to user it's currencly checking. this way different users can have different bayes databases, different options etc. -- Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/ Warning: I wish NOT to receive e-mail advertising to this address. Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu. The 3 biggets disasters: Hiroshima 45, Tschernobyl 86, Windows 95