The never ending battle with Spam

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I'm getting about 1000 spams per month, and using Spamassassin to filter them 
into a folder in KMail called "Spam" (/home/charles/Mail/Spam/cur).

I've noticed that the more msgs I have in Spam, the longer it takes KMail to 
open.

FWIW, here is my solution:
This is a cron job that runs every night @ 0100:

#!/bin/bash

cd /home/charles/Mail/Spam/cur
if [ `ls | wc -l` -gt 199 ] ; then
	echo "Current number of msgs in Spam folder is" `ls | wc -l`
	echo
	echo "It's time to clean up your Spam folder!"
	echo
	echo "Learning from Spam..."
	sa-learn --spam --dir /home/charles/Mail/Spam/cur/*
	echo
	echo "Deleting all msgs in Spam folder..."
	rm /home/charles/Mail/Spam/cur/*
fi

Here is the output:

[root@moe cur]# /root/bin/sa_learn_spam.cron
Current number of msgs in Spam folder is 481

It's time to clean up your Spam folder!

Learning from Spam...
Learned from 480 message(s) (481 message(s) examined).

Deleting all msgs in Spam folder...
[root@moe cur]# ls -la
total 32
drwxrwxr-x  2 charles charles 28672 Apr 29 06:46 .
drwxrwxr-x  5 charles charles  4096 Apr 29 06:12 ..

This works nicely, and does not delete the . and .. files.
There's no output if the number of spams is less than 200.

I also run this cron job twice a month for "Ham":

#!/bin/bash

for i in inbox Kent Saved Stooges ; do

	echo "Learning from" $i
	sa-learn --ham --dir /home/charles/Mail/$i/cur/* 
	echo
done

Maybe this will help someone else.  :-)

Fedora Core 1.
[root@moe cur]# uname -a
Linux moe 2.4.22-1.2188.nptl #1 Wed Apr 21 20:36:05 EDT 2004 i686 i686 i386 
GNU/Linux
[root@moe cur]# rpm -qa spamassassin
spamassassin-2.63-0.2

- -- 
Charles Howse
Jackson, TN
Registered Linux user # 347576 (http://counter.li.org)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAkPGH/S+VsB9RMKgRAuUtAJ9OXFfBXReXqZ2K8P/l9hnKPj0ZcgCeK7Of
7XMB1am7GNhq9xlEdM3jTqg=
=Luef
-----END PGP SIGNATURE-----



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

  Powered by Linux