The Exim FAQ Section 2

# The Exim FAQ

Contents Previous Next

## 2. ROUTING IN GENERAL

Q0201: How can I arrange that messages larger than some limit are handled by a special router?

A0201: You can use a `condition` option on the router line this:

       condition = ${if >{$message_size}{100K}{yes}{no}}

Q0202: Can I specify a list of domains to explicitly reject?

A0202: 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

Q0203: How can I arrange to do my own qualification of non-fully-qualified domains, and then pass them on to the next router?

A0203: If you have some list of domains that you want to qualify, you can do this using a redirect router. For example,

       qualify:
         driver = redirect
         domains = *.a.b
         data = ${quote:$local_part}@$domain.c.com

This adds `.c.com` to any domain that matches `*.a.b`. If you want to do this in conjunction with a dnslookup router, the `widen_domains` option of that router may be another way of achieving what you want.

Q0204: Every system has a `nobody` account under which httpd etc run. I would like to know how to restrict mail which comes from that account to users on that host only.

A0204: Set up a first router like this:

       fail_nobody:
          driver = redirect
          senders = nobody@your.domain
          domains = ! +local_domains
          allow_fail
          data = :fail: Nobody may not mail off-site

This assumes you have defined `+local_domains` as in the default configuration.

Q0205: How can I get Exim to deliver to me locally and everyone else at the same domain via SMTP to the MX record specified host?

A0205: Create an accept router to pick off the one address and pass it to an appropriate transport. Put this router before the one that does MX routing:

       me:
         driver = accept
         domains = dom.com
         local_parts = me
         transport = local_delivery

In the transport you will have to specify the `user` option. An alternative way of doing this is to add a condition to the router that does MX lookups to make it skip your address. Subsequent routers can then deliver your address locally. You'll need a condition like this:

       condition = \
         ${if and {{eq{$domain}{dom.com}}{eq{$local_part}{me}}}{no}{yes}}

Q0206: How can I get Exim to deliver certain domains to a different SMTP port on my local host?

A0206: You must set up a special smtp transport, where you can specify the `port` option, and then set up a router to route the domains to that transport. There are two possibilities for specifying the host:

(1) If you use a manualroute router, you can specify the local host in the router options. You must also set

       self = send

so that it does not object to sending to the local host.

(2) If you use a router that cannot specify hosts (for example, an accept router with appropriate conditions), you have to specify the host using the `hosts` option of the transport. In this case, you must also set `allow_localhost` on the transport.

Contents Previous Next