1

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

4 Answers 4

2

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.

0

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).

0

Just add an alias for them.

# alias   : :action:  Comment 
joe-spam  : :fail: Disabled due to spam volume.
2
  • 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, 2011 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, 2011 at 16:36
0

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:

[email protected]: :fail: no such user, too much spam
[email protected]: [email protected]

So if exim finds the subaddress ("[email protected]") 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 ("[email protected]") and find and accept/redirect that. If there is no subaddress on the current address, it may just match in the first lookup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .