On Tuesday 01 June 2004 22:05, Leon Stedman wrote:
On Sun, 30 May 2004, Graham Trott wrote:
I know bogofilter and spamassassin can be set up to take a stream from KMail and return it back again with suitable modifications to indicate spam or not. I'd like to do something similar but using different criteria based on a list of approved sender addresses.
-- GT
(snip)
If you wanted to use the same box for both good and suspect mail you could pipe all suspect mail through a script to mark mail and send it to "in-box"
or whatever, Procmail uses an action line: | mark >> in-box
where mark is a program on the Procmail path, (which you can set). As mark is taking input on standard in and printing on standard out, the program can be very simple:
#! /bin/bash sed -e -s/Subject:/"Subject: <--Spam-->"/
This will change the "Subject line" to include both the <--Spam--> marker and the original subject line. The script terminates on EOF, no test required.
I hope that this helps a little, and that you can adapt this to your own needs.
Leon Stedman.
Thanks for the above; however from my understanding of Procmail it works as an accessory to the MTA, whereas I want the work to be done on my client as it's easier to maintain a whitelist there. The problem I was having was to write a filter using bash. I got a passable whitelist filter working after discovering that 'read' returns non-zero when it reaches the end of input stream, but still had problems when using it as a KMail filter as only part of each message was returning to the mail client.
As is the way of the world, I eventually typed the right search string into Google and came up with a solution already done by someone else, that uses the KAddressBook and recent sent lists as a whitelist. This is even better (for me) since it's now easy to reject mail from anyone unknown. I still use bogofilter at the MTA to get rid of the bulk of the rubbish, then anything left over goes through this final step. The link is
http://msquadrat.de/archive/04/03/22/01
-- GT