On 12/20/2011 10:57 PM, Helmut Fritz wrote:
And a little background on this - my server is both a mail server and acts
as a smart host front end for an exchange server. So I cannot use the
typical method of scanning users junk email folders, I can only have known
spams forwarded back to a spam mailbox and false positives to a ham mailbox.
-----Original Message-----
From: Helmut Fritz [mailto:[email protected]]
Sent: Tuesday, December 20, 2011 8:13 PM
To: [email protected]
Subject: [qmailtoaster] sa-learn-attach
Any of you ever heard of this script? Would it work to learn on attachments
vs actual emails? This could be very handy for training SpamAssassin if it
would work, or at least easier on users. I am definitely not a
coder/scripter, so wondering if anyone can take a look. Or is there a built
in method for doing this in the newer versions of SpamAssassin? Thx!
---------------------------------------------------------------------------------
I haven't heard of it, but it appears to be what you're looking for.
Personally, I would prefer to have it simply strip the attachment from
the input stream and pipe the result to the real sa-learn, instead of
duplicating sa-learn's code.
Also, this method has the drawback of getting users trained to use
"Forward as attachment".
Other than that, I'd say it's worth a try.
I wonder if you could create a shared folder on the exchange server for
spam/ham, and have people move/copy their messages there. Then you could
make the QMT a samba client to the exchange server, mount the shares as
cifs, and run a sa-learn script that way.
Here's the script I use with a shared folder to learn ham and spam, fwiw:
#!/bin/sh
#####################################################################
# learn and remove spam and ham in shared folders
#####################################################################
# shubes 3/26/08 - created
#####################################################################
learndir="/home/vpopmail/domains/shubes.net/sa-learn"
hambox=.Ham
spambox=.Spam
do_the_learning(){
learnas=$1
maildir=$2
shopt -s extglob
for spamfile in `find $maildir/+(cur|new)/* 2>/dev/null`; do
sudo -u vpopmail -H sa-learn --$learnas $spamfile
rc=$?
if [ $? != "0" ]; then
echo "sa-learn failed, rc=$rc, spamfile=$spamfile"
exit $rc
fi
rm $spamfile
done
}
do_the_learning ham "$learndir/$hambox"
do_the_learning spam "$learndir/$spambox"
exit 0
--
-Eric 'shubes'
---------------------------------------------------------------------------------
Qmailtoaster is sponsored by Vickers Consulting Group
(www.vickersconsulting.com)
Vickers Consulting Group offers Qmailtoaster support and installations.
If you need professional help with your setup, contact them today!
---------------------------------------------------------------------------------
Please visit qmailtoaster.com for the latest news, updates, and packages.
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]