QMail spam

we had an emergency situation and had to rebuild a qmail server last night.

Email now that is designated as spam gets stuck in a loop and we get a ndr.

I would like for email not destined for a valid account or classified as spam be deleted rather then forwarded on to our exchange server.

All users have a forward setup in /qmail/alias/.qmail-username

email for user@domain.com is setup as follows.

|forward "Local@exchange.domain.com"

This causes a loop because smap@exchange.domain.com does not exist.

The email eventually is returned to sender.

We would like for email classified as spam be deleted immediately rather than forwarded to the spam address.

I am unfamiliar with qmail so any help is appreciated.

Maybe something like list where in the last position a wildcard username is used? Like:

userone | forward ...
usertwo | forward ...
...
...
...

  • | forward spamcollector

spamcollector might be link to /dev/null