Re: [dspam-users] How do I clear the dspam database (using libhash_drv for storage)
Original-Nachricht > Datum: Tue, 11 Nov 2008 15:34:07 -0500 > Von: Chris Baldwin <[EMAIL PROTECTED]> > An: Steve <[EMAIL PROTECTED]> > CC: dspam-users@lists.nuclearelephant.com > Betreff: Re: [dspam-users] How do I clear the dspam database (using > libhash_drv for storage) > I was looking to basically remove everything, so we ended up finding the > .css file (in /usr/local/var/dspam) and just rm'ing the user directory. > > I definitely thought dspam_clean would do the job, guess I'll read up on > cssclean to see if I need it. I haven't gotten far enough to need to > purge old tokens, but I'll definitely keep a copy of the script around. > Thanks! > The full script: http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/mail-filter/dspam/files/dspam.cron-r3 My local version (some changes I have not submitted to Portage) nemesis ~ # diff -Naur dspam.cron-r3 /etc/cron.daily/dspam.cron --- dspam.cron-r3 2008-11-11 22:09:49.521426389 +0100 +++ /etc/cron.daily/dspam.cron 2008-11-08 17:08:11.211432000 +0100 @@ -306,7 +306,7 @@ DSPAM_HOMEDIR="/var/spool/dspam" fi fi - if [ ! -d "${DSPAM_HOMEDIR}" ] + if [ ! -d "${DSPAM_HOMEDIR}" ] then echo "Home directory not found! Please fix your dspam.conf." exit 2 @@ -315,7 +315,10 @@ # # System and user log purging # - dspam_logrotate -a ${LOGROTATE_AGE} -d "${DSPAM_HOMEDIR}" >/dev/null # 2>&1 + if [ -d "${DSPAM_CONFIGDIR}/data" ] + then + dspam_logrotate -a ${LOGROTATE_AGE} -d "${DSPAM_CONFIGDIR}/data" >/dev/null # 2>&1 + fi if [ ! -e "/usr/bin/dspam" ] then nemesis ~ # > -Chris > // Steve > Steve wrote: > >> As the title says, I'm looking to clear out all user data/tokens. > Mostly > >> it's because I want to retrain under 1 user (globaluser), and do it > >> correctly this time. I tried running "dspam_clean -s 0 username" under > >> the impression that the right thing to do, but there's no indication if > >> this worked or didn't work. Is that the correct way to do it? > >> > >> > > With libhash_drv driver you can not use the dspam_clean utility. You > need to use cssclean. Be aware that the cssclean utility has issues. > > > > > > > >> Also, will > >> this clear out dspam_stats automatically (since that's one way I've > been > >> keeping track of how much I've trained). > >> > >> > > As far as I remember the statistical data is not inside the css file so > you need to look into the DSPAM home directory and clean up the data there > manually. > > In the daily cron job for DSPAM I wrote for Gentoo, I used this here to > clean/purge old tokens in the CSS file and old signatures on the DSPAM home > directory: > > --- > > # > > # Function to clean DSPAM Hash data > > # > > clean_hash_drv() { > > # > > # Hash > > # > > if [ -d "${DSPAM_HOMEDIR}/data" ] > > then > > find ${DSPAM_HOMEDIR}/data/ -maxdepth 4 -mindepth 1 > -type f -name "*.css" | while read name > > do > > /usr/bin/cssclean "${name}" 1>/dev/null 2>&1 > > done > > find ${DSPAM_HOMEDIR}/data/ -maxdepth 4 -mindepth 1 > -type d -name "*.sig" | while read name > > do > > find "${name}" -maxdepth 1 -mindepth 1 -type f > -mtime +${SIGNATURE_AGE} -name "*.sig" -exec /bin/rm "{}" ";" > > done > > return 0 > > else > > return 1 > > fi > > } > > --- > > > > This is just a small part of the script. Let me know if you need/want > the full one (it is not specific to CSS cleaning. It does handle all the > other storage engines as well). > > > > > > > > > >> Thanks! > >> > >> -Chris > >> > >> > > // Steve > > > > > -- "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail !DSPAM:1011,4919f712150921878915361!
Re: [dspam-users] How do I clear the dspam database (using libhash_drv for storage)
I was looking to basically remove everything, so we ended up finding the .css file (in /usr/local/var/dspam) and just rm'ing the user directory. I definitely thought dspam_clean would do the job, guess I'll read up on cssclean to see if I need it. I haven't gotten far enough to need to purge old tokens, but I'll definitely keep a copy of the script around. Thanks! -Chris Steve wrote: As the title says, I'm looking to clear out all user data/tokens. Mostly it's because I want to retrain under 1 user (globaluser), and do it correctly this time. I tried running "dspam_clean -s 0 username" under the impression that the right thing to do, but there's no indication if this worked or didn't work. Is that the correct way to do it? With libhash_drv driver you can not use the dspam_clean utility. You need to use cssclean. Be aware that the cssclean utility has issues. Also, will this clear out dspam_stats automatically (since that's one way I've been keeping track of how much I've trained). As far as I remember the statistical data is not inside the css file so you need to look into the DSPAM home directory and clean up the data there manually. In the daily cron job for DSPAM I wrote for Gentoo, I used this here to clean/purge old tokens in the CSS file and old signatures on the DSPAM home directory: --- # # Function to clean DSPAM Hash data # clean_hash_drv() { # # Hash # if [ -d "${DSPAM_HOMEDIR}/data" ] then find ${DSPAM_HOMEDIR}/data/ -maxdepth 4 -mindepth 1 -type f -name "*.css" | while read name do /usr/bin/cssclean "${name}" 1>/dev/null 2>&1 done find ${DSPAM_HOMEDIR}/data/ -maxdepth 4 -mindepth 1 -type d -name "*.sig" | while read name do find "${name}" -maxdepth 1 -mindepth 1 -type f -mtime +${SIGNATURE_AGE} -name "*.sig" -exec /bin/rm "{}" ";" done return 0 else return 1 fi } --- This is just a small part of the script. Let me know if you need/want the full one (it is not specific to CSS cleaning. It does handle all the other storage engines as well). Thanks! -Chris // Steve !DSPAM:1011,4919ec40150927018547578!
Re: [dspam-users] How do I clear the dspam database (using libhash_drv for storage)
> As the title says, I'm looking to clear out all user data/tokens. Mostly > it's because I want to retrain under 1 user (globaluser), and do it > correctly this time. I tried running "dspam_clean -s 0 username" under > the impression that the right thing to do, but there's no indication if > this worked or didn't work. Is that the correct way to do it? > With libhash_drv driver you can not use the dspam_clean utility. You need to use cssclean. Be aware that the cssclean utility has issues. > Also, will > this clear out dspam_stats automatically (since that's one way I've been > keeping track of how much I've trained). > As far as I remember the statistical data is not inside the css file so you need to look into the DSPAM home directory and clean up the data there manually. In the daily cron job for DSPAM I wrote for Gentoo, I used this here to clean/purge old tokens in the CSS file and old signatures on the DSPAM home directory: --- # # Function to clean DSPAM Hash data # clean_hash_drv() { # # Hash # if [ -d "${DSPAM_HOMEDIR}/data" ] then find ${DSPAM_HOMEDIR}/data/ -maxdepth 4 -mindepth 1 -type f -name "*.css" | while read name do /usr/bin/cssclean "${name}" 1>/dev/null 2>&1 done find ${DSPAM_HOMEDIR}/data/ -maxdepth 4 -mindepth 1 -type d -name "*.sig" | while read name do find "${name}" -maxdepth 1 -mindepth 1 -type f -mtime +${SIGNATURE_AGE} -name "*.sig" -exec /bin/rm "{}" ";" done return 0 else return 1 fi } --- This is just a small part of the script. Let me know if you need/want the full one (it is not specific to CSS cleaning. It does handle all the other storage engines as well). > Thanks! > > -Chris > // Steve -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer !DSPAM:1011,4919e579150921658918308!