Re: [qmailtoaster] bayes_* permissions

2006-11-07 Thread Quinn Comendant
It's not necessary, but it's a pretty darned good idea. 

Are you running any periodical (cron) sync or expire options with sa-learn? 
Training mechanisms? I'm venturing to setup a setup within Horde/IMP so users 
can flag spam/ham message to help train the database. But I'm still a bit short 
in the know-how of executing scripts via valias (see my related thread).

Configuring and tuning SA is a top priority for the QT in my opinion.

Q

On Mon, 06 Nov 2006 22:01:25 -0700, Eric Shubes wrote:
 I guess thing to know is that you don't want to run spamassassin (or
 sa-learn) as root. Must be as vpopmail user. Is that it?

-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [qmailtoaster] bayes_* permissions

2006-11-07 Thread David Sánchez Martín
Are you running any periodical (cron) sync or expire options with sa-learn?
Training mechanisms? I'm venturing to setup a setup within Horde/IMP so
users can flag spam/ham message to help train the database. But I'm still a
bit short in the know-how of executing scripts via valias (see my related
thread).



Maybe this is usefull for somebody.
 
I've a cronjob like this

0 * * * * sudo -u vpopmail -H /usr/local/bin/learnSpam.sh /dev/null


VERIFICADO is a spam subfolder under spam and nospam imap INBOX folder and i
told my users to resend (not forward!) or send as attachment the misses to
[EMAIL PROTECTED] and the false positives to [EMAIL PROTECTED] I also 
implemented
SpamButtons in squirrelmail (sending reported mails as attachment).

I check that accounts via Outlook twice a day, and I put correctly reported
(i don't trust my users :-P ) to the VERIFICADO (this means VERIFIED)
subfolder.

This is working great for my domains for a month now.

I also do razor-report comment out if you like.


#!/bin/bash
# Spam Assassin Bayes Training

VPOPMAIL=/home/vpopmail
[EMAIL PROTECTED]
[EMAIL PROTECTED]

IMAPSUBFOLDERAPPEND=.VERIFICADO
LEARNHAM=/usr/bin/sa-learn -u vpopmail --ham
LEARNSPAM=/usr/bin/sa-learn -u vpopmail --spam
RAZOR_REPORT=razor-report 

# Check everything's ok if not, complain!

if ! $VPOPMAIL/bin/vuserinfo $SPAMADDRESS /dev/null 21 ; then
echo $SPAMADDRESS doesn\'t exist here. Aborting. ;

exit 1;

fi

if ! $VPOPMAIL/bin/vuserinfo $NOSPAMADDRESS /dev/null 21 ; then
echo $NOSPAMADDRESS doesn\'t exist here. Aborting. ;

exit 1;

fi


# Checking spam folders...

SPAMMAILDIR=`$VPOPMAIL/bin/vuserinfo -d $SPAMADDRESS
`/Maildir/$IMAPSUBFOLDERAPPEND

NOSPAMMAILDIR=`$VPOPMAIL/bin/vuserinfo -d $NOSPAMADDRESS
`/Maildir/$IMAPSUBFOLDERAPPEND

if ! [ -d $SPAMMAILDIR/new  ]; then
echo Unreaded SPAM maildir \($SPAMMAILDIR/new \) doesn\'t exist!.
quitting.;
exit 1;
fi

if ! [ -d $SPAMMAILDIR/cur  ]; then
echo Readed SPAM maildir \($SPAMMAILDIR/cur \) doesn\'t exist!.
quitting.;
exit 1;
fi

if ! [ -d $NOSPAMMAILDIR/new  ]; then
echo Unreaded NOSPAM maildir \($NOSPAMMAILDIR/new \) doesn\'t
exist!. quitting.;
exit 1;
fi

if ! [ -d $NOSPAMMAILDIR/cur  ]; then
echo readed NOSPAM maildir \($NOSPAMMAILDIR/cur \) doesn\'t exist!.
quitting.;
exit 1;
fi

# Learn spam!

cd $SPAMMAILDIR/cur
$LEARNSPAM ./*

for spam in *; do
  $RAZOR_REPORT $PWD/$spam ;
done 21

rm -rf $SPAMMAILDIR/cur/*

cd $SPAMMAILDIR/new
$LEARNSPAM ./*

for spam in *; do
  $RAZOR_REPORT $PWD/$spam ;
done 21


rm -rf $SPAMMAILDIR/new/*

# Learn ham!

cd $NOSPAMMAILDIR/cur
$LEARNHAM ./*
rm -rf $NOSPAMMAILDIR/cur/*

cd $NOSPAMMAILDIR/new
$LEARNHAM ./*
rm -rf $NOSPAMMAILDIR/new/*

# Update the Bayes DB
/usr/bin/sa-learn --sync



# EOF






-Mensaje original-
De: Quinn Comendant [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 07 de noviembre de 2006 9:26
Para: qmailtoaster-list@qmailtoaster.com
Asunto: Re: [qmailtoaster] bayes_* permissions

It's not necessary, but it's a pretty darned good idea. 

Are you running any periodical (cron) sync or expire options with sa-learn?
Training mechanisms? I'm venturing to setup a setup within Horde/IMP so
users can flag spam/ham message to help train the database. But I'm still a
bit short in the know-how of executing scripts via valias (see my related
thread).

Configuring and tuning SA is a top priority for the QT in my opinion.

Q

On Mon, 06 Nov 2006 22:01:25 -0700, Eric Shubes wrote:
 I guess thing to know is that you don't want to run spamassassin (or
 sa-learn) as root. Must be as vpopmail user. Is that it?

-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

BEGIN:VCARD
VERSION:2.1
N:Sánchez Martín;David
FN:[EMAIL PROTECTED] ([EMAIL PROTECTED])
ORG:E2000 Financial Investments, S.A.;Centro de Nuevas Tecnologías
TITLE:Administrador de Sistemas
TEL;WORK;VOICE:902196177
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Agust=EDn Bravo 17 2=BA B=0D=0A33120 PRAVIA;Asturias;;;Espa=F1a
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Agust=EDn Bravo 17 2=BA B=0D=0A33120 PRAVIA=0D=0AAsturias=0D=0AEspa=F1a
URL;WORK:http://www.e2000.es
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20060705T152542Z
END:VCARD

-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: [qmailtoaster] bayes_* permissions

2006-11-07 Thread fuzzy

On Tue, November 7, 2006 2:45 am, David Sánchez Martín wrote:


 Maybe this is usefull for somebody.

 I've a cronjob like this


that was *very* useful.  i am a noob, yet i was able to follow your post
and implement squirrel spam training for my toaster...after installing
spam_buttons and modifying your 'template' to match my domain details.


gracias and thanks-a-million,

-- 
fuzzy (toasting since 04/2006)
Current stable + Erik's updates
Centos 4.4-32bit-the easy way
Athlon 1500+, 768m, 80g


-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [qmailtoaster] bayes_* permissions

2006-11-07 Thread Eric \Shubes\
Quinn Comendant wrote:
 It's not necessary, but it's a pretty darned good idea. 
 
 Are you running any periodical (cron) sync or expire options with sa-learn?

Not yet. I've been leaving that out in hopes of pinpointing what the problem
really is. I wait for it to break, run something, and wait for it to break
again. Once I'm confident with what's going on, I'll add a daily cron job.

 Training mechanisms?

Not yet.

 I'm venturing to setup a setup within Horde/IMP so users can flag spam/ham 
 message to help train the database. But I'm still a bit short in the know-how 
 of executing scripts via valias (see my related thread).

Sounds good.

 Configuring and tuning SA is a top priority for the QT in my opinion.

I agree.

 Q
 

I'm not quite so eager to set up a whole training mechanism yet. From a
philosophical point of view, I still believe that bayesian type of filtering
is best done at the user level. SA only does this globally, and if you're
running multiple domains the problem is even worse.

That's why I'm interested in seeing DSpam implemented in the toaster. I've
heard of some servers running both SA and DSpam (in that order). I'd like to
see how well DSpam does on its own first, then maybe use SA with bayes
turned off along with DSpam.

I'm thinking it'll be several months though before we get DSpam running on a
toaster. In the meantime, I'm simply try to get SA stabilized.

-- 
-Eric 'shubes'

-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [qmailtoaster] bayes_* permissions

2006-11-07 Thread Quinn Comendant
Actually I think I was wrong on this. For sa-learn, -C is for the *distributed* 
config files (i.e. /usr/share/spamassassin)...

   -C path, --configpath=path, --config-file=path
   Use the specified path for locating the distributed configuration 
files.  Ignore the default directories (usually /usr/share/spamassassin or 
similar).

   --siteconfigpath=path
   Use the specified path for locating site-specific configuration 
files.  Ignore the default directories (usually /etc/mail/spamassassin or 
similar).

Quinn



On Mon, 6 Nov 2006 18:42:48 -0800, Quinn Comendant wrote:
 Whoops. Try -H. By default sudo does not modify the $HOME variable, 
 leaving set to root...
 
-H  The -H (HOME) option sets the HOME environment variable to 
 the homedir of the target user (root by default) as specified in 
 passwd(5).  By default, sudo does not modify HOME.
 
 Or, if you have your bayes_path and autowhitelist path set in your 
 config, you can run spamassassin (spamc, spamd) with the -C option:
 
 -C path, --configpath=path, --config-file=path
   Path to standard configuration dir
 
 Q
 
 
 On Mon, 06 Nov 2006 19:08:02 -0700, Eric Shubes wrote:
 So, how do I get it to use /home/vpopmail instead of /root for these? I'm
 guessing that there might be something in local.cf I can set (similar to
 bayes_path), but I gotta go for now.
 
 -
  QmailToaster hosted by: VR Hosted http://www.vr.org
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [qmailtoaster] bayes_* permissions

2006-11-06 Thread Quinn Comendant
Well, good! At least I didn't do anything wrong.

 Do you have a cron job running spammassassin or sa-learn? If you're running 
 sa-learn, you'll need to use the '-u vpopmail' and that should work.

I do have a cron job, and I can fix that to run as user vpopmail.

 I've been trying to find a way to run spamassassin -D --lint as vpopmail
 though, and haven't been successful. Does anyone know of a way to do this?
 If not, I'd say that the basic toaster is broken (jmho) and needs a fix.

I know you could try running with:

sudo -u vpopmail spamassassin -D --lint

That should work even though vpopmail doesn't have a shell.

Quinn

-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [qmailtoaster] bayes_* permissions

2006-11-06 Thread Eric \Shubes\
Quinn Comendant wrote:
 Well, good! At least I didn't do anything wrong.
 
 Do you have a cron job running spammassassin or sa-learn? If you're running 
 sa-learn, you'll need to use the '-u vpopmail' and that should work.
 
 I do have a cron job, and I can fix that to run as user vpopmail.
 
 I've been trying to find a way to run spamassassin -D --lint as vpopmail
 though, and haven't been successful. Does anyone know of a way to do this?
 If not, I'd say that the basic toaster is broken (jmho) and needs a fix.
 
 I know you could try running with:
 
 sudo -u vpopmail spamassassin -D --lint
 
 That should work even though vpopmail doesn't have a shell.
 
 Quinn
 

I didn't think of sudo because I can't su. ;) Good idea.

However, when I do that, I get:
[11898] warn: config: cannot write to /root/.spamassassin/user_prefs:
Permission denied
[11898] warn: config: failed to create default user preference file
/root/.spamassassin/user_prefs
--- regular output 
[11898] warn: auto-whitelist: open of auto-whitelist file failed: locker:
safe_lock: cannot create tmp lockfile
/root/.spamassassin/auto-whitelist.lock.doris.shubes.net.11898 for
/root/.spamassassin/auto-whitelist.lock: Permission denied

So, how do I get it to use /home/vpopmail instead of /root for these? I'm
guessing that there might be something in local.cf I can set (similar to
bayes_path), but I gotta go for now.

Thanks, Quinn.
-- 
-Eric 'shubes'

-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [qmailtoaster] bayes_* permissions

2006-11-06 Thread Quinn Comendant
Whoops. Try -H. By default sudo does not modify the $HOME variable, leaving set 
to root...

   -H  The -H (HOME) option sets the HOME environment variable to the 
homedir of the target user (root by default) as specified in passwd(5).  By 
default, sudo does not modify HOME.

Or, if you have your bayes_path and autowhitelist path set in your config, you 
can run spamassassin (spamc, spamd) with the -C option:

-C path, --configpath=path, --config-file=path
  Path to standard configuration dir

Q


On Mon, 06 Nov 2006 19:08:02 -0700, Eric Shubes wrote:
 So, how do I get it to use /home/vpopmail instead of /root for these? I'm
 guessing that there might be something in local.cf I can set (similar to
 bayes_path), but I gotta go for now.

-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [qmailtoaster] bayes_* permissions

2006-11-06 Thread Eric \Shubes\
Ok, that works. I got
[16160] warn: config: created user preferences file:
/home/vpopmail/.spamassassin/user_prefs
the first time I ran it, so apparently it hadn't been created yet.
I suppose I can eliminate the bayes_path in my local.cf file, since it
should find it this way.

I guess thing to know is that you don't want to run spamassassin (or
sa-learn) as root. Must be as vpopmail user. Is that it?

Quinn Comendant wrote:
 Whoops. Try -H. By default sudo does not modify the $HOME variable, leaving 
 set to root...
 
-H  The -H (HOME) option sets the HOME environment variable to the 
 homedir of the target user (root by default) as specified in passwd(5).  By 
 default, sudo does not modify HOME.
 
 Or, if you have your bayes_path and autowhitelist path set in your config, 
 you can run spamassassin (spamc, spamd) with the -C option:
 
 -C path, --configpath=path, --config-file=path
   Path to standard configuration dir
 
 Q
 
 
 On Mon, 06 Nov 2006 19:08:02 -0700, Eric Shubes wrote:
 So, how do I get it to use /home/vpopmail instead of /root for these? I'm
 guessing that there might be something in local.cf I can set (similar to
 bayes_path), but I gotta go for now.
 



-- 
-Eric 'shubes'

-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]