Domain, Host and Address Lists

Exim can use lists as options, lists can be made up of domains, hosts or addresses, when using a list as a option they are scanned from left-to-right, once a match occurs the scan stops. The colon is used as a list separator, to use a colon in the list you must double it (::). You can also supply your own separator if you have too many colons and it all get a bit confusing.

Basic List local_interfaces = : ::1        # use a colon as a separator

local_interfaces = <+ + :1      # use a plus as a separator

List Basics

Sometimes you may want to exclude values within a list, this is achieved by using the exclamation mark (!)

Exclude example

domains = ! :

domains = !*

Note: lists have a : * added to them, so if no match is fond the result is a "YES"

You can also specify a file to use

using a file company_domains = /etc/company_domains

company_domains = lsearch;/etc/company_domains

Note: using lsearch will treat each line in the file as a literal string (not interpreted) and will not handle expressions, if you want to use regular expressions, asterisks(interpret the file) in the file then use the first option.

To increase performance via caching you can use named lists, however these lists cannot have any expansions or sublists thus the lists should not be able to change. You can have up to 16 named lists of each type (can be adjusted at compile time).

Named Lists

domainlist = local_domains = localhost : *

hostlist = relay_hosts = :

domains = +local_domains                 # using a list, you must the plus sign

Domain Lists

You can use domain lists for specifying sets of email domains that maybe local, or for relaying. To improve performance you should limit the number of entries in the list, also if using lookups this can have a perform impact but this may be the only option if you have many domains.

matching the local host name domainlist local_domains = @ :

Note: the @ matches the local host name as set in primary_hostname option
matching the local IP address domainlist local_domains = @[] :

Note: the @[] matches any local IP address interface address
Matching the ends of domain names domainlist local_domains = *
Matching by regular expression domainlist = local_domains = \N^mta\d{3}\.plc.examples$\N
Matching single-key/ partial lookups company_domains = dbm;/etc/companydomains.db

company_domains = partial2-dbm;/partial/domains
Matching query style lookups domainlist local_domains = mysql; select domain from localdomains where domain='$domain';

Host Lists

Host lists can control what hosts or IP address are allowed to do.

Match no remote hosts

hosts = :

Note: used when TCP/IP is not used as a connection

Match any host auth_advertise_hosts = *
Match a IP address hosts =
Matching local IP addresses hosts = @[]
Matching a masked IP adddress host_lokup =
Match by regular expression hosts = \N^[ab]\.c\.d$\N
Matching query style lookups host = mysql; select host from hosts where ip='$sender_host_address';

Address Lists

Address lists are used for senders and rcipients, you can deny or allow access to specific individuals.

Matching by regular expression deny
   senders = \N^(paul|paulv)$\N
Matching a list of local parts per domain deny
   senders = @@dbm;/etc/reject-by-domain

Note: the @@ means the address being checked is split into a local part and a domain
Matching by address lookup deny
   senders = cdb;/etc/blocked.senders