Im interested in this KAM.cf rules: http://www.pccc.com/downloads/SpamAssas ... rib/KAM.cf
However, the only method I have been offfered in updating it is for a unix box/bash shell script.
Anyone any ideas on how to implement a script or method to do a periodical check for updates of this file?
Script/method to download and update an external .CF file
- jimimaseye
- Moderator
- Posts: 8864
- Joined: 2011-09-08 17:48
Script/method to download and update an external .CF file
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Script/method to download and update an external .CF file
Can The Jam Variant have multiple .cf files?
If so just a script to periodically delete that file, download the new one, and restart SpamAssassin should work...I'd guess that even every few weeks would be OK
If so just a script to periodically delete that file, download the new one, and restart SpamAssassin should work...I'd guess that even every few weeks would be OK
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
Re: Script/method to download and update an external .CF file
I take that time frame back. He says he updates multiple times per day...
What are the details of the bash shell script? This may be able to be converted to a Windows shell script...
What are the details of the bash shell script? This may be able to be converted to a Windows shell script...
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
- jimimaseye
- Moderator
- Posts: 8864
- Joined: 2011-09-08 17:48
Re: Script/method to download and update an external .CF file
Code: Select all
#!/bin/sh
PATH=$PATH:/usr/local/bin
URL="http://www.peregrinehw.com/downloads/SpamAssassin/contrib/KAM.cf"
URL2="http://www.peregrinehw.com/downloads/SpamAssassin/contrib/nonKAMrules.cf"
PRODFILE="/usr/local/etc/mail/spamassassin/KAM.cf"
PRODFILE2="/usr/local/etc/mail/spamassassin/nonKAMrules.cf"
mkdir /tmp/KAM
cd /tmp/KAM
fetch -q ${URL}
RC=$?
if [ ${RC} -ne 0 ]; then
cd /
echo "NON-ZERO RC from fetch(1): " ${RC}
rm -rf /tmp/KAM
exit ${RC}
fi
fetch -q ${URL2}
RC=$?
if [ ${RC} -ne 0 ]; then
cd /
echo "NON-ZERO RC from fetch(1): " ${RC}
rm -rf /tmp/KAM
exit ${RC}
fi
diff -q ${PRODFILE} KAM.cf >/dev/null 2>&1
RC=$?
diff -q ${PRODFILE2} nonKAMrules.cf >/dev/null 2>&1
RC2=$?
case ${RC}${RC2} in
00) ;;
10 | 01 | 11 ) mv KAM.cf ${PRODFILE}
mv nonKAMrules.cf ${PRODFILE2}
/usr/local/bin/sa-compile
kill -1 `cat /var/run/spamd/spamd.pid`
cd `dirname ${PRODFILE}`
git commit -a -m "KAM update `date '+%Y-%m-%d %H:%M'`"
;;
20 | 02 | 22 ) echo "ISSUES WITH DIFF -- CHECK IT";;
esac
cd /
rm -rf /tmp/KAM
exit 0
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
- jimimaseye
- Moderator
- Posts: 8864
- Joined: 2011-09-08 17:48
Re: Script/method to download and update an external .CF file
I don't km know how to download and place the cf from the website link. I know it's doable in vbs but need guidance.
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Script/method to download and update an external .CF file
https://superuser.com/questions/25538/h ... et-or-curl
There is some powershell info there
Or a WGET for windows variant here >> http://gnuwin32.sourceforge.net/packages/wget.htm
Nice rules set - thanks for sharing
There is some powershell info there
Or a WGET for windows variant here >> http://gnuwin32.sourceforge.net/packages/wget.htm
Nice rules set - thanks for sharing
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
Re: Script/method to download and update an external .CF file
SørenR.
Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.
Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.
- jimimaseye
- Moderator
- Posts: 8864
- Joined: 2011-09-08 17:48
Re: Script/method to download and update an external .CF file

(Mind you, Ive decided just to take the MAILSPLOIT rule - Im ok with what I have from default rules. But will remember KAM.cf if it provides more use to me).
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829