2

To catch mail send to any recipient I have added the following router directive in my exim4 configuration:

local_catchall:
 debug_print = "R: catchall for $local_part@$domain"
 driver = redirect
 domains = +local_domains
 allow_fail
 allow_defer
 data = johanna

How can I exclude some recipient addresses like it is possible with sender addresses per:

acl_check_data: 
 strong textdeny senders = /etc/deny_senders 
kiatra
  • 45

2 Answers2

2

Use the condition router option and a single-key query like

condition = ${lookup {$local_part@$domain} lsearch {/etc/deny_recips} {0} {1}}

You could use the acl_smtp_rcpt instead, but note that it's for SMTP input only, extend if necessary:

deny recipients = /etc/deny_recips
2

You can use this:

deny
  condition = ${lookup{$local_part}nwildlsearch{/path/to/black.list}{yes}{no}}                                                                          
  message = User is black listed. Go away. 

The advantage is that you can use regexp in the black.list file. The disadvantage is that you can user regexp in the black.list file. Therefore you need a lot of testing (via ecim -v -bt 1.2.3.4 …) to make sure your regexp is correct.

My file black.list looks like thus:

^Diana.*$
^Evelina.*$
^Julia.*$ 
^Katherin.*$
^Olga.*$
^Violette.*$
^fax$                                                                                                                                                   
^sales$

See this question if you are unfortunate enough to use Debian/Ubuntu…