Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

3 Answers 3

up vote 0 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:

reject_suffixes:
  driver = redirect
  local_parts = joe-badsuff1 : joe-badsuff2
  allow_fail
  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:

reject_suffixes:
  driver = redirect
  local_parts = /path/to/file
  allow_fail
  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:

joe-badsuff1
jane-badsuff2
jack-badsuff1
# 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

Your Answer

 
discard

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.