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

Posted on 2007-04-07
Last Modified: 2013-12-02

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/, 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 : 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 :, search for "Author : Jean ( poste le 25/07/2006 10:14")

... not very engaging...

Thanks for your help
Question by:FFT

Expert Comment

ID: 18873918
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.

Author Comment

ID: 18880776

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... ;-)

Expert Comment

ID: 19212688
I use dspam ( 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%.

Accepted Solution

sardiskan earned 500 total points
ID: 20422704
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.

Author Closing Comment

ID: 31407187
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 !

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question