Skip to content
Nigel Metheringham edited this page Nov 29, 2012 · 2 revisions

Q0202

Question

Can I specify a list of domains to explicitly reject?

Answer

Set up a named domain list containing the domains in the first section of the configuration, for example:

domainlist reject_domains = list:of:domains:to:reject

You can use this list in an ACL to reject any SMTP recipients in those domains. You can also give a customized error message, like this:

deny message = The domain $domain is no longer supported
     domains = +reject_domains

If you also want to reject these domains in messages that are submitted from the command line (not using SMTP), you need to set up a router to do it, like this:

reject_domains:
  driver = redirect
  domains = +reject_domains
  allow_fail
  data = :fail: The domain $domain is no longer supported

Clone this wiki locally