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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

740 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