Solved

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

Posted on 2007-04-07
5
514 Views
Last Modified: 2013-12-02
Hello,

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

http://qmail.jms1.net/patches/validrcptto.cdb.shtml
http://http.netdevice.com:9080/qmail/rcptck/
http://www.interazioni.it/opensource/chkuser/support/mailing_lists.html#Support
http://www.mail-archive.com/vchkpw@inter7.com/msg22241.html
http://www.interazioni.it/opensource/chkuser/

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.

So THE QUESTION IS :
-------------------
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 :

http://sylvestre.ledru.info/howto/howto_qmail_vpopmail.php

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
0
Comment
Question by:FFT
5 Comments
 
LVL 5

Expert Comment

by:dr_shivan
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.
0
 

Author Comment

by:FFT
ID: 18880776
Hello,

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... ;-)
0
 
LVL 2

Expert Comment

by:markmcwiggins
ID: 19212688
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:


:0fw
| /usr/local/bin/spamc

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

:0:
* ^X-Spam-Status: Yes
$HOME/Spam/

:0:
* ^.*USER_IN_WHITELIST
$HOME/Maildir/

:0:
* ^X-DSPAM-Result: spam
$HOME/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%.
0
 
LVL 5

Accepted Solution

by:
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.
0
 

Author Closing Comment

by:FFT
ID: 31407187
I found and installed this solution two months ago :
http://qmail.jms1.net/patches/validrcptto.cdb.shtml
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 !
Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

837 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