Spamassassin - the quick and dirty how-to?
I've had it! I've been spammed to the point that I don't even want to look at my mail. I want to set up spam assissin, or similar to kill all spam. I don't want to spend a lot of time on this. Is there a quick and dirty guide to getting it working? I have my own sendmail server as well as an account with my ISP, I pull my mail from the servers using fetchmail. My mail box type is what KMail calls "local" and it looks as though the queue is /var/mail/$USER. I usually read my mail with KMail. I don't know if spamassassin will execute independently of KMail, or as a script invoked by KMail. Yes, I will be looking at the docs, but if there is a simply three sentence howto that covers my situation, I'd love to see it. STH
* Steven T. Hatton
Yes, I will be looking at the docs, but if there is a simply three sentence howto that covers my situation, I'd love to see it.
On the mailserver: rpm -Uvh spamassassin.rpm rcspamd start In your .procmailrc: :0fw | /usr/bin/spamc :0: * ^X-Spam-Status: Yes $HOME/Mail/spammails Might be you want to adjust it, so you filter with KMail on that header instead, or put it somewhere else than $HOME/Mail/spammails, but you get the idea. -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J.
On Thursday 09 October 2003 11:00 am, Steven T. Hatton wrote:
I've had it! I've been spammed to the point that I don't even want to look at my mail. I want to set up spam assissin, or similar to kill all spam. I don't want to spend a lot of time on this. Is there a quick and dirty guide to getting it working? I have my own sendmail server as well as an account with my ISP, I pull my mail from the servers using fetchmail. My mail box type is what KMail calls "local" and it looks as though the queue is /var/mail/$USER.
I usually read my mail with KMail. I don't know if spamassassin will execute independently of KMail, or as a script invoked by KMail.
Yes, I will be looking at the docs, but if there is a simply three sentence howto that covers my situation, I'd love to see it.
STH
Someone else suggested called SA from procmailrc, and that is the best way. But if you're only doing POP from Kmail, then you can also call SA from Kmail. 1) Set up a filter that will always be hit. Something like looking for TO: in the headers. Use that filter to call SA. 2) Set up another filter to look for the SA flags, such as X-Spam-Status: Yes 3) Use that filter to move the email to a special folder (or to /dev/null) Careful using (3) for /dev/null. You can lose some good emails that way. Using fetchmail and procmail is best, but to set it up is not a '3 line' how-to deal. -- +----------------------------------------------------------------------------+ + Bruce S. Marshall bmarsh@bmarsh.com Bellaire, MI 10/09/03 11:16 + +----------------------------------------------------------------------------+ "Whom computers would destroy, they must first drive insane."
On Thursday 09 October 2003 11:19 am, Bruce Marshall wrote:
On Thursday 09 October 2003 11:00 am, Steven T. Hatton wrote:
Someone else suggested called SA from procmailrc, and that is the best way.
But if you're only doing POP from Kmail, then you can also call SA from Kmail.
1) Set up a filter that will always be hit. Something like looking for TO: in the headers. Use that filter to call SA.
2) Set up another filter to look for the SA flags, such as X-Spam-Status: Yes
3) Use that filter to move the email to a special folder (or to /dev/null)
Careful using (3) for /dev/null. You can lose some good emails that way.
Using fetchmail and procmail is best, but to set it up is not a '3 line' how-to deal.
OK. It's starting to look as though I have a smapc and spamd to deal with. For now, I just want to run a filter in KMail and have it check to see if the address (or other data) is black listed. It would be nice if SA would look at the contents of the Mail/spam directory to determine what should be in the black list. That way, if I drag a message into the spam directory, the data automatically becomes part of the blacklist filter. Am I on the right track? STH
On Thursday 09 October 2003 11:42 am, Steven T. Hatton wrote:
On Thursday 09 October 2003 11:19 am, Bruce Marshall wrote:
On Thursday 09 October 2003 11:00 am, Steven T. Hatton wrote:
Someone else suggested called SA from procmailrc, and that is the best way.
But if you're only doing POP from Kmail, then you can also call SA from Kmail.
1) Set up a filter that will always be hit. Something like looking for TO: in the headers. Use that filter to call SA.
2) Set up another filter to look for the SA flags, such as X-Spam-Status: Yes
3) Use that filter to move the email to a special folder (or to /dev/null)
Careful using (3) for /dev/null. You can lose some good emails that way.
Using fetchmail and procmail is best, but to set it up is not a '3 line' how-to deal.
OK. It's starting to look as though I have a smapc and spamd to deal with. For now, I just want to run a filter in KMail and have it check to see if the address (or other data) is black listed. It would be nice if SA would look at the contents of the Mail/spam directory to determine what should be in the black list. That way, if I drag a message into the spam directory, the data automatically becomes part of the blacklist filter. Am I on the right track?
STH
SA will learn on its own... as it processes incoming mail. You *CAN* point SA to your Mail/spam files and run sa-learn --spam <filename> -- +----------------------------------------------------------------------------+ + Bruce S. Marshall bmarsh@bmarsh.com Bellaire, MI 10/09/03 12:33 + +----------------------------------------------------------------------------+ First Law of Living: "As soon as you're doing what you wanted to be doing," "you want to be doing something else"
On Thursday 09 October 2003 12:34 pm, Bruce Marshall wrote:
On Thursday 09 October 2003 11:42 am, Steven T. Hatton wrote: [snip]
SA will learn on its own... as it processes incoming mail.
You *CAN* point SA to your Mail/spam files and run sa-learn --spam <filename>
-- +-------------------------------------------------------------------------- --+ + Bruce S. Marshall bmarsh@bmarsh.com Bellaire, MI 10/09/03
I figured out how to manually get it to read the Mail/spam directory and add the samples to the blacklist. That is done by: `sa-learn --spam --dir ~/ Mail/spam/cur' I've also determined that I can do things such as
test -n "$(spamc -r < ../Mail/spam/cur/1065713078.3551.VrDP\:2\,S)" && echo "positive"
Which echos "postitive" to console when the message is spam. I assume I can use the same concept in my KMail filters. But I have yet to figure out exactly what I need to do. Note that I am not using procmail, and I don't have time (nor desire) to switch. I'm also trying to get a client configured at this point, not a server. STH
On Thu, 9 Oct 2003 13:03:52 -0400
"Steven T. Hatton"
I figured out how to manually get it to read the Mail/spam directory and add the samples to the blacklist. That is done by: `sa-learn --spam --dir ~/ Mail/spam/cur'
I've also determined that I can do things such as
test -n "$(spamc -r < ../Mail/spam/cur/1065713078.3551.VrDP\:2\,S)" && echo "positive"
Which echos "postitive" to console when the message is spam. I assume I can use the same concept in my KMail filters. But I have yet to figure out exactly what I need to do.
Note that I am not using procmail, and I don't have time (nor desire) to switch. I'm also trying to get a client configured at this point, not a server.
Before you make a mess of Razor and Co. formail -s < mailbox | spamassassin -r I hope it is right but at least I think you got the idea.
On Thursday 09 October 2003 12:40 pm, Ivan Sergio Borgonovo wrote:
On Thu, 9 Oct 2003 13:03:52 -0400
"Steven T. Hatton"
wrote: [snip]
Before you make a mess of Razor and Co.
formail -s < mailbox | spamassassin -r
I hope it is right but at least I think you got the idea.
$ for f in /home/hattons/spamtest/Mail/trash/cur/*;\ do echo $f; formail -s < $f | spamc -r; done I ran this on a copy of my trash. (I had time to make a pot of coffee and start drinking my first cup while it ran.) If I understand, this was just to show me how to get the mailbox content into proper format for SA to digest? Perhaps I simply need to set up some scripts of my own to process my mail rather than mess too much with KMail's filters. Someone should write an SA plugin for KMail. For my purposes it makes far more sense to configure the client rather than the server to handel the spam filtering. STH
participants (4)
-
Bruce Marshall
-
Ivan Sergio Borgonovo
-
Mads Martin Joergensen
-
Steven T. Hatton