Re: Spamassassin 3.0.2 autolearn=ham/spam/no

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2005-03-04 at 12:07 +0530, crisppy fernandes wrote:

> >   If you (or anyone else) wants this simple little script, I'd be
> >happy to send it to you, just let me know.  It runs on the server side
> >and has been updated to work with SA 3.0.2.
> >
>  >  And that way you get the same effect as the 'junk' mechanism in
> >Evolution, no matter what client you're using!
> >

> Right now any help welcome to make it wrk.

    Ok, two things: I installed from RPMS originally, and somehow it
didn't make me aware it required a couple of perl modules. Keep an eye
on /var/log/maillog because that's where I noticed it wasn't running
baysean tests because the modules weren't loaded.

    The other is this script.

-------------------------------------------------------------------------
# Program to search and learn from Black/Whitelist folders
for i in `ls -d /home/*`;
  do
    #echo "Processing " $i;
    if ([ -f `echo $i'/mail/Blacklist'` ]) then
      USERNAME=`basename $i`
      MAILBOX=`echo $i'/mail/'`

      #echo $USERNAME ": " $MAILBOX
      if ( [ -s ${MAILBOX}Blacklist ] ) then
        sudo -H -u $USERNAME sa-learn  --spam --no-sync --mbox  $MAILBOX/Blacklist 2>&1 >> /var/log/learnspam && cp /dev/null $MAILBOX/Blacklist
        sudo -H -u $USERNAME sa-learn  --ham  --no-sync --mbox  $MAILBOX/Whitelist  2>&1 >> /var/log/learnspam && cp /dev/null $MAILBOX/Whitelist
      fi
    fi
  done

# Once they're all loaded, rebuild en-masse:
sa-learn --sync
-------------------------------------------------------------------------

    Every hour or so this script is called to go looking for users that
have "Blacklist" and/or "Whitelist" folders, and if there's anything
there, it processes it.  One process for spam, one for ham.  Note that
it's looking for "Blacklist" and not "bLackList" or somesuch; the folder
name has to be right.

    If this still doesn't have you running happily, send me a copy of
your /var/log/maillog off-list and I'll take a peek at it for you.

    Enjoy!

-- 
------------------------------------------------------------------------
Brian FahrlÃnder                 Christian, Conservative, and Technomad
Evansville, IN                                http://www.fahrlander.net 
ICQ: 5119262                                          AIM: WheelDweller
------------------------------------------------------------------------

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux