Coaxing Exim to throw away mail for unknown users

We've known for a while that skyjammer receives a lot of crap mail for users that don't really exist. Long, long ago, some bogus email addresses got on a list and they've never quite gone away. Up until now (June 2004) this was a mostly-transparent problem. However, our ISP recently started disabling SMTP after we exceeded some number of messages sent in a given day (around 1000 or so, as far as we can tell). We don't send this many messages on our own, of course - but counting bounced messages that go through the ISP's SMTP server, we can easily hit 1000 in a day.

We needed a way to avoid bouncing these messages back through the SMTP server. There were a couple of choices, but given that there are only 5-10 email users on skyjammer, we decided to just dump anything invalid rather than sending back an error. Anyone who needs to get ahold of us already has our address, and we don't change configuration (available addresses) often enough that we're worried about breaking anything.

For Exim 3, the best choice seems to be a new director. Place this stanza at the bottom of the DIRECTORS section in /etc/exim/exim.conf:

   unknown:
     driver = smartuser
     new_address = junkmail

Be sure it's the very last director before the "end" line. This way, it will catch anything that falls through the other rules without being caught. The smartuser driver accepts any address and in this case passes the data off to the new_address.

In this case, I created a new user called junkmail to accept all of the bad messages. Eventually, I'll configure that user to just dump everything it receives to /dev/null.

EximUnknownUsers (last edited 2008-07-21 21:09:20 by KennethPronovici)