Re: lazy man's help to spam assassin

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Craig White
Date:  
To: plug-discuss
Subject: Re: lazy man's help to spam assassin
On Thu, 2004-02-26 at 21:15, der.hans wrote:
> Am 24. Feb, 2004 schwätzte Craig White so:
>
> > I suppose that I could read the mail lists on spam assassin but I'm
> > thinking that others have done this so I thought I would toss it out
> > here first.
> >
> > Spam Assassin running as spamd on multi-user mail/web server.
> >
> > I want to allow individual users the ability to 'easily' categorize spam
> > / not-spam and created IMAP account boxes and thinking that I could run
> > a script...
> >
> > !#/bin/sh
> > for i in `cat /root/scripts/users`; \
> >
> > su $i -c /bin/sh "/usr/bin/sa-learn --mbox --spam \
> > /home/users/$i/mail/SPAM-learn";
> >
> > su $i -c /bin/sh "/usr/bin/sa-learn --mbox --ham \
> > /home/users/$i/mail/SPAM-not"; \
> >
> > cat /dev/null > /home/users/$i/mail/SPAM-learn;
> > cat /dev/null > /home/users/$i/mail/SPAM-not;
> >
> > done
> >
> > So that users spam rules update - perhaps nightly by copying emails
> > directly into their SPAM-learn/SPAM-not boxes...does this make sense?
>
> Yes. I do something like this for myself. It's getting to the point where
> you might want to run it a few times a day, though :(.
>
> I've been running into problems with spamassassin eating it's database or
> something :(. I need to update to a new version and see if that fixes it. It
> might also be because I'm on a machine that's woefully underpowered for
> spamassassin.
>
> I would suggest using a lock file to copy the mailboxen, before working on
> them, though.
>
> ">file" should work rather than using "cat /dev/null >file".
>
> What we really need is a MUA that understands 'these are SPAM' folders and
> 'these are no-SPAM' folders and then copies all non-SPAM into a new-HAM
> folder and copies all SPAM to a new-SPAM folder.
>
> I bet it could be done in mutt. But then you'd have to use mutt :(.
>
> evolution anyone? With the virtual folder stuff it might be possible. Then
> you'd keep a timestamp on the last time the user was checked and grab a copy
> of new mail since the user was last checked.

---
way cool - this is what I ultimately worked out - not entirely sure that
it works but no one is complaining... This has the good/bad effect of
cleaning out the 'spam' & 'ham' folders just because I figger users
don't want to bother with them again.

if nothing else...my shell scripting is getting better (note the
portability with the variables...) ( > file... live and learn)

# cat /root/scripts/spam
#!/bin/sh
LEARN="/usr/bin/sa-learn"
HOME_FOLDER="/home/users"
MAIL="mail"
USERS="/root/scripts/users-spam-check"
SHELL="/bin/sh"
SPAM="SPAM-learn"
HAM="SPAM-not"

for i in `cat $USERS`; \
do su - $i -s $SHELL -c "$LEARN --mbox --spam
$HOME_FOLDER/$i/$MAIL/$SPAM"; \
su - $i -s $SHELL -c "$LEARN --mbox --ham $HOME_FOLDER/$i/$MAIL/$HAM"; \
cat /dev/null > $HOME_FOLDER/$i/$MAIL/$SPAM; \
cat /dev/null > $HOME_FOLDER/$i/$MAIL/$HAM; \
done


---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss