Hello, we understand your script and your solution, but your configuration still uses a sitewide bayesian learning. What we want to implement is a per-user spamassassin training and we haven't found specific solutions in this direction on the internet. If anyone has tryied something similiar before and got it working we would aprecciate that you tell us how to do it. Recently, we learnt about a perl module capable of interfacing bayesian database with mysql, apparently, per user although we are not sure this works.
Best regards,
         Lucas Piccoli

2006/8/24, Brian G. Peterson <brian@braverock.com>:
On Thursday 24 August 2006 10:50, Lucas Piccoli wrote:
> We are trying to make squirrelmail work with spamassassin using
> spambuttons plugin. The problem is that we don't know how to make
> spamassassin learn its rules from each user. The users are virtual and
> kept in a mysql database. User vmail does it all. Is it posible to use
> sa-learn with a db for each user?

You've got a few separate issues here.

User preferences for SpamAssassin stored in a SQL database may be modified
using the SpamAssassin+SQL plugin

SpamButtons plugin allows users to report mail as spam into a specific
folder... either per-user or sitewide, depending on how you set it up.

calling sa-learn with the -u option will have spamassassin go get the
prefs for that user from your SQL database.  calling sa-learn will be
done from something like a daily cron job on the server, not from the
Squirrelmail interface, as sa-learn needs to sun as the spamd user, root,
or the user in question (with shell users).  So, your cron job would loop
on each virtual user, calling sa-learn in turn for each user on the
system, looking in their Missed_Spam and Missed_Ham folders (or whatever
you called them).

So, for example, here is the cron script that I use:

# @author David Hurst
# Script to automate learning Spamsign

open PASSWD, "/etc/passwd";
while(<PASSWD>) {
$user = $_[0];
$uid = $_[2];
$gid = $_[3];
$dir = $_[5];
if (-d "$dir/mail") {
   print "$dir/mail\n";
   chdir "$dir/mail";
   print "Spam:\n";
   system "sa-learn -u $user --mbox --spam Missed_Spam";
   print "Ham:\n";
   system "sa-learn -u $user --mbox --ham Missed_Ham";
   system "rm Missed_Spam" if -f "Missed_Spam";
   system "rm Missed_Ham" if -f "Missed_Ham";
   system "touch Missed_Spam Missed_Ham";
   chown $uid, $gid, "Missed_Spam", "Missed_Ham";

which uses shell users and mbox format mail folders.  You'd need to modify
it or write your own to use virtual users or Maildir folders.


- Brian

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
squirrelmail-plugins mailing list
Posting Guidelines: http://www.squirrelmail.org/wiki/MailingListPostingGuidelines
List Address: squirrelmail-plugins@lists.sourceforge.net
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.plugins
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3931
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins