There are only 5 transports that deliver messages

SMTP Transport

This is the only transport that delivers message to remote hosts, but you can configure multiple instances with different options.

You can specify the maximum number of RCPT commands in one message transfer.

max_rcpt example max_rcpt = 150

Note: the default is 100, when set to zero there is no limit

Large corporations may have many MX records, you can limit this using the option hosts_max_try, then this limit is exceeded then Exim looks for MX records with a different MX value, the default is 5. You can set a hard limit using hosts_max_try_hardlimit where if this limit is reached the message is bounced.

The data sent with a HELO or EHLO command defaults to the local host name, as set in the option primary_hostname. You can change this by setting the option helo_data in the transport, you can use the variable $hosts and $host_address. You can also force the transport to send a HELO by setting the option hosts_avoid_smtp and supplying a lists of domains, or IP addresses.

You can also specify a interface and port to send outgoing SMTP traffic.

Specific Interface/port interface =
port = 2525

Note: Exim also supports IPv6 addresses

There are a number of timeout options you can use with a transport:

connect_timeout this options specifies how long to wait for the systems connect() function to establish a connection to a remote host, default is 5 minutes)
command_timeout (5 minutes) This options specifies how long to wait for a response to an SMTP command and how long to wait for the initial SMTP response after the connections has been established.
data_timeout (5 minutes) This option specifies how long to allow for the transmission of one block of message data
final_timeout (10 minutes) specifies how long to wait for a response after the entire message has been sent

It is possible to setup the transport to act like a client that needs to be authenicated, again I point you to the documenation on Exim web site for this.

You can change the protocol used from SMTP to LMTP, by using the protocol option.

Protocol example protocol = lmtp

You can override the routers host list

Host override example dnslookup:
   driver = dnslookup
   transport = smarthost

   driver = smtp
   hosts =
   hosts_override                  ## override the routers hosts list

Address Batching

When a message has several recipients that require local delivery, the transport normally handle one address at a time, which is different to a smtp transport which handles multiple addresses. You can use the batch_max option specifing a value to override the default of one.

batch example batch_max = 100

Common Options

There are a number of common options to save repetition


message_prefix = "From ${if def:return_path{$return_path} {MAILER-DAEMON}} $tod_bsdinbox\n"

Note: append to the start of the message


message_suffix = "\n"

Note: append to the end of a message

Escaping lines

check_string = "From"
escape_string = ">From"

Note: replace any matching string (check_string) with the escape_string (replace "From" with ">From")

Appendfile Transport

The appendfile is the most complex of all the transports, consequently it has a large number of options. The transport can operate in two modes

When writting to a single file, the file is locked so that it cannot be tampered with while the delivery is taking place, this means only one message can be delivered at a time to a mailbox, with directory mode this is not the case can multiple messages with go to multiple new files.

The file option specifies the name of the file to which the message is to be appended.

file example file = /var/mail/$local_part

sometimes the file might b a symbolic link and by default Exim will not deliver a message if the file is a symbolic link. To override this use the allow_symlink option

symbolic override example local_delivery:
   driver = appendfile
   file = /var/mail/symbolic_link_file

There are anumber of options regarding files, permissions, creation, etc

I will leave you to look these up, but they are pretty self explaining.

Exim has its own quota system, you can have directory or file quota limits. You can also limit the number of files in the directory

quota example quota = 10M
quota_filecount = 150
quota_is_inclusive = false          ## this is a hard cutoff option
quota_warn_threshold = 75%          ## send a warning message
quota_warn_message = \
  To: $local_part@$domain\n\
  Subject: Your Mailbox is 75% Full\n\
  This message is automatically created by mail delivery\n\

Pipe Transport

The pipe transport delivers a message by creating a pipe to a new process that runs a given command.

Simple pipe example procmail:
   driver = accept
   transport = procmal_pipe

   driver = pipe
   command = /usr/bin/procmail -d $local_pipe
   group = mail

Exim normally uses the check_local_user to obtain the uid and gid, you can override these values by specifying the group or user options (see above).

One note to remember is that the command run is not run under a shell, this avoids the shell over head and stops characters getting misinterpreted by the shell.

The pipe transport can use a number of environment variables:

A default of one hour is imposed on the process that runs the command, if it fails in that time then the process is killed, you can of course override this by using the timeout option.

You can restrict pipe commands from forward files and filters, the allow_commands and restrict_to_path provide two ways of doing this

Restrict commands

allow_commands = /usr/bin/procmail
path = /usr/local/bin

Note: you can use /usr/bin/procmail and any command in /usr/local/bin

You can igonore the return status of the ran command using the option ignore_status.

LMTP Transport

If you have a very large installation it is sometimes better to use a independent message store which is a software product for managing mailboxes. LMTP is intended for communication between two processes running on the same host, its like a across between the pipe and smtp.

LMTP example local_lmtp:
   driver = lmtp
   command = /some/local/lmtp_delivery/program
   batch_max = 25
   user = lmtp

LMTP has four options: command, ignore_quota, timeout and socket.

Autoreply Transport

The autoreply transport is really a transport, it generates another new mail message and submits it for delivery, the new message is created with a References: header line that relates it to the original message and you can optionally include the original message.

autoreply example auto_message:
   driver = autoreply
   to = $sender_address
   subject =