2010-11-09 23:51

In a previous post, I explained how to setup a catchall with Exim. This to create multiple addresses all redirecting to the same destination:

catchall_pub:
  driver = redirect
  domains = ads.mydomain.com
  data = user@mydomain.com

Then, I wrote that on destination address we could setup a Sieve or Exim filter with a .forward file.

If you want to do that directly in Exim, to have all config in one place, or simply if your destination mail box doesn’t supports filters…

Just add a local_parts option:

catchall_pub:
  driver = redirect
  domains = ads.mydomain.com
  local_parts = !/etc/exim4/ads.mydomain.com.blacklist
  data = user@mydomain.com

In /etc/exim4/ads.mydomain.com.blacklist we put all rejected addresses, one per line:

foo1
bar2

This way foo1@ads.mydomain.com and bar2@ads.mydomain.com will be rejected.

Exim4 Doc:

2010-11-09 23:51 · Tags: , , ,

2 Comments

  1. This is almost what I want, except that this local_parts line doesn’t work for me. In particular, I look for a solution that filter both by blacklist and by anything that has a certain prefix (which works with local_part_prefix).

    I have:

    catchall_pub:
    driver = redirect
    domains = <mydomain>
    local_parts = ! <somefile> # This doesn’t work
    local_part_prefix = pass-
    data = <someaddress>
    retry_use_local_part

    Any ideas? I use Exim 4.71 on Ubuntu.

    The blacklist file is readable to anybody and I can’t see anything helpful in the logs.

    I’m close to thinking that writing a forwarder in Python would have been simpler…

    Reply

  2. Hello,

    I found this on the page :
    http://www.exim.org/exim-html-4.30/doc/html/spec_3.html#SECT3.11

    ” If the local_parts option is set, the local part of the address must be in the set of local parts that it defines. If local_part_prefix or local_part_suffix is in use, the prefix or suffix is removed from the local part before this check. If you want to do precondition tests on local parts that include affixes, you can do so by using a condition option (see below) that uses the variables $local_part, $local_part_prefix, and $local_part_suffix as necessary. “

    seem you should use local_parts without the prefix in your blacklist file.

    Did you tried ??

    Marc

    Reply

Leave a Reply to dooblem Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>