Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have exim set up to accept local address with a suffix of -. So if joe is a user then joe-anything is accepted.

However there are some of these subaddresses I want to reject (they have become too spam infested and nothing useful comes on them). Is there are way of doing this before it gets prorcessed by the local user router. Can I do something in an alias file?

I am runing on Ubuntu 10.04

share|improve this question
up vote 1 down vote accepted

Add another router before the localuser router that only exists to reject the lp/suffix combos you want rejected. Here's an example with the suffixes hard coded:

  driver = redirect
  local_parts = joe-badsuff1 : joe-badsuff2
  fail_verify = true
  data = :fail: invalid email <$local_part@$domain>

The other way to go would be to look it up from a file. Same basic concept, just with a file lookup:

  driver = redirect
  local_parts = /path/to/file
  fail_verify = true
  data = :fail: invalid email <$local_part@$domain>

The file pointed to by local_parts is just a list of local_parts to reject:

# etc...

I prefer using routers to do this instead of ACLs because it catches all the edge cases like messages submitted locally (and so which don't trip the rcpt acl), etc.

share|improve this answer

You can create an acl to reject these addresses. To the "begin acl" section, add something like this:

deny message = This address is locked.
  recipients = /a/file/containing/the/rejected/addresses

This will reject the message even if the recipients would otherwise to be accepted. The "recipients" part here is a simple list, you can use any kind of list instead of specifying a file (sql lookup, hardcoded list, whatever).

share|improve this answer

Just add an alias for them.

# alias   : :action:  Comment 
joe-spam  : :fail: Disabled due to spam volume.
share|improve this answer
this actually won't work if the router that's doing the lookup in the file is also using the suffix option (because the suffix will be stripped before the lookup - that's the point of the suffix option). – jj33 Jan 6 '11 at 20:32
@jj33 Agrred. In my configuration, the suffix processing is done after processing aliases. I also have domain specific aliases in another router. This creates an additional loop through the routers. – BillThor Jan 7 '11 at 16:36

I like to manage the rejected subaddresses along with the accepted addresses in the same alias file (I have one for each domain). I also want only one router for each domain.

If you have a router doing a lookup in an alias file, just lookup the $original_local_part first and then the $local_part, as $original_local_part holds the entire address with the suffix (aka subaddress):

  data = ${lookup {$local_part$local_part_suffix@$domain} nwildlsearch {/cfg/aliases} {$value}\
        {${lookup {$local_part@$domain}                   nwildlsearch {/cfg/aliases} {$value}}}}

Then in the alias file, just add a line for the sub-addresses you want to reject: :fail: no such user, too much spam

So if exim finds the subaddress ("") in the first search, it will handle it (fail it in my example), but if not then the first lookup will fail and cause the second to search for just the local part ("") and find and accept/redirect that. If there is no subaddress on the current address, it may just match in the first lookup.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.