View Full Version : SPAM email

05-15-2004, 05:00 PM

How do I prevent the email server from downloading emails that are taged as SPAM through spamassasin.


05-15-2004, 05:29 PM
If you check out Jalal's Westhost Tips and Tricks that should get your started.

If you have any questions after checking it out let us know. Also within this section there are tons of threads that expand on this.

Many more then that but those should help to clarify some things.

05-16-2004, 10:31 PM
wildjokerdesign thank for the reply.

However, none of the links addresses my specifically question.

I understand I have to edit a specific file but have no clue which file and what exactly I have to change or edit there.

I would appreciate a more specific answer as this would apply to many users.

05-17-2004, 01:29 AM

Your question needs to be little more specific before we can offer any help.

Your server does the tagging of email as spam, so therefore there is no possibility to not download tagged mail. But then, I don't really understand what you are asking.

05-17-2004, 11:32 AM

If what you mean is that you would like to not have to download e-mail marked as spam by SpamAssassin, then you should do a search for "Procmail" on this forum, and read up on the results: you will come across many posts that detail how to "move" spam out of your mail account, so that it does not show up in your e-mail program when you download mail from you POP3 account. Where you "move" that mail is up to you - you can delete it completely or you can move it to another, less-checked account, where you can give it a once over before emptying the mailbox.

05-18-2004, 03:13 PM
Hi FZ,

That exactly what I am looking for. I don't want to wait 15 minutes for my email when 99% of it is spam. I get over 500 spams each day. I don't want to move the Spam, I want to delete it and not to have to download it at all.

Again, any specific instructions or examples with Procmail would be greatly appreciated.

05-18-2004, 03:50 PM
Another suggestion:

Go to www.firetrust.com and get a copy of Mailwasher Pro. Mailwasher can (a) learn what is spam, and (b) allow you to preview headers and delete the mail from the server BEFORE you download it. Highly recommended; saves me hours.

Also, go to www.pmail.com and explore getting Pegasus. Pegasus also has the selective download feature, so you can only download what you want, and delete the rest from the server.

I have loads of spam levels, from spam assassin, additional filters in my .procmailrc, mailwasher, and pegasus.


05-25-2004, 01:57 PM

Please excuse the really late reply - I've been busy (lazy) lately...

Jalal has an excellent web site that explains how to configure Procmail (http://codeworks.gnomedia.com/westhost/email2.php) (which is what you would use to do "server side mail filtering") to delete e-mail with a certain SpamAssassin score. If you have not played around with Procmail before, I'd recommend you have a look at the other sections on Jalal's site before you do so. I'll see if I can find some of the other relevant Procmail topics that have been discussed on the forum, and post their links here for you.

05-25-2004, 02:15 PM

http://forums.westhost.com/phpBB2/viewtopic.php?p=538#538 (old, so some paths referred to have changed, but still a valid read)


05-25-2004, 02:50 PM
Those are very good suggestions and they work great and I recommend them.

There is another thing you can do that is more extreme.
If most of your spam comes to a certain user (bubba@yourdomain.com) and you dont need (or can abandon) that username, you can set up Sendmail to reject any mail for that user. The server will not have to process it because it will never receive it. You can also change your catch-all address from "domain@domain.com" to "whatever@domain.com" and use Sendmail to reject mail for "domain@domain.com" as well.

05-28-2004, 11:56 AM
Thanks Fayez for your respond.

The more I read about this issue the more I am confused. I donít understand why WestHost cannot add a simple Check Box in their Site Manager setup, ďDelete all tagged SPAMĒ (do not download)??? My COX cable provider does just that. I hope WetHost is reading this but I wonít hold my breath. Preferably it would be nice if they add also another Text Box and allow you to enter a SPAM score that this deletion will take effect.

I read your post, http://forums.westhost.com/phpBB2/viewtopic.php?t=1155 and Jimís http://forums.westhost.com/phpBB2/viewtopic.php?t=1204 which looks simpler and more specific.

Fayez I donít doubt that your script works, I just donít understand the differences. It sounds like you know what you are doing, if you could just explain the differences and the disadvantages of each solution.


05-28-2004, 12:22 PM

Those topics are in fact doing quite different things: mine is actually "bouncing" mail marked as spam (I don't actually recommend that, it's not worth the waste of resources), as opposed to Jim's which, as you said, is simpler and easier to understand (all his is doing is deleting mail marked as spam).

There are other very subtle differences: Jim's is site-wide; mine is specific to the domain@domain.com e-mail address. Apart from that, the two differ slightly in their method of choosing which mail to delete: I explain how to delete mail with a score higher than a certain value, while Jim's will simply delete any mail that is marked as spam (regardless of the score). I do not completely agree with that method of doing it: unless you have customised SpamAssassin's scoring, you are bound to lose legit mail that might have just made it over your spam threshold. The last difference I can spot by skimming through the two posts is that I explain how to "move" mail to a "mailbox file" (which resides on the server) which you can have a look at before you delete mail permanently (Jim's solution simply deletes spam permanently). Obviously, this point ties in with the previous point (spam with a score vs. "any-score-spam").

For your purpose, you should probably go with Jim's solution, but if there are any aspects of my "technique" (they're both very generic pieces of code, really) that you'd like to incorporate, you are free to do so (or ask for help if you need it).

05-28-2004, 02:38 PM
Hi again Fayez,

I modified the original procmailrc file according to Jimís post http://forums.westhost.com/phpBB2/viewtopic.php?t=1204 and it looks like it is doing exactly what I originally wanted to do, delete ALL spam above the spam score set in SpamAssassin.

Now my question, can I combine some of your ideas and Jimís. If I change Jimís original line ď* ^X-Spam-Flag: YESĒ with this line ď* ^X-Spam-Flag: \*\*\*\*\*\*\*\*\*\*Ē, will this delete ONLY spam with score higher than 10 and still download spam between my spam score set in SpamAssassin and spam less than 10 which will be safer.


05-28-2004, 03:00 PM
The answer to your question is yes, but, in the case of detecting the score, you have to use the X-Spam-Level header, NOT X-Spam-Flag like Jim uses.

05-28-2004, 03:05 PM
Oh and just to clarify, I think you are using the term "download" incorrectly: all mail will still be "downloaded" to your mail server/WestHost account (can't do anything about that, short of closing down e-mail accounts), but using this method of filtration, your mail program will only download mail that has not been deleted (i.e. mail which has a SpamAssassin score of less than 10) - Procmail is a program that will run on server side and process all incoming mail automatically.

05-28-2004, 03:17 PM
By "downloading" I meant downloading to my Email program. I understand that my WestHost account still will be receiving these spams. However, I will not have to wait 10 minutes for my Email software to receive and filter these spams.

Thanks again!

05-28-2004, 03:29 PM
No problem :)

05-29-2004, 07:49 PM
Thanks to all, mission accomplished. The solution was much simpler than some of the initial suggestions. Jim's post http://forums.westhost.com/phpBB2/viewtopic.php?t=1204 will permanently delete all tagged SPAM. To go one step beyond that, I changed his original line "* ^X-Spam-Flag: YES" with the following line "* ^X-Spam-Level: \*\*\*\*\*\*\*\*". In my case, I set my SpamAssassin score to 4.0 and the number of "\*" combination is the score that above that all SPAM will be deleted.

So, any email with score of less than 4 will be received normally. Email with scores between 4 and 8 will be tagged as SPAM but still will be delivered to you. Any Email with a score of 8 and more will be permanently deleted and not delivered to your email software.