You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by David Newman <dn...@networktest.com> on 2004/12/16 05:50:35 UTC

cannot write and parse errors

Greetings. I'm seeing two problems with SA 3.0.1_2 on a FreeBSD 5.2.1 
system running Postfix 2.1.5,1 and procmail 3.22_5. All are installed via 
ports.

Problem 1:

The mail log has lots of entries like this:

Dec 15 00:42:53 mailman spamd[2224]: Cannot write to 
/nonexistent/.spamassassin/user_ prefs: No such file or directory

There's no such user as "nonexistent" on this system.

Why is this occurring and how can I correct it?

Problem 2:

I've pasted the complete output from "sa-learn -d --sync" below, but I'm 
interested in particular in four parse errors:

debug: config: SpamAssassin failed to parse line, skipping: 
rewrite_subject 1
debug: config: SpamAssassin failed to parse line, skipping: subject_tag $ 
*****SPAM*****
debug: config: SpamAssassin failed to parse line, skipping: 
use_terse_report 0
debug: config: SpamAssassin failed to parse line, skipping: auto_learn $ 1

Again, why are these failing to be parsed, and how can I correct the 
issue?

Many thanks.

Regards,
David Newman



  sa-learn -D --sync
debug: SpamAssassin version 3.0.1
debug: Score set 0 chosen.
debug: running in taint mode? yes
debug: Running in taint mode, removing unsafe env vars, and resetting PATH
debug: PATH included '/sbin', keeping.
debug: PATH included '/bin', keeping.
debug: PATH included '/usr/sbin', keeping.
debug: PATH included '/usr/bin', keeping.
debug: PATH included '/usr/games', keeping.
debug: PATH included '/usr/local/sbin', keeping.
debug: PATH included '/usr/local/bin', keeping.
debug: PATH included '/usr/X11R6/bin', keeping.
debug: PATH included '/usr/home/dnewman/bin', keeping.
debug: Final PATH set to: 
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/home/dnewman/bin
debug: using "/usr/local/etc/mail/spamassassin/init.pre" for site rules 
init.pre
debug: config: read file /usr/local/etc/mail/spamassassin/init.pre
debug: using "/usr/local/share/spamassassin" for default rules dir
debug: config: read file /usr/local/share/spamassassin/10_misc.cf
debug: config: read file /usr/local/share/spamassassin/20_anti_ratware.cf
debug: config: read file /usr/local/share/spamassassin/20_body_tests.cf
debug: config: read file /usr/local/share/spamassassin/20_compensate.cf
debug: config: read file /usr/local/share/spamassassin/20_dnsbl_tests.cf
debug: config: read file /usr/local/share/spamassassin/20_drugs.cf
debug: config: read file 
/usr/local/share/spamassassin/20_fake_helo_tests.cf
debug: config: read file /usr/local/share/spamassassin/20_head_tests.cf
debug: config: read file /usr/local/share/spamassassin/20_html_tests.cf
debug: config: read file /usr/local/share/spamassassin/20_meta_tests.cf
debug: config: read file /usr/local/share/spamassassin/20_phrases.cf
debug: config: read file /usr/local/share/spamassassin/20_porn.cf
debug: config: read file /usr/local/share/spamassassin/20_ratware.cf
debug: config: read file /usr/local/share/spamassassin/20_uri_tests.cf
debug: config: read file /usr/local/share/spamassassin/23_bayes.cf
debug: config: read file /usr/local/share/spamassassin/25_body_tests_es.cf
debug: config: read file /usr/local/share/spamassassin/25_hashcash.cf
debug: config: read file /usr/local/share/spamassassin/25_spf.cf
debug: config: read file /usr/local/share/spamassassin/25_uribl.cf
debug: config: read file /usr/local/share/spamassassin/30_text_de.cf
debug: config: read file /usr/local/share/spamassassin/30_text_fr.cf
debug: config: read file /usr/local/share/spamassassin/30_text_nl.cf
debug: config: read file /usr/local/share/spamassassin/30_text_pl.cf
debug: config: read file /usr/local/share/spamassassin/50_scores.cf
debug: config: read file /usr/local/share/spamassassin/60_whitelist.cf
debug: using "/usr/local/etc/mail/spamassassin" for site rules dir
debug: config: read file /usr/local/etc/mail/spamassassin/local.cf
debug: using "/usr/home/dnewman/.spamassassin/user_prefs" for user prefs 
file
debug: config: read file /usr/home/dnewman/.spamassassin/user_prefs
debug: plugin: loading Mail::SpamAssassin::Plugin::URIDNSBL from @INC
debug: plugin: registered 
Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344)
debug: plugin: loading Mail::SpamAssassin::Plugin::Hashcash from @INC
debug: plugin: registered 
Mail::SpamAssassin::Plugin::Hashcash=HASH(0x8b8a164)
debug: plugin: loading Mail::SpamAssassin::Plugin::SPF from @INC
debug: plugin: registered Mail::SpamAssassin::Plugin::SPF=HASH(0x8b9ace8)
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
implements 'parse_config'
debug: plugin: Mail::SpamAssassin::Plugin::Hashcash=HASH(0x8b8a164) 
implements 'parse_config'
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x8b71344) 
inhibited further callbacks
debug: config: SpamAssassin failed to parse line, skipping: 
rewrite_subject         1
debug: config: SpamAssassin failed to parse line, skipping: subject_tag 
*****SPAM*****
debug: config: SpamAssassin failed to parse line, skipping: 
use_terse_report        0
debug: config: SpamAssassin failed to parse line, skipping: auto_learn 
1
debug: bayes: 18389 tie-ing to DB file R/O 
/usr/home/dnewman/.spamassassin/bayes_toks
debug: bayes: 18389 tie-ing to DB file R/O 
/usr/home/dnewman/.spamassassin/bayes_seen
debug: bayes: found bayes db version 3
debug: Score set 2 chosen.
debug: Initialising learner
debug: Syncing Bayes and expiring old tokens...
debug: lock: 18389 created 
/usr/home/dnewman/.spamassassin/bayes.lock.ns.networktest.com.18389
debug: lock: 18389 trying to get lock on 
/usr/home/dnewman/.spamassassin/bayes with 0 retries
debug: lock: 18389 link to /usr/home/dnewman/.spamassassin/bayes.lock: 
link ok
debug: bayes: 18389 tie-ing to DB file R/W 
/usr/home/dnewman/.spamassassin/bayes_toks
debug: bayes: 18389 tie-ing to DB file R/W 
/usr/home/dnewman/.spamassassin/bayes_seen
debug: bayes: found bayes db version 3
debug: refresh: 18389 refresh /usr/home/dnewman/.spamassassin/bayes.lock
debug: refresh: 18389 refresh /usr/home/dnewman/.spamassassin/bayes.lock
synced Bayes databases from journal in 1 seconds: 1316 unique entries 
(2111 total entries)
debug: refresh: 18389 refresh /usr/home/dnewman/.spamassassin/bayes.lock
debug: refresh: 18389 refresh /usr/home/dnewman/.spamassassin/bayes.lock
debug: Syncing complete.
debug: bayes: 18389 untie-ing
debug: bayes: 18389 untie-ing db_toks
debug: bayes: 18389 untie-ing db_seen
debug: bayes: files locked, now unlocking lock
debug: unlock: 18389 unlink /usr/home/dnewman/.spamassassin/bayes.lock

Re: cannot write and parse errors

Posted by Matt Kettler <mk...@comcast.net>.
At 06:17 AM 12/16/2004 -0800, David Newman wrote:
>The docs cover some of these but not all. Neither the USAGE nor the 
>UPGRADE files describe what to use in place of use_terse_report in 3.0.

Yes, it's not in there because it's been dead for a long time. It wasn't 
something that was dropped in 3.0, it was dropped in 2.6.0.

report_safe 0 is the closest to the old "use_terse_report" command.

>I never had 2.xx on my system. I installed 3.0 from ports.

Then your ports maintainer made a lousy local.cf file, one that has 
commands which are from 2.5.x.

Or did you use a tool to build a local.cf for you, and not one that a ports 
maintainer built into the package? (it would seem very odd for a ports 
maintainer to include a local.cf. at all, but who knows, some people are in 
fact on crack)


>spamd[1166]: Cannot write to /nonexistent/.spamassassin/user_
>prefs: No such file or directory

You seem to be running as root, and as such, spamd is defaulting to 
"nobody" for security. use -u. 


Re: cannot write and parse errors

Posted by David Newman <dn...@networktest.com>.
On Thu, 16 Dec 2004, Richard Ozer wrote:

> It looks like your port had a 2.x local.cf file

Thanks very much to all who responded. The port in question is 3.0.1 on 
FreeBSD 5.2.1. I had CVSUP'd the system before installing SA, so I'm 
reasonably sure what I got was current.

Note for the FBSD ports maintainers, if you're on this list: Maybe it's 
not so good to include 2.x configs with 3.x distros....

thanks again

dn

Re: cannot write and parse errors

Posted by Richard Ozer <ro...@ois-online.com>.
It looks like your port had a 2.x local.cf file.  To fix this, comment 
out rewrite_subject, comment out subject_tag, comment out 
use_terse_report, and change auto_learn to bayes_auto_learn

Also be sure you have something like the following section... (replace 
amavis with whatever you prefer or use). "bayes" in line 2 is a bayes db 
file prefix and not a directory.

use_bayes 1
bayes_path /var/amavis/.spamassassin/bayes
bayes_auto_learn 1

Run sa-learn --rebuild or sa-learn --sync to rebuild bayes, and make 
sure you have proper rights to that directory...

That should fix the problems.

RO

David Newman wrote:
> On Thu, 16 Dec 2004, Loren Wilton wrote:
> 
>>> interested in particular in four parse errors:
>>>
>>> debug: config: SpamAssassin failed to parse line, skipping:
>>> rewrite_subject 1
>>> debug: config: SpamAssassin failed to parse line, skipping: 
>>> subject_tag $
>>> *****SPAM*****
>>> debug: config: SpamAssassin failed to parse line, skipping:
>>> use_terse_report 0
>>> debug: config: SpamAssassin failed to parse line, skipping: 
>>> auto_learn $ 1
>>>
>>> Again, why are these failing to be parsed, and how can I correct the
>>> issue?
>>
>>
>> RTFM.  These are 2.6x options and have been changed to other things in 
>> 3.0.
> 
> 
> The docs cover some of these but not all. Neither the USAGE nor the 
> UPGRADE files describe what to use in place of use_terse_report in 3.0.
> 
> I never had 2.xx on my system. I installed 3.0 from ports. Now I have 
> options that don't work and a maillog full of entries like this:
> 
> spamd[1166]: Cannot write to /nonexistent/.spamassassin/user_
> prefs: No such file or directory
> 
> I don't know how to fix this, and it's *not* covered in the docs. Thanks 
> for any guidance on corrective action.
> 
> dn

Re: cannot write and parse errors

Posted by David Newman <dn...@networktest.com>.
On Thu, 16 Dec 2004, Loren Wilton wrote:

>> interested in particular in four parse errors:
>>
>> debug: config: SpamAssassin failed to parse line, skipping:
>> rewrite_subject 1
>> debug: config: SpamAssassin failed to parse line, skipping: subject_tag $
>> *****SPAM*****
>> debug: config: SpamAssassin failed to parse line, skipping:
>> use_terse_report 0
>> debug: config: SpamAssassin failed to parse line, skipping: auto_learn $ 1
>>
>> Again, why are these failing to be parsed, and how can I correct the
>> issue?
>
> RTFM.  These are 2.6x options and have been changed to other things in 3.0.

The docs cover some of these but not all. Neither the USAGE nor the 
UPGRADE files describe what to use in place of use_terse_report in 3.0.

I never had 2.xx on my system. I installed 3.0 from ports. Now I have 
options that don't work and a maillog full of entries like this:

spamd[1166]: Cannot write to /nonexistent/.spamassassin/user_
prefs: No such file or directory

I don't know how to fix this, and it's *not* covered in the docs. Thanks 
for any guidance on corrective action.

dn

Re: cannot write and parse errors

Posted by Loren Wilton <lw...@earthlink.net>.
> interested in particular in four parse errors:
>
> debug: config: SpamAssassin failed to parse line, skipping:
> rewrite_subject 1
> debug: config: SpamAssassin failed to parse line, skipping: subject_tag $
> *****SPAM*****
> debug: config: SpamAssassin failed to parse line, skipping:
> use_terse_report 0
> debug: config: SpamAssassin failed to parse line, skipping: auto_learn $ 1
>
> Again, why are these failing to be parsed, and how can I correct the
> issue?

RTFM.  These are 2.6x options and have been changed to other things in 3.0.

        Loren


Re: cannot write and parse errors

Posted by Matt Kettler <mk...@evi-inc.com>.
At 03:18 PM 12/16/2004, Stuart Johnston wrote:

>Matt Kettler wrote:
> > auto_learn has NEVER been valid. It's bayes_auto_learn. It also should 
> only contain a 1 or a 0 after it. No $
> > I've seen a lot of people with auto_learn in their configs. Where'd you 
> get that? did you use some config auto generator?
>
>http://www.yrex.com/spam/spamconfig.php - generates configs with 'auto_learn'.

Actually, I'll correct myself.. auto_learn WAS the correct option... in 
2.5x....

2.6x accepts auto_learn, but only as a kludge... 3.0 removed the parsing 
kludge...

Looks like MM's spamconfig is based on 2.5.x and the disclaimer at the top 
of the page claims it won't work with previous versions.. It also won't 
work correctly with newer versions...

>This is designed to work with SpamAssassin 2.5x. It will not work 
>correctly with previous versions.


Michael, is there any chance you could revise that text to indicate it's 
designed to work with 2.5x ONLY?

The fact that it worked for 2.6x at all was a bit of a parsing kludge, 
since 2.6x doesn't actually support the use_terse_report command.. It would 
ignore anyone using that option...




Re: cannot write and parse errors

Posted by Jim Maul <jm...@elih.org>.
Stuart Johnston wrote:
> Matt Kettler wrote:
> 
>>
>> auto_learn has NEVER been valid. It's bayes_auto_learn. It also should 
>> only contain a 1 or a 0 after it. No $
>>
>> I've seen a lot of people with auto_learn in their configs. Where'd 
>> you get that? did you use some config auto generator?
> 
> 
> http://www.yrex.com/spam/spamconfig.php - generates configs with 
> 'auto_learn'.
> 
> 

Well that was nice of whoever it was to create that handy little page 
but when it generates an invalid local.cf, it ends up doing more harm 
than good.  Not to mention its waaaay outdated.

-Jim

Re: cannot write and parse errors

Posted by Stuart Johnston <st...@ebby.com>.
Matt Kettler wrote:
> 
> auto_learn has NEVER been valid. It's bayes_auto_learn. It also should 
> only contain a 1 or a 0 after it. No $
> 
> I've seen a lot of people with auto_learn in their configs. Where'd you 
> get that? did you use some config auto generator?

http://www.yrex.com/spam/spamconfig.php - generates configs with 
'auto_learn'.

Re: cannot write and parse errors

Posted by Matt Kettler <mk...@comcast.net>.
At 08:50 PM 12/15/2004 -0800, David Newman wrote:
>Dec 15 00:42:53 mailman spamd[2224]: Cannot write to 
>/nonexistent/.spamassassin/user_ prefs: No such file or directory
>
>There's no such user as "nonexistent" on this system.

Where do you get the idea there might be a user "nonexistent"? That's the 
name of a user's home directory, and it's not even in /home. It's probably 
the homedir of the user "nobody".

>Why is this occurring and how can I correct it?

Start passing -u to either spamd or spamc, since it appears both are 
running as root right now. spamd doesn't like to parse mail as root, and 
will setuid itself to nobody if it finds it's in that state.

>I've pasted the complete output from "sa-learn -d --sync" below, but I'm 
>interested in particular in four parse errors:
>
>debug: config: SpamAssassin failed to parse line, skipping: rewrite_subject 1
>debug: config: SpamAssassin failed to parse line, skipping: subject_tag $ 
>*****SPAM*****
>debug: config: SpamAssassin failed to parse line, skipping: use_terse_report 0
>debug: config: SpamAssassin failed to parse line, skipping: auto_learn $ 1
>
>Again, why are these failing to be parsed, and how can I correct the issue?

They're failing because they are all invalid. Some in multiple ways.


rewrite_subject and subject_tag have been replaced by rewrite_header in SA 
3.0.x. See the UPGRRADE file
http://spamassassin.apache.org/full/3.0.x/dist/UPGRADE
Also, make sure you don't have a mis-placed $ in the middle of your 
rewrite_header command, like the subject_tag command above does.

use_terse_report was deprecated (ie: did nothing) in 2.6.x, and is now 
completely not supported in 3.0.x

auto_learn has NEVER been valid. It's bayes_auto_learn. It also should only 
contain a 1 or a 0 after it. No $

I've seen a lot of people with auto_learn in their configs. Where'd you get 
that? did you use some config auto generator?