My qmail server is being used to send spam


Valued Member
Here is my predicament with our little qmail with vpopmail backend server . . . it's nearly *too good.* Basically, what I mean is the relay is so fast that, some fool is trying to use it to spam via error messages (spoof addresses and, your spam gets delivered with the appropriate NDR). There really is no way of blocking this type of mail without spam blockers (such as SpamAssassin). What I would like to do is block all IPs within the APNIC range from even getting a HELO message:

APNIC allocates resources in the following ranges within the Asia Pacific region:


EQ Admin

EQ Forum Admin
Staff member

While approaching the problem with this solution may provide a temporary and partial fix to your problem, I would not consider it the best solution. Your mail server is vulnerable to backscattering. Please see my article on how to prevent backscatter for the best solution. For your server I recommend the chkuser patch mention in the solutions section of the article.

To answer your original question, yes, it is possible to deny incoming connections from specific networks. Update your cdb file with the networks you want to deny. The path to it is specified in your $qmail/supervise/qmail-smtpd/run file. Some example lines to deny the networks listed above are:

You should be able to use that example to generate the rest of the deny lines needed.