General Configuration

Layout...


The configuration file is made of seven sections.

  • 1: Main
  • 2: ACL
  • 3: Routers
  • 4: Transports
  • 5: Retry
  • 6: Rewrite
  • 7: Authentication

The Main section must be at the top or first in the configuration file. The remaining sections can be placed in any order. Each paramter will be in [name]=[value] pairs. The ACL, retry and rewrite sections have formats specific to each section.

CREATED 2016-11-19 20:06:34.0

00-26-C4

UPDATED 2016-11-19 20:06:48.0

Whitespace...


Leading and trailing whitespace in Exim configuration files is always ignored. So there are no excuses for sloppy code! Indent, make it readable and use comments!

CREATED 2016-11-27 16:29:36.0

00-26-D7

UPDATED 2016-11-27 16:29:45.0

Comments...


# This is a comment. CONFDIR = /etc/exim4 # The configuration file directory

Comment lines begin with a pound (#) sign.

but only in the first position. So this does not count:

CREATED 2016-11-27 16:29:55.0

00-26-D8

UPDATED 2016-11-27 16:30:01.0

Multi-line Configuration...


domainlist local_domains = loaclhost :
example.com :

Just as in linux, configuration can be continued on multiple lines by using a backslash at the end of all but the last line.

CREATED 2016-11-27 16:49:47.0

00-26-D9

UPDATED 2016-11-27 16:50:07.0

Boolean Options...


local_from_check = no
local_from_check = false

Most options are in the format [Name] = [Value]. However, boolean values can be true/false or yes/no. In addition an option can have the word no or not as a prefix.

Example:

CREATED 2016-11-19 20:22:31.0

00-26-C6

UPDATED 2016-11-27 20:29:08.0

Macros...


[MACRO_NAME] = [definition] LOCAL_DELIVERY=mail_spool MACRO = 123
MY_MACRO = 456

Exim macros can be as simplistic or as complex as one would like. In either case a macro is a string substitution mechanism. The basic sytax is fairly straight forward:

Example:

Macro names are generally either propercase or capitolized. When Exim sees the frist letter capitolized it assumes it is a macro.

As with most things... macros in exim come with a couple of catches.

  • First... all macros must be forward declared i.e. in the main configuration section... before the first begin... makes sense...
  • Second... when a macro is encountered in the configuration file, exim scans the entire file each time it sees a macro and performs the substitution. e.g. if there were 10 macros defined exim will scan the entire file 10 times making substitutions on each scan.
  • Last... A macro name can not be a substring of any other previously declared macro. This is because the substitution mecanism will replace part of the string as it encounters it. An example is needed here...

CREATED 2016-11-20 12:42:27.0

00-26-C7

UPDATED 2016-11-27 20:29:09.0

Names Lists


[list type] [listname] = [element1] : [element2] : [element3]... : [elementn] hostlist my_host_list = host1.example.com : host2.example.com : : hostn.example.com hostlist my_host_list =

String Lists, Domain Lists, Hosts Lists and Local Part Lists are known as Named Lists. A Named List is a string delimited (seperated by) colons. The colon is the default delimiter and can be changed. To create a named list, pass a colon (:) separated string to it.

An empty element can be passed to a Named List as long as it is not the last item. When Exim encounters a colon at the end of the list, it is discarded. However, if a double colon appears in the center of the list, an empty element is added.

The third element in this list will be an empty element. Colons should be surrounded by whitespace. This is nessacary because if a colon is needed in an element, like an ipv6 address a double colon is required e.g. ::::1 will resolve to ::1.

To change the delimeter use an angle bracket (<) followed by the new character to use.

< /code="" ;="" host1.example.com="" host2.example.com="" host3.example.com="" >

CREATED 2016-11-20 18:07:18.0

00-26-C8

UPDATED 2016-11-27 20:29:10.0

Including Files...


.include /path/to/file
.include_if_exists /path/to/file

The .include directive is a pretty cool thing. Use it to include another file. The file is inserted where the .include directive is. .include always comes after the Macro section.

CREATED 2016-11-27 16:57:33.0

00-26-DA

UPDATED 2016-11-27 20:29:01.0

String Expansion...


CREATED 2016-12-01 15:45:23.0

00-26-F0

UPDATED 2016-12-01 15:45:32.0

Dealing with High Load...


Exim delivers messages immediately when they are received. However, when the number of incoming connections reaches queue_only_load, immediate delivery is suspended and messages are placed on a queue for delivery by queue runner.

When the number of SMTP connections exceeds deliver_queue_load_max delivery by queue runner is then suspended leaving all messages on a queue until load decreases.

Parameter Value Description
queue_only_load int When this threshold is reached, exim stops attempting deliveries and puts incoming messages in a queue for queue runner to process.
deliver_queue_load_max int When this threshold is reached, queue runner is suppressed and messages wait on the queue until the load decreases.

The objective of these two variables is to reduce delivery tasks when Load is high. Thes only effect incomming SMTP connections from remote hosts. Local delivery proceeds as normal.

CREATED 2016-11-19 13:29:26.0

00-26-C0

UPDATED 2016-11-19 20:06:37.0

Incoming Connections...


There are four options to control the number of incoming connections from remote hosts. When remote host connections are being limited i.e. the server is under a significant load, additional connections are only allowed from those hosts identified in smtp_reserve_hosts. This value is a colon seperated list in cidr format e.g. 10.20.30.0/24.

Parameter Value Description
smtp_load_reserve int When exceeded only connections from smtp_reserve_hosts are allowed.
smtp_accept_max int Total number of incomming smtp connections to accept. Default is 20.
smtp_accept_reserve int The number of smtp connections to keep available for smtp_reserve_hosts.
smtp_reserve_hosts cidr A named list of hosts to accept incomming smtp connections during times of high load.

The number of connections identified by smtp_accept_reserve is a subset of the maximum number of connections identified by smtp_accept_max that are reserved for those addresses listed in smtp_reserve_hosts. These addresses can use more connections if needed, however this number of connections will always be reserved for those addresses.

Formula: Subtract smtp_accept_reserve from smtp_accept_max to get the maximum number of connection for forign hosts. smtp_accept_max = 300 smtp_accept_reserve = 60 smtp_reserve_hosts = 10.20.30.0/24

Example:




The above configuration indicates that out of a maximum of 300 possible connections a minimum of 60 will be reserved for mail coming from 10.20.30.* leaving a maximum of 240 available for other remote hosts.

In other words... If connections from other remote hosts i.e. those hosts NOT listed in smtp_reserve_hosts reached 240 total connections, any further connections will be denied. The remaining 60 connections identified by smtp_accept_reserve will only be accepted from ip addresses from 10.20.30.*.

CREATED 2016-11-19 13:45:52.0

00-26-C1

UPDATED 2016-11-19 16:04:05.0

Space and Size...


check_spool_space = 300m message_size_limit = 75m

To check available disk space before a message is written to a queue or spool use check_spool_space. This parameter takes an integer indicating the available space.

To check message size use message_size_limit.


The letters k and m can be used to indicate size.

CREATED 2016-11-19 17:03:36.0

00-26-C2

UPDATED 2016-11-19 17:10:16.0

Delivery...


remote_max_parallel = 12 queue_only
queue_run_max = 20

Deliveries can come in different forms... there are parallel deliveries for remote messages (outbound) and delivery processes for inbound traffic.

Parallel deliveries occur when a messages has a number of remote addresses to send to because Exim deliveres a message to multiple addresses at one time. remote_max_parallel can be used to control the number of processes attempting to deliver to addresses of one message.

Example:

Will allow Exim to start up to 12 deleivery processes simontaneously to deliver one message.

The queue_only option will force Exim to deliver mail by placing it on a queue and letting a queue runner process deliver it. In addition queue_run_max will limit the number of queue runner process that are run to deliver queued mail.

Example:

CREATED 2016-11-19 17:52:37.0

00-26-C3

UPDATED 2016-11-19 17:52:43.0

Large Number of Messages...


When a large number of messages is expected the spool directory can be split to avoid a performance hit. split_spool_directory will cause the spool directory to be split into 62 subdirectories based the sixth character of the message id.

This puts the burdon on the queue runner alleviating some of the stress of the delivery process.

CREATED 2016-11-19 20:10:26.0

00-26-C5

UPDATED 2016-11-19 20:10:36.0

Knowledge

L
I
N
K
S

DBID: db.wam

Page Server: Ruger

©2012 Leistware Data Systems

      Hello anonymous