The value "Yes" in X-Bogosity indicates spam. You can tell qmail-smtpd to reject such mails at SMTP just by doing
SMTP clients which tries to send a spam mail will get the following error at the end of the SMTP transaction
For turning on the BADIP functionality, you need to set the BADIPCHECK or the BADIP environment variable. i.e.
Clients whose IP match an entry in badip will be greeted as below
A large ISP can run the following command every day once in cron
If your badip files becomes very large, you can also take advantage of IndiMail's ability to use cdb (or you could use MySQL too)