This is an inherent problem with qmail. Qmail accepts anything for a domain that is in its rcthosts/virtualdomains file. Once qmail has determined that the mail message isn't for a valid user, it bounces the message and sends a non-delivery report (or bounce message). So for every one of these dictionary attacks, you are actually dealing with two messages (the original which bounces, and the subsequent non-delivery report). Since spammers never (or almost never use valid addresses... certainly nothing that would come to them) these messages either fill up the outbound queue or result in double bounces.
It is possible to mitigate some of this with proper adjustment of qmail settings (doublebounceto, and catchalls that go to /dev/null).
I have found that the best method is greylisting. Greylisting takes the sending IP address, the from address, and the to address and creates a unique identifier for that message/sender. The first time it sees a new identifier that it has not seen before, the server will bounce the message with a soft bounce (deferral notice 4xx smtp message) and start a timer (typically 5 mintues). Here is where the real action occurs. The SMTP specification says that a mail server should keep retrying to deliver a message to the server at set intervals. Legitmate mail sent through "proper" mail servers will keep retrying the message, and once the timer has expired for that message identifier it will allow the message through. The next time the IP/from/To combo is seen by the server the message will not be delayed, it will be delivered right away, and so long as at least one message from that IP/From/To combo is seen with in a defined interval of days (normally 45 days), the interval of days is reset back to the maximum and starts counting downward again.
How does this effect spammers? Well, most spamming software is all about number of messages delivered per minute/hour/day. As such most spamming software is optimized NOT to follow the SMTP specification, so the first attempt a spammer makes, will result in a bounce and the spammer software will make a note that the email address isn't valid, and move on to the next delivery. Because spammers like to prune their lists (makes them more valuable and faster) they will typically remove addresses that bounce. This will help lighten the amount of spam that you receive.
I currently offer this service to a couple of clients that were getting a vast amount of dictionary based spam (<anything>
[email protected]) to the tune of over 1 million messages daily. Since we have implemented greylisting, the volume has drop significantly.
How do you do it?
Setup a second server with just postfix on it (I personally like postfix over qmail... and I use to be a qmail diehard... take that for what it is worth). Setup the domains that it will be receiving mail for, and set those domains to forward to your mail servers IP (like smtproutes in qmail). Then set the MX record for the domains that are the problem, and point them to the postfix server.
Then flip the switch and stand back. It will take about 24 hours for the old MX records to expire and the new MX records to be picked up by the spammers.
This solution offers the best of both worlds, as one the bounce occurs VERY early in the SMTP process, so the load is very low as well as the bandwidth, as the SMTP conversation never gets to the DATA portion of the transfer so that should help out a lot. Also those customers on those domains will get their mail still. Plus... they will get less spam as well...
If you wanted to do it all on one server, you would need to setup postfix to run on port 25, and have qmail run on another port on localhost and have postfix hand off to the localhost and port you have qmail running on. It isn't that hard, just takes some doing to get everything setup properly. This of course would require a little more maintenance to ensure that all domains that are added in Plesk are also added to postfixs configuration to allow delivery.
If you really want to wow them, setup some really cool MRTG graphs.
http://www.spambuffer.com/mrtg/postfix.html
Hope that helps,
Tom
aka: stupidnic