From: Peter James on
I have downloaded a corpus of spam messages from the SpamAssassin archive.
To which directory do I need to copy them in order to use them to train
SpamAssassin.

My instructions tell me to use the command:
"sa-learn --showdots --spam mbox ./spam-corpus"
But that command at present returns the error message to the effect that:

"bayes: expire_old_tokens: locker: safe_lock: cannot create tmp lockfile
/Users/peter/.spamassassin/bayes.lock.Phreddes-iMac-G5.local.3339 for
/Users/peter/.spamassassin/bayes.lock: Permission denied

archive-iterator: unable to open ./spam-corpus: No such file or directory

Learned tokens from 0 message(s) (0 message(s) examined)

And should I ussue this command as root or user. The instructions are not
clear on this point. Thanks

From: Tim McNamara on
In article <0001HW.C103917B000F34B7F0284530(a)news.claranews.com>,
Peter James <pfjamesAT(a)clara.co.uk> wrote:

> I have downloaded a corpus of spam messages from the SpamAssassin
> archive. To which directory do I need to copy them in order to use
> them to train SpamAssassin.

See below. The explanation is a bit roundabout so that you will
hopefully understand more about the way that Unix-y stuff works. I
could just tell you where to put the file on your computer, but you
should really know *why.* You have three options for dealing with this,
but I'll tell you two of them because those make the most sense to me.

> My instructions tell me to use the command:
> "sa-learn --showdots --spam mbox ./spam-corpus"
> But that command at present returns the error message to the effect that:
>
> "bayes: expire_old_tokens: locker: safe_lock: cannot create tmp lockfile
> /Users/peter/.spamassassin/bayes.lock.Phreddes-iMac-G5.local.3339 for
> /Users/peter/.spamassassin/bayes.lock: Permission denied
>
> archive-iterator: unable to open ./spam-corpus: No such file or directory

OK. Now, in your command

sa-learn --showdots --spam mbox ./spam-corpus

sa-learn is an application that is being run, --showdots is a flag that
modifies how the application runs, and --spam is a flag indicating to
sa-learn that everything sa-learn is about to read is spam, and mbox
specifies the type of file (mbox is a Unix mailbox file format).

../spam-corpus tells sa-learn to look for spam-corpus in your current
directory (that's what the ./ means). Therefore you need to make sure
that the file spam-corpus is actually in that directory, and the results
"No such file or directory" tell you that it's not.

So, try the command pwd (means "print working directory"), which will
tell you what your current directory is, and move the file spam-corpus
to that directory. This is most likely going to be /Users/peter but
your Web browser probably put the file somewhere else, like on the
Desktop or whatever download folder you have specified. So move it
where pwd tells you that you are. Then run

sa-learn --showdots --spam mbox ./spam-corpus

again and it should work.

Alternatively you could leave spam-corpus where it is and change the
command by replacing the ./ with the path to the file, which would look
something like:

/Users/peter/path/to/spam-corpus

Say that spam-corpus is on your desktop. Then

/Users/peter/Desktop/spam-corpus

would replace ./spam-corpus

in the sa-learn command. Make sense? You have two simple options:
move the file to the directory where sa-learn expects it to be (but
isn't), or point sa-learn to the file in it's current location. (The
third option, cd'ing to the directory where spam-corpus is located and
running sa-learn from there might be simple or might be more complicated
depending on whether sa-learn is in your $PATH).

Now, if it still doesn't run, say you get a "permission denied"
response, then you may need to change permissions on spam-corpus. You
also might need to change permissions on .spamassassin and/or
..spammassassin/bayes.lock as well. You'll learn about chmod to do that.

Also, you should do specific training with a corpus of spam that you
have received, so that SpamAssassin gets trained on the types of spam
that you receive. Otherwise SpamAssassin can be fooled by personalized
spam. Training it on real spam that you have received will improve its
hit rate. Also, you should train it with a corpus of your own non-spam
so that it knows what your non-spam e-mail looks like. This will reduce
your false positives rate.

> And should I ussue this command as root or user. The instructions are not
> clear on this point. Thanks

Don't run anything as root unless you know *exactly* what you are doing.
Ever. Unless you want to be reinstalling your operating system. Learn
about sudo as the safer alternative to root (try "man sudo" from the
command line, without the quotes).

Do you know about the man pages? "Man" = "manual" and contains the
instructions for how to use various Unix programs. The syntax is "man"
followed by the name of the program:

man sudo

man spamassassin

man chmod

Etc. The man pages are written in a language that resembles English.
But isn't. ;-) You'll see what I mean.
From: Peter James on
On Sat, 12 Aug 2006 16:53:15 +0100, Tim McNamara wrote
(in article <timmcn-DCDAB3.10531512082006(a)news.iphouse.com>):

> In article <0001HW.C103917B000F34B7F0284530(a)news.claranews.com>,
> Peter James <pfjamesAT(a)clara.co.uk> wrote:
>
>> I have downloaded a corpus of spam messages from the SpamAssassin
>> archive. To which directory do I need to copy them in order to use
>> them to train SpamAssassin.
>
> See below. The explanation is a bit roundabout so that you will
> hopefully understand more about the way that Unix-y stuff works. I
> could just tell you where to put the file on your computer, but you
> should really know *why.* You have three options for dealing with this,
> but I'll tell you two of them because those make the most sense to me.
> snipped

Thank you, a very clear and most useful reply that should get me going again
soon.

>> And should I ussue this command as root or user. The instructions are not
>> clear on this point. Thanks
>
> Don't run anything as root unless you know *exactly* what you are doing.
> Ever. Unless you want to be reinstalling your operating system. Learn
> about sudo as the safer alternative to root (try "man sudo" from the
> command line, without the quotes).
>
> Do you know about the man pages? "Man" = "manual" and contains the
> instructions for how to use various Unix programs. The syntax is "man"
> followed by the name of the program:
>
> man sudo
>
> man spamassassin
>
> man chmod
>
> Etc. The man pages are written in a language that resembles English.
> But isn't. ;-) You'll see what I mean.

Yes, I do know about man pages and their fractured English. When downloading
instructions from the Internet, it's not always clear if the program has to
be compiled by user or not. I always wonder what would happen to any program
that was compiled as a user when super user should have been used instead.

From: Tim McNamara on
In article <0001HW.C103D1510000B048F0284530(a)news.claranews.com>,
Peter James <pfjamesAT(a)clara.co.uk> wrote:

> Yes, I do know about man pages and their fractured English. When
> downloading instructions from the Internet, it's not always clear if
> the program has to be compiled by user or not. I always wonder what
> would happen to any program that was compiled as a user when super
> user should have been used instead.

Depending on how your system is set up (e.g. permissions for running the
compiler), to be able to compile you may have to do it as the superuser
in the first place. If you compile it as a user rather than a
superuser, then you may be the only person able to run the application.
This is usually only an issue in a multiuser environment, which is not
most home settings.
 | 
Pages: 1
Prev: kernel_task processes?
Next: Restart on AC