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

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

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

 strong textdeny senders = /etc/deny_senders 

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
| improve this answer | |

You can use this:

  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 …) to make sure your regexp is correct.

My file black.list looks like thus:


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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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