Dictionnary spam attacks - spamassassin & qmail - heavy server load -


I'm currently using a qmail/spamassin configuration on a linux debian server.

From time to time (twice a week); the load average gets very high (> 100) and the server stops responding.

Email is involved here : I've got few domains on my server that get spammed with dictionnary attacks and as you may know, qmail accepts every email by default even if the mail box doen't exist...

I should build some kind of a "before delivery mail validity check" like the ones described below to avoid qmailscanner & spamassassin to do scan time for nothing...


But this is for the near future, from now on I ve got to find a quick & dirty solution to simply avoid Spamassassin to scan non existant mail boxes.

The only solution I've found so far is to use the option "all_spam_to" in the
/etc/spamassassin/local.cf, like :

all_spam_to *@spammed_domain.tld

But it happens that Spamassassin is still making scan time here (why ?) :

Sat Apr  7 10:46:12 2007 [29263] info: spamd: clean message (-90.8/3.0) for non_existant_user@spammed_domain.tld:98 in 7.2 seconds, 21202 bytes.

What would be a QUICK&EASY solution to make qmailscanner/spamassassin not doing any scan on a full domain (But still doing scan on others selected domains) ?

For the information, my qmail system was build using the excellent Sylvestre Ledru documentation :


But as says the author in a reply for the same problem :

"Install the patch : http://www.interazioni.it/opensource/chkuser/ because each email is processed even if the user account doesn't exist (be carreful with this patch, I haven't really been able to install it with my documentation)."

(this answer was posted here : http://sylvestre.ledru.info/howto/howto_qmail_vpopmail_help.php, search for "Author : Jean (j.respen_at_wrackweb.net) poste le 25/07/2006 10:14")

... not very engaging...

Thanks for your help
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Well I'm not sure how you gonna write this into your system but here's a rough idea on how to go about it. Instead of allowing your qmail to accept all incoming mails into your domain, why don't you do a mailbox validation first, then activate spamassassin on this queue instead of a direct scan. I know you can do this but how is up to you. Hope this helps.
FFTAuthor Commented:

thanks for you answer shivan, it seems a bit vague to me...

What I could think of is : is there a way to tell spamassassin not to treat designated domains so there would be no process *at all* involved. The spamassassin installation is global so it treats every mails passing through qmail. Remember I do not have time yet to completely reconfigure the email services on this production server, i'm just searching a quick & simple way of limiting the load average due to spammed domains...  May be this is just impossible I do not know.... still waiting for help on this one... ;-)
I use dspam (http://dspam.nuclearelephant.com/) in conjunction with SpamAssassin as well
as rblsmtpd, which comes from DJB's ucspi package. The three in conjuction keep spam down
to an acceptable level (considering I have 3 or 4 email addresses that have been bouncing around
Usenet for 15+ years).

The relevant part of my .procmailrc:

| /usr/local/bin/spamc

| /usr/local/bin/dspam --user mark --deliver=innocent,spam --stdout

* ^X-Spam-Status: Yes


* ^X-DSPAM-Result: spam


That is, run Spamassassin, then run dspam's agent, and make sure
that dspam hasn't flagged anything in our SpamAssassin whitelist.

Works really well. The addtion of rblsmtpd cut remaining spam by about 50%.
You need to reduce the number of messages your server is having to process. You can start by implementing valiidrcptto. This will stop all messages directed to your server that does not have a valid "TO" email address. By default the server recieves the message, processes it for spam/viruses, then tried to deliver it. Validrcptto checks to see if the TO address is a valid email address, if it isn't, the message is discarded before the system would otherwise have to process it.

The second thing you could do is implement jgreylist. This is a process of giving soft errors to all mail servers. If a REAL mail server sends a message to you and gets a soft error from your mail server, it SHOULD send the message again after a period of time. Most spam server send a message once and if they get an error it doesn't try it again.

These two functions are all a part of the John Simpson patch. Excellent results for me.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FFTAuthor Commented:
I found and installed this solution two months ago :
It reduced drastically the server load (by 500%) and I have no more spam attacks now !
Since you pointed to the right solution, you get the points !
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Servers

From novice to tech pro — start learning today.