I'm setting up the
learnspam script in cron.daily to use with my Spam ham folders. Per the
instructions on the mailing list, it's set up as a soft link from
/etc/cron.daily to /usr/bin. However, when I try testing it with
./learnspam, I get the following error:
./learnspam: line
32: syntax error: unexpected end of file
Any
ideas?
Thanks,
Ron
Jones
See below for the
exact wording of the scriipt:
#!/bin/sh
#
# Script to feed sa-learn from selected users # # Add the selected
#users to userlist.txt in vpopmail # domain root. Add users on one
#line with one space # between names but, no space or line feed at the
#end # of the line.
#
# Add domains to domlist.txt in the same manner.
#
# Nick Hemmesch <[EMAIL PROTECTED]>
# March 24, 2005
#
#
# Script to feed sa-learn from selected users # # Add the selected
#users to userlist.txt in vpopmail # domain root. Add users on one
#line with one space # between names but, no space or line feed at the
#end # of the line.
#
# Add domains to domlist.txt in the same manner.
#
# Nick Hemmesch <[EMAIL PROTECTED]>
# March 24, 2005
#
DPATH=/home/vpopmail/domains
DLIST=${DPATH}/domlist.txt
DLEARN=`cat ${DLIST}`
for x in ${DLEARN}; do
echo "Checking $x"
USERLIST=${DPATH}/$x/userlist.txt
SPAMUSER=`cat ${USERLIST}`
for i in ${SPAMUSER}; do
/usr/bin/sa-learn --spam ${DPATH}/$x/$i/Maildir/.Spam/new/*
rm -rf ${DPATH/$x}/$i/Maildir/.Spam/new/*
/usr/bin/sa-learn --spam ${DPATH}/$x/$i/Maildir/.Spam/cur/*
rm -rf ${DPATH}/$x/$i/Maildir/.Spam/cur/*
/usr/bin/sa-learn --spam ${DPATH}/$x/$i/Maildir/.ham/new/* rm -rf
${DPATH}/$x/$i/Maildir/.ham/new/* /usr/bin/sa-learn --spam
${DPATH}/$x/$i/Maildir/.ham/cur/* rm -rf
${DPATH}/$x/$i/Maildir/.ham/cur/* /usr/bin/sa-learn --sync done done
DLIST=${DPATH}/domlist.txt
DLEARN=`cat ${DLIST}`
for x in ${DLEARN}; do
echo "Checking $x"
USERLIST=${DPATH}/$x/userlist.txt
SPAMUSER=`cat ${USERLIST}`
for i in ${SPAMUSER}; do
/usr/bin/sa-learn --spam ${DPATH}/$x/$i/Maildir/.Spam/new/*
rm -rf ${DPATH/$x}/$i/Maildir/.Spam/new/*
/usr/bin/sa-learn --spam ${DPATH}/$x/$i/Maildir/.Spam/cur/*
rm -rf ${DPATH}/$x/$i/Maildir/.Spam/cur/*
/usr/bin/sa-learn --spam ${DPATH}/$x/$i/Maildir/.ham/new/* rm -rf
${DPATH}/$x/$i/Maildir/.ham/new/* /usr/bin/sa-learn --spam
${DPATH}/$x/$i/Maildir/.ham/cur/* rm -rf
${DPATH}/$x/$i/Maildir/.ham/cur/* /usr/bin/sa-learn --sync done done
exit
0
