On Tue, 2010-11-09 at 08:14 -0800, Karl Meyer wrote:
> # su -c "/usr/bin/sa-learn --dbpath /var/amavis/.spamassassin/bayes/ --ham

The --dbpath option is bad. Despite its name, it is not a "path", but a
prefix. The sa-update man page states it is in bayes_path form, which is
documented in the general SA Conf documentation.

"This is the directory and filename for Bayes databases". Since your
given path looks similar to the default, I assume you actually meant to
keep that SA data in the .spamassassin/ dir. For that, just drop the
trailing slash. Also, please re-read carefully that part of the docs.

  --dbpath /var/amavis/.spamassassin/bayes

> --showdots /var/spool/imap/user/kmeyer/[0-9]*." amavis
                                         ^^^^^^^
This is dangerous. With lots of mail in the (Maildir?) folder, shell
expansion *quickly* will exceed the command line length limit.

I believe passing the Maildir directory containing the messages should
do. Someone who actually uses sa-learn with Maildir please correct
me. :)

The trailing dot also looks bad.


> And one more question: I read, that I have to learn spam AND ham, to make
> bayes work. I can use the Inboxes of users as source for ham and the junk
> folder for spam. But: First a spam mail comes to the inbox (where it get
> learned as ham). Then the user moves it to the junk folder, where it should
> get learned as spam. Is this a possible configuration? Or does this confuses
> SA?

That is OK. As has been answered already, SA will not learn a given
message twice, the same type. It will, however, re-learn and revert the
previous learning, if you later correct the type and learn as something
different.

Please do read the sa-learn man page.

> I can't have one folder for every user where to store ham. E. g. I have
> allready 30 folders where I sort my mails in. I can't have it all in one
> folder. The inbox is the only folder where every mail gets surely in and
> could be used by sa-learn.

A word of caution. There is no move command with IMAP. Instead, it is
copy and delete. Or rather mark-for-deletion, since there is no delete
command either. That's expunge.

In practice that means, that a mail that supposedly has been "moved" to
e.g. a junk folder, *still* is in its source folder, marked for
deletion, usually not visible to the user -- until that folder has been
expunged. Training Bayes from that folder will also learn from these
invisible, "deleted" messages.

Using the Inbox rather than a dedicated ham folder therefore is NOT a
good idea.


-- 
char *t="\10pse\0r\0dtu...@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}

Reply via email to