-. $Cambridge: exim/doc/doc-docbook/spec.xfpt,v 1.1 2006/02/01 11:01:02 ph10 Exp $
+. $Cambridge: exim/doc/doc-docbook/spec.xfpt,v 1.12 2006/07/31 14:19:31 ph10 Exp $
.
. /////////////////////////////////////////////////////////////////////////////
. This is the primary source of the Exim Manual. It is an xfpt document that is
. /////////////////////////////////////////////////////////////////////////////
.set ACL "access control lists (ACLs)"
-.set previousversion "4.50"
-.set version "4.60"
+.set previousversion "4.62"
+.set version "4.63"
. /////////////////////////////////////////////////////////////////////////////
. --- is suitable for the many tables at the start of the main options chapter;
. --- the small number of other 2-column tables override it.
-.macro table2 190pt 300pt
+.macro table2 196pt 254pt
.itable none 0 0 2 $1 left $2 left
.endmacro
-. --- Macros for the concept and option index entries
+. --- Macros for the concept and option index entries. For a "range" style of
+. --- entry, use .scindex for the start and .ecindex for the end. The first
+. --- argument of .scindex and the only argument of .ecindex must be the ID
+. --- that ties them together.
.macro cindex
&<indexterm role="concept">&
&</indexterm>&
.endmacro
+.macro scindex
+&<indexterm role="concept" id="$1" class="startofrange">&
+&<primary>&$2&</primary>&
+.arg 3
+&<secondary>&$3&</secondary>&
+.endarg
+&</indexterm>&
+.endmacro
+
+.macro ecindex
+&<indexterm role="concept" startref="$1" class="endofrange"/>&
+.endmacro
+
.macro oindex
&<indexterm role="option">&
&<primary>&$1&</primary>&
<bookinfo>
<title>Specification of the Exim Mail Transfer Agent</title>
<titleabbrev>The Exim MTA</titleabbrev>
-<date>05 January 2006</date>
+<date>27 July 2006</date>
<author><firstname>Philip</firstname><surname>Hazel</surname></author>
<authorinitials>PH</authorinitials>
<affiliation><orgname>University of Cambridge Computing Service</orgname></affiliation>
<address>New Museums Site, Pembroke Street, Cambridge CB2 3QH, England</address>
<revhistory><revision>
- <revnumber>4.60-1</revnumber>
- <date>30 January 2006</date>
+ <revnumber>4.63</revnumber>
+ <date>27 July 2006</date>
<authorinitials>PH</authorinitials>
</revision></revhistory>
<copyright><year>2006</year><holder>University of Cambridge</holder></copyright>
with the latest release of Exim. (Note that the earlier book about Exim,
published by O'Reilly, covers Exim 3, and many things have changed in Exim 4.)
-.new
.cindex "Debian" "information sources"
If you are using a Debian distribution of Exim, you will find information about
Debian-specific features in the file
.endd
The command &(man update-exim.conf)& is another source of Debian-specific
information.
-.wen
.cindex "&_doc/NewStuff_&"
.cindex "&_doc/ChangeLog_&"
.row &'exim-announce@exim.org'& "moderated, low volume announcements list"
.endtable
+.new
You can subscribe to these lists, change your existing subscriptions, and view
or search the archives via the mailing lists link on the Exim home page.
.cindex "Debian" "mailing list for"
-&new("If you are using a Debian distribution of Exim, you may wish to subscribe
-to the Debian-specific mailing list
-&'pkg-exim4-users@lists.alioth.debian.org'&.")
+If you are using a Debian distribution of Exim, you may wish to subscribe to
+the Debian-specific mailing list &'pkg-exim4-users@lists.alioth.debian.org'&
+via this web page:
+.display
+&url(http://lists.alioth.debian.org/mailman/listinfo/pkg-exim4-users)
+.endd
+Please ask Debian-specific questions on this list and not on the general Exim
+lists.
.wen
.section "Exim training"
.section "Wish list"
.cindex "wish list"
+.new
A wish list is maintained, containing ideas for new features that have been
-submitted. From time to time the file is exported to the ftp site into the file
-&_exim4/WishList_&. Items are removed from the list if they get implemented.
-
+submitted. This used to be a single file that from time to time was exported to
+the ftp site into the file &_exim4/WishList_&. However, it has now been
+imported into Exim's Bugzilla data.
+.wen
.section "Contributed material"
University of Cambridge. The source is distributed in the directory
&_src/pcre_&. However, this is a cut-down version of PCRE. If you want to use
the PCRE library in other programs, you should obtain and install the full
-version from &*ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre*&.
+version from &url(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre).
.next
.cindex "cdb" "acknowledgement"
Support for the cdb (Constant DataBase) lookup method is provided by code
.cindex "spool directory" "&_input_& sub-directory"
By default all these message files are held in a single directory called
&_input_& inside the general Exim spool directory. Some operating systems do
-not perform very well if the number of files in a directory gets very large; to
+not perform very well if the number of files in a directory gets large; to
improve performance in such cases, the &%split_spool_directory%& option can be
used. This causes Exim to split up the input files into 62 sub-directories
-whose names are single letters or digits.
+whose names are single letters or digits. When this is done, the queue is
+processed one sub-directory at a time instead of all at once, which can improve
+overall performance even when there are not enough files in each directory to
+affect file system performance.
The envelope information consists of the address of the message's sender and
the addresses of the recipients. This information is entirely separate from
addition, an administrator can force a delivery error, causing a bounce message
to be sent.
-.new
.cindex "&%timeout_frozen_after%&"
.cindex "&%ignore_bounce_errors_after%&"
There are options called &%ignore_bounce_errors_after%& and
&%timeout_frozen_after%&, which discard frozen messages after a certain time.
The first applies only to frozen bounces, the second to any frozen messages.
-.wen
.cindex "message" "log file for"
.cindex "log" "file for each message"
.section "Duplicate addresses"
-.new
.cindex "case of local parts"
.cindex "address duplicate" "discarding"
+.cindex "duplicate addresses"
Once routing is complete, Exim scans the addresses that are assigned to local
and remote transports, and discards any duplicates that it finds. During this
-check, local parts are treated as case-sensitive.
-.wen
+check, local parts are treated as case-sensitive. &new("This happens only when
+actually delivering a message; when testing routers with &%-bt%&, all the
+routed addresses are shown.")
+
.section "Router preconditions" "SECTrouprecon"
. ////////////////////////////////////////////////////////////////////////////
.chapter "Building and installing Exim"
-.cindex "building Exim"
+.scindex IIDbuex "building Exim"
.section "Unpacking"
Exim is distributed as a gzipped or bzipped tar file which, when upacked,
.section 'Output from &"make"&'
-.new
The output produced by the &'make'& process for compile lines is often very
unreadable, because these lines can be very long. For this reason, the normal
output is suppressed by default, and instead output similar to that which
The value of FULLECHO defaults to &"@"&, the flag character that suppresses
command reflection in &'make'&. When you ask for the full output, it is
given in addition to the the short output.
-.wen
variables of the same name, preceded by EXIMON_. For example, setting
EXIMON_LOG_DEPTH in the environment overrides the value of
LOG_DEPTH at run time.
-
-
+.ecindex IIDbuex
.section "Installing Exim binaries and scripts"
. ////////////////////////////////////////////////////////////////////////////
.chapter "The Exim command line" "CHAPcommandline"
-.cindex "command line" "options"
-.cindex "options" "command line"
+.scindex IIDclo1 "command line" "options"
+.scindex IIDclo2 "options" "command line"
Exim's command line takes the standard Unix form of a sequence of options,
each starting with a hyphen character, followed by a number of arguments. The
options are compatible with the main options of Sendmail, and there are also
.section "Command line options"
-The command options are described in alphabetical order below.
+.new
+Exim's command line options are described in alphabetical order below. If none
+of the options that specifies a specific action (such as starting the daemon or
+a queue runner, or testing an address, or receiving a message in a specific
+format, or listing the queue) are present, and there is at least one argument
+on the command line, &%-bm%& (accept a local message on the standard input,
+with the arguments specifying the recipients) is assumed. Otherwise, Exim
+outputs a brief message about itself and exits.
+.wen
. ////////////////////////////////////////////////////////////////////////////
. Insert a stylized XML comment here, to identify the start of the command line
Run Exim in expansion testing mode. Exim discards its root privilege, to
prevent ordinary users from using this mode to read otherwise inaccessible
files. If no arguments are given, Exim runs interactively, prompting for lines
-of data. &new("Otherwise, it processes each argument in turn.")
+of data. Otherwise, it processes each argument in turn.
If Exim was built with USE_READLINE=yes in &_Local/Makefile_&, it tries
to load the &%libreadline%& library dynamically whenever the &%-be%& option is
message-specific values (such as &$domain$&) are set, because no message is
being processed.
-.new
&*Note*&: If you use this mechanism to test lookups, and you change the data
files or databases you are using, you must exit and restart Exim before trying
the same lookup again. Otherwise, because each Exim process caches the results
of lookups, you will just get the same result as before.
-.wen
.vitem &%-bF%&&~<&'filename'&>
.oindex "&%-bF%&"
&*Warning 1*&:
.cindex "RFC 1413"
-You cannot test features of the configuration that rely on
-ident (RFC 1413) callouts. These cannot be done when testing using
-&%-bh%& because there is no incoming SMTP connection.
+.new
+You can test features of the configuration that rely on ident (RFC 1413)
+information by using the &%-oMt%& option. However, Exim cannot actually perform
+an ident callout when testing using &%-bh%& because there is no incoming SMTP
+connection.
+.wen
&*Warning 2*&: Address verification callouts (see section &<<SECTcallver>>&)
are also skipped when testing using &%-bh%&. If you want these callouts to
occur, use &%-bhc%& instead.
+.new
Messages supplied during the testing session are discarded, and nothing is
written to any of the real log files. There may be pauses when DNS (and other)
lookups are taking place, and of course these may time out. The &%-oMi%& option
-can be used to specify a specific IP interface and port if this is important.
+can be used to specify a specific IP interface and port if this is important,
+and &%-oMaa%& and &%-oMai%& can be used to set parameters as if the SMTP
+session were authenticated.
+.wen
The &'exim_checkaccess'& utility is a &"packaged"& version of &%-bh%& whose
output just states whether a given recipient address from a given host is
.endd
See chapter &<<CHAPretry>>& for a description of Exim's retry rules. The first
argument, which is required, can be a complete address in the form
-&'local_part@domain'&, or it can be just a domain name. The second argument is
-an optional second domain name; if no retry rule is found for the first
-argument, the second is tried. This ties in with Exim's behaviour when looking
-for retry rules for remote hosts &-- if no rule is found that matches the host,
-one that matches the mail domain is sought. The final argument is the name of a
-specific delivery error, as used in setting up retry rules, for example
-&"quota_3d"&.
+&'local_part@domain'&, or it can be just a domain name. If the second argument
+contains a dot, it is interpreted as an optional second domain name; if no
+retry rule is found for the first argument, the second is tried. This ties in
+with Exim's behaviour when looking for retry rules for remote hosts &-- if no
+rule is found that matches the host, one that matches the mail domain is
+sought. Finally, an argument that is the name of a specific delivery error, as
+used in setting up retry rules, can be given. For example:
+.code
+exim -brt haydn.comp.mus.example quota_3d
+Retry rule: *@haydn.comp.mus.example quota_3d F,1h,15m
+.endd
.vitem &%-brw%&
.oindex "&%-brw%&"
failed outright but at least one could not be resolved for some reason. Return
code 0 is given only when all addresses succeed.
+.new
+.cindex "duplicate addresses"
+&*Note*&: When actually delivering a message, Exim removes duplicate recipient
+addresses after routing is complete, so that only one delivery takes place.
+This does not happen when testing with &%-bt%&; the full results of routing are
+always shown.
+.wen
+
&*Warning*&: &%-bt%& can only do relatively simple testing. If any of the
routers in the configuration makes any tests on the sender address of a
message,
.oindex "&%-bv%&"
.cindex "verifying address" "using &%-bv%&"
.cindex "address" "verification"
+.new
This option runs Exim in address verification mode, in which each argument is
-taken as an address to be verified. During normal operation, verification
-happens mostly as a consequence processing a &%verify%& condition in an ACL
-(see chapter &<<CHAPACL>>&). If you want to test an entire ACL, see the &%-bh%&
-option.
+taken as an address to be verified by the routers. (This does not involve any
+verification callouts). During normal operation, verification happens mostly as
+a consequence processing a &%verify%& condition in an ACL (see chapter
+&<<CHAPACL>>&). If you want to test an entire ACL, possibly including callouts,
+see the &%-bh%& and &%-bhc%& options.
+.wen
If verification fails, and the caller is not an admin user, no details of the
failure are output, because these might contain sensitive information such as
&`verify `& address verification logic
&`all `& almost all of the above (see below), and also &%-v%&
.endd
-.new
The &`all`& option excludes &`memory`& when used as &`+all`&, but includes it
for &`-all`&. The reason for this is that &`+all`& is something that people
tend to use when generating debug output for Exim maintainers. If &`+memory`&
is included, an awful lot of output that is very rarely of interest is
generated, so it now has to be explicitly requested. However, &`-all`& does
turn everything off.
-.wen
.cindex "resolver" "debugging output"
.cindex "DNS resolver" "debugging output"
which can be set false to relax this restriction (and also the same requirement
for the &%-q%&, &%-R%&, and &%-S%& options).
-.new
The deliveries happen synchronously, that is, the original Exim process does
not terminate until all the delivery attempts have finished. No output is
produced unless there is a serious error. If you want to see what is happening,
use the &%-v%& option as well, or inspect Exim's main log.
-.wen
.vitem &%-Mar%&&~<&'message&~id'&>&~<&'address'&>&~<&'address'&>&~...
.oindex "&%-Mar%&"
active (in the middle of a delivery attempt), it is not altered. This option
can be used only by an admin user.
-.vitem "&*-MC*&&~<&'transport'&>&~<&'hostname'&>&~<&'sequence&~number'&>&&&
+.vitem "&%-MC%&&~<&'transport'&>&~<&'hostname'&>&~<&'sequence&~number'&>&&&
&~<&'message&~id'&>"
.oindex "&%-MC%&"
.cindex "SMTP" "passed connection"
exim -bs -oMa [10.9.8.7]:1234
.endd
The IP address is placed in the &$sender_host_address$& variable, and the
-port, if present, in &$sender_host_port$&.
+port, if present, in &$sender_host_port$&. &new("If both &%-oMa%& and &%-bh%&
+are present on the command line, the sender host IP address is taken from
+whichever one is last.")
.vitem &%-oMaa%&&~<&'name'&>
.oindex "&%-oMaa%&"
See &%-oMa%& above for general remarks about the &%-oM%& options. The &%-oMaa%&
option sets the value of &$sender_host_authenticated$& (the authenticator
name). See chapter &<<CHAPSMTPAUTH>>& for a discussion of SMTP authentication.
+&new("This option can be used with &%-bh%& and &%-bs%& to set up an
+authenticated SMTP session without actually using the SMTP AUTH command.")
.vitem &%-oMai%&&~<&'string'&>
.oindex "&%-oMai%&"
.cindex "authentication id" "specifying for local message"
+.new
See &%-oMa%& above for general remarks about the &%-oM%& options. The &%-oMai%&
option sets the value of &$authenticated_id$& (the id that was authenticated).
-This overrides the default value (the caller's login id) for messages from
-local sources. See chapter &<<CHAPSMTPAUTH>>& for a discussion of authenticated
-ids.
+This overrides the default value (the caller's login id, except with &%-bh%&,
+where there is no default) for messages from local sources. See chapter
+&<<CHAPSMTPAUTH>>& for a discussion of authenticated ids.
+.wen
.vitem &%-oMas%&&~<&'address'&>
.oindex "&%-oMas%&"
.cindex "authentication sender" "specifying for local message"
+.new
See &%-oMa%& above for general remarks about the &%-oM%& options. The &%-oMas%&
option sets the authenticated sender value in &$authenticated_sender$&. It
overrides the sender address that is created from the caller's login id for
-messages from local sources. See chapter &<<CHAPSMTPAUTH>>& for a discussion of
-authenticated senders.
+messages from local sources, except when &%-bh%& is used, when there is no
+default. For both &%-bh%& and &%-bs%&, an authenticated sender that is
+specified on a MAIL command overrides this value. See chapter
+&<<CHAPSMTPAUTH>>& for a discussion of authenticated senders.
+.wen
.vitem &%-oMi%&&~<&'interface&~address'&>
.oindex "&%-oMi%&"
.oindex "&%-oMr%&"
.cindex "protocol" "incoming &-- specifying for local message"
.cindex "&$received_protocol$&"
+.new
See &%-oMa%& above for general remarks about the &%-oM%& options. The &%-oMr%&
option sets the received protocol value that is stored in
-&$received_protocol$&. However, this applies only when &%-bs%& is not used. For
-interactive SMTP input (&%-bs%&), the protocol is always &"local-"& followed by
-one of the standard SMTP protocol names (see the description of
-&$received_protocol$& in section &<<SECTexpvar>>&). For &%-bS%& (batch SMTP)
-however, the protocol can be set by &%-oMr%&.
+&$received_protocol$&. However, it does not apply (and is ignored) when &%-bh%&
+or &%-bs%& is used. For &%-bh%&, the protocol is forced to one of the standard
+SMTP protocol names (see the description of &$received_protocol$& in section
+&<<SECTexpvar>>&). For &%-bs%&, the protocol is always &"local-"& followed by
+one of those same names. For &%-bS%& (batched SMTP) however, the protocol can
+be set by &%-oMr%&.
+.wen
.vitem &%-oMs%&&~<&'host&~name'&>
.oindex "&%-oMs%&"
.vitem &%-oMt%&&~<&'ident&~string'&>
.oindex "&%-oMt%&"
.cindex "sender ident string" "specifying for local message"
+.new
See &%-oMa%& above for general remarks about the &%-oM%& options. The &%-oMt%&
option sets the sender ident value in &$sender_ident$&. The default setting for
-local callers is the login id of the calling process.
+local callers is the login id of the calling process, except when &%-bh%& is
+used, when there is no default.
+.wen
.vitem &%-om%&
.oindex "&%-om%&"
&"queue times"& so that various warning/retry features can be tested.
.vitem &%-t%&
-.new
.oindex "&%-t%&"
.cindex "recipient" "extracting from header lines"
.cindex "&'Bcc:'& header line"
from the &'To:'&, &'Cc:'&, and &'Bcc:'& header lines in the message instead of
from the command arguments. The addresses are extracted before any rewriting
takes place and the &'Bcc:'& header line, if present, is then removed.
-.wen
.cindex "Sendmail compatibility" "&%-t%& option"
If the command has any arguments, they specify addresses to which the message
once, it is common for the original set of &%Resent-%& headers to be renamed as
&%X-Resent-%& when a new set is added. This removes any possible ambiguity.
-.vitem &*-ti*&
+.vitem &%-ti%&
.oindex "&%-ti%&"
This option is exactly equivalent to &%-t%& &%-i%&. It is provided for
compatibility with Sendmail.
-.vitem &*-tls-on-connect*&
+.vitem &%-tls-on-connect%&
.oindex "&%-tls-on-connect%&"
.cindex "TLS" "use without STARTTLS"
.cindex "TLS" "automatic start"
&<<CHAPTLS>>& for further details.
-.vitem &*-U*&
+.vitem &%-U%&
.oindex "&%-U%&"
.cindex "Sendmail compatibility" "&%-U%& option ignored"
Sendmail uses this option for &"initial message submission"&, and its
syntactically invalid messages rather than fixing them when this flag is not
set. Exim ignores this option.
-.vitem &*-v*&
+.vitem &%-v%&
.oindex "&%-v%&"
This option causes Exim to write information to the standard error stream,
describing what it is doing. In particular, it shows the log lines for
selectors are shown with each log line. If none are shown, the logging is
unconditional.
-.vitem &*-x*&
+.vitem &%-x%&
.oindex "&%-x%&"
AIX uses &%-x%& for a private purpose (&"mail from a local mail program has
National Language Support extended characters in the body of the mail item"&).
this option.
.endlist
+.ecindex IIDclo1
+.ecindex IIDclo2
+
+
. ////////////////////////////////////////////////////////////////////////////
. Insert a stylized DocBook comment here, to identify the end of the command
. line options. This is for the benefit of the Perl script that automatically
.endd
on a line by itself. Double quotes round the file name are optional. If you use
the first form, a configuration error occurs if the file does not exist; the
-second form does nothing for non-existent files.
+second form does nothing for non-existent files. In all cases, an absolute file
+name is required.
Includes may be nested to any depth, but remember that Exim reads its
configuration file often, so it is a good idea to keep them to a minimum.
.include /some/file
.endd
Include processing happens after macro processing (see below). Its effect is to
-process the lines of the file as if they occurred inline where the inclusion
-appears.
+process the lines of the included file as if they occurred inline where the
+inclusion appears.
space removed. Quotes are not removed. The replacement text can never end with
a backslash character, but this doesn't seem to be a serious limitation.
-.new
Macros may also be defined between router, transport, authenticator, or ACL
definitions. They may not, however, be defined within an individual driver or
ACL, or in the &%local_scan%&, retry, or rewrite sections of the configuration.
-.wen
.section "Macro substitution"
Once a macro is defined, all subsequent lines in the file (and any included
comment line or a &`.include`& line.
-.new
.section "Redefining macros"
Once defined, the value of a macro can be redefined later in the configuration
(or in an included file). Redefinition is specified by using &'=='& instead of
.endd
This can be helpful in situations where the configuration file is built
from a number of other files.
-.wen
.section "Overriding macro values"
The values set for macros in the configuration file can be overridden by the
.endd
contains two IP addresses, the IPv4 address 127.0.0.1 and the IPv6 address ::1.
-.new
&*Note*&: Although leading and trailing white space is ignored in individual
list items, it is not ignored when parsing the list. The space after the first
colon in the example above is necessary. If it were not there, the list would
be interpreted as the two items 127.0.0.1:: and 1.
-.wen
.cindex "list separator" "changing"
.cindex "IPv6" "addresses in lists"
. ////////////////////////////////////////////////////////////////////////////
.chapter "The default configuration file" "CHAPdefconfil"
-.cindex "configuration file" "default &""walk through""&"
+.scindex IIDconfiwal "configuration file" "default &""walk through""&"
.cindex "default" "configuration file &""walk through""&"
The default configuration file supplied with Exim as &_src/configure.default_&
is sufficient for a host with simple mail requirements. As an introduction to
-.section "Main configuration settings"
+.section "Main configuration settings" "SECTdefconfmain"
The main (global) configuration option settings must always come first in the
file. The first thing you'll see in the file, after some initial comments, is
the line
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
.endd
-.new
These options specify &'Access Control Lists'& (ACLs) that are to be used
during an incoming SMTP session for every recipient of a message (every RCPT
command), and after the contents of the message have been received,
content-scanning extension. The first specifies the interface to the virus
scanner, and the second specifies the interface to SpamAssassin. Further
details are given in chapter &<<CHAPexiscan>>&.
+
+.new
+Three more commented-out option settings follow:
+.code
+# tls_advertise_hosts = *
+# tls_certificate = /etc/ssl/exim.crt
+# tls_privatekey = /etc/ssl/exim.pem
+.endd
+These are example settings that can be used when Exim is compiled with
+support for TLS (aka SSL) as described in section &<<SECTinctlsssl>>&. The
+first one specifies the list of clients that are allowed to use TLS when
+connecting to this server; in this case the wildcard means all clients. The
+other options specify where Exim should find its TLS certificate and private
+key, which together prove the server's identity to any clients that connect.
+More details are given in chapter &<<CHAPTLS>>&.
+
+Another two commented-out option settings follow:
+.code
+# daemon_smtp_ports = 25 : 465 : 587
+# tls_on_connect_ports = 465
+.endd
+.cindex "port" "465 and 587"
+.cindex "port" "for message submission"
+.cindex "message" "submission, ports for"
+.cindex "ssmtp protocol"
+.cindex "smtps protocol"
+.cindex "SMTP" "ssmtp protocol"
+.cindex "SMTP" "smtps protocol"
+These options provide better support for roaming users who wish to use this
+server for message submission. They are not much use unless you have turned on
+TLS (as described in the previous paragraph) and authentication (about which
+more in section &<<SECTdefconfauth>>&). The usual SMTP port 25 is often blocked
+on end-user networks, so RFC 4409 specifies that message submission should use
+port 587 instead. However some software (notably Microsoft Outlook) cannot be
+configured to use port 587 correctly, so these settings also enable the
+non-standard &"smtps"& (aka &"ssmtp"&) port 465 (see section
+&<<SECTsupobssmt>>&).
.wen
Two more commented-out options settings follow:
1413 (hence their names):
.code
rfc1413_hosts = *
-rfc1413_query_timeout = 30s
+rfc1413_query_timeout = 5s
.endd
These settings cause Exim to make ident callbacks for all incoming SMTP calls.
You can limit the hosts to which these calls are made, or change the timeout
accept hosts = +relay_from_hosts
control = submission
.endd
-.new
This statement accepts the address if the message is coming from one of the
hosts that are defined as being allowed to relay through this host. Recipient
verification is omitted here, because in many cases the clients are dumb MUAs
This statement accepts the address if the client host has authenticated itself.
Submission mode is again specified, on the grounds that such messages are most
likely to come from MUAs. The default configuration does not define any
-authenticators, which means that no client can in fact authenticate. You will
-need to add authenticator definitions if you want to make use of this ACL
-statement.
-.wen
+authenticators, though it does include some nearly complete commented-out
+examples described in &<<SECTdefconfauth>>&. This means that no client can in
+fact authenticate until you complete the authenticator definitions.
+.new
+.code
+require message = relay not permitted
+ domains = +local_domains : +relay_domains
+.endd
+This statement rejects the address if its domain is neither a local domain nor
+one of the domains for which this host is a relay.
+.code
+require verify = recipient
+.endd
+This statement requires the recipient address to be verified; if verification
+fails, the address is rejected.
.code
# deny message = rejected because $sender_host_address \
# is in a black list at $dnslist_domain\n\
# $dnslist_text
# dnslists = black.list.example
#
-# warn message = X-Warning: $sender_host_address is \
-# in a black list at $dnslist_domain
+# warn dnslists = black.list.example
+# add_header = X-Warning: $sender_host_address is in \
+# a black list at $dnslist_domain
# log_message = found in $dnslist_domain
-# dnslists = black.list.example
.endd
These commented-out lines are examples of how you could configure Exim to check
sending hosts against a DNS black list. The first statement rejects messages
-from blacklisted hosts, whereas the second merely inserts a warning header
+from blacklisted hosts, whereas the second just inserts a warning header
line.
.code
-accept domains = +local_domains
- endpass
- verify = recipient
-.endd
-This statement accepts the incoming recipient address if its domain is one of
-the local domains, but only if the address can be verified. Verification of
-local addresses normally checks both the local part and the domain. The
-&%endpass%& line needs some explanation: if the condition above &%endpass%&
-fails, that is, if the address is not in a local domain, control is passed to
-the next ACL statement. However, if the condition below &%endpass%& fails, that
-is, if a recipient in a local domain cannot be verified, access is denied and
-the recipient is rejected.
-.code
-accept domains = +relay_to_domains
- endpass
- verify = recipient
+# require verify = csa
.endd
-This statement accepts the incoming recipient address if its domain is one of
-the domains for which this host is a relay, but again, only if the address can
-be verified.
+This commented-out line is an example of how you could turn on client SMTP
+authorization (CSA) checking. Such checks do DNS lookups for special SRV
+records.
.code
-deny message = relay not permitted
+accept
.endd
-The final statement denies access, giving a specific error message. Reaching
-the end of the ACL also causes access to be denied, but with the generic
-message &"administrative prohibition"&.
+The final statement in the first ACL unconditionally accepts any recipient
+address that has successfully passed all the previous tests.
+.wen
.code
acl_check_data:
.endd
-.new
This line marks the start of the second ACL, and names it. Most of the contents
of this ACL are commented out:
.code
accept
.endd
This final line in the DATA ACL accepts the message unconditionally.
-.wen
.section "Router configuration"
pipe_transport = address_pipe
reply_transport = address_reply
.endd
-.new
This is the most complicated router in the default configuration. It is another
redirection router, but this time it is looking for forwarding data set up by
individual users. The &%check_local_user%& setting specifies a check that the
variable &$local_part_suffix$&. The second suffix option specifies that the
presence of a suffix in the local part is optional. When a suffix is present,
the check for a local login uses the local part with the suffix removed.
-.wen
When a local user account is found, the file called &_.forward_& in the user's
home directory is consulted. If it does not exist, or is empty, the router
# local_part_suffix_optional
transport = local_delivery
.endd
-.new
The final router sets up delivery into local mailboxes, provided that the local
part is the name of a local login, by accepting the address and assigning it to
the &(local_delivery)& transport. Otherwise, we have reached the end of the
routers, so the address is bounced. The commented suffix settings fulfil the
same purpose as they do for the &(userforward)& router.
-.wen
.section "Transport configuration"
-.section "Authenticators configuration"
+.section "Authenticators configuration" "SECTdefconfauth"
.cindex "AUTH" "configuration"
The authenticators section of the configuration, introduced by
.code
begin authenticators
.endd
-defines mechanisms for the use of the SMTP AUTH command. No authenticators
-are specified in the default configuration file.
+defines mechanisms for the use of the SMTP AUTH command. The default
+configuration file contains two commented-out example authenticators
+which support plaintext username/password authentication using the
+standard PLAIN mechanism and the traditional but non-standard LOGIN
+mechanism, with Exim acting as the server. PLAIN and LOGIN are enough
+to support most MUA software.
+
+The example PLAIN authenticator looks like this:
+.code
+#PLAIN:
+# driver = plaintext
+# server_set_id = $auth2
+# server_prompts = :
+# server_condition = Authentication is not yet configured
+# server_advertise_condition = ${if def:tls_cipher }
+.endd
+And the example LOGIN authenticator looks like this:
+.code
+#LOGIN:
+# driver = plaintext
+# server_set_id = $auth1
+# server_prompts = <| Username: | Password:
+# server_condition = Authentication is not yet configured
+# server_advertise_condition = ${if def:tls_cipher }
+.endd
+
+The &%server_set_id%& option makes Exim remember the authenticated username
+in &$authenticated_id$&, which can be used later in ACLs or routers. The
+&%server_prompts%& option configures the &(plaintext)& authenticator so
+that it implements the details of the specific authentication mechanism,
+i.e. PLAIN or LOGIN. The &%server_advertise_condition%& setting controls
+when Exim offers authentication to clients; in the examples, this is only
+when TLS or SSL has been started, so to enable the authenticators you also
+need to add support for TLS as described in &<<SECTdefconfmain>>&.
+
+The &%server_condition%& setting defines how to verify that the username and
+password are correct. In the examples it just produces an error message.
+To make the authenticators work, you can use a string expansion
+expression like one of the examples in &<<CHAPplaintext>>&.
+
+.ecindex IIDconfiwal
. ////////////////////////////////////////////////////////////////////////////
.chapter "File and database lookups" "CHAPfdlookup"
-.cindex "file" "lookup"
-.cindex "database lookups"
+.scindex IIDfidalo1 "file" "lookups"
+.scindex IIDfidalo2 "database lookups"
.cindex "lookup" "description of"
Exim can be configured to look up data in files or databases as it processes
messages. Two different kinds of syntax are used:
chapter &<<CHAPdomhosaddlists>>&.
.endlist
-.new
String expansions, lists, and lookups interact with each other in such a way
that there is no order in which to describe any one of them that does not
involve references to the others. Each of these three chapters makes more sense
if you have read the other two first. If you are reading this for the first
time, be aware that some of it will make a lot more sense after you have read
chapters &<<CHAPdomhosaddlists>>& and &<<CHAPexpand>>&.
-.wen
.section "Examples of different lookup syntax"
It is easy to confuse the two different kinds of lookup, especially as the
domains = ${lookup{$sender_host_address}lsearch{/some/file}}
domains = lsearch;/some/file
.endd
-.new
The first uses a string expansion, the result of which must be a domain list.
No strings have been specified for a successful or a failing lookup; the
defaults in this case are the looked-up data and an empty string, respectively.
The expansion takes place before the string is processed as a list, and the
file that is searched could contain lines like this:
-.wen
.code
192.168.3.4: domain1:domain2:...
192.168.1.9: domain3:domain4:...
&*Warning 2*&: In a host list, you must always use &(net-iplsearch)& so that
the implicit key is the host's IP address rather than its name (see section
&<<SECThoslispatsikey>>&).
-
.next
+.new
.cindex "linear search"
.cindex "lookup" "lsearch"
.cindex "lsearch lookup type"
+.cindex "case sensitivity" "in lsearch lookup"
&(lsearch)&: The given file is a text file that is searched linearly for a
line beginning with the search key, terminated by a colon or white space or the
-end of the line. The first occurrence that is found in the file is used. White
-space between the key and the colon is permitted. The remainder of the line,
-with leading and trailing white space removed, is the data. This can be
+end of the line. The search is case-insensitive; that is, upper and lower case
+letters are treated as the same. The first occurrence of the key that is found
+in the file is used.
+.wen
+
+White space between the key and the colon is permitted. The remainder of the
+line, with leading and trailing white space removed, is the data. This can be
continued onto subsequent lines by starting them with any amount of white
space, but only a single space character is included in the data at such a
junction. If the data begins with a colon, the key must be terminated by a
that for &(wildlsearch)&, each key in the file is string-expanded before being
used, whereas for &(nwildlsearch)&, no expansion takes place.
-Like &(lsearch)&, the testing is done case-insensitively. The following forms
-of wildcard are recognized:
+.new
+.cindex "case sensitivity" "in (n)wildlsearch lookup"
+Like &(lsearch)&, the testing is done case-insensitively. However, keys in the
+file that are regular expressions can be made case-sensitive by the use of
+&`(-i)`& within the pattern. The following forms of wildcard are recognized:
+.wen
. ==== As this is a nested list, any displays it contains must be indented
. ==== as otherwise they are too far to the left.
.code
^\d+\.a\.b data for <digits>.a.b
.endd
+.new
+The case-insensitive flag is set at the start of compiling the regular
+expression, but it can be turned off by using &`(-i)`& at an appropriate point.
+For example, to make the entire pattern case-sensitive:
+.code
+ ^(?-i)\d+\.a\.b data for <digits>.a.b
+.endd
+.wen
+
If the regular expression contains white space or colon characters, you must
either quote it (see &(lsearch)& above), or represent these characters in other
ways. For example, &`\s`& can be used for white space and &`\x3A`& for a
are given in the supplied query. The resulting data is the contents of the
records. See section &<<SECTdnsdb>>&.
.next
-.cindex "Interbase lookup type"
-.cindex "lookup" "Interbase"
-&(ibase)&: This does a lookup in an Interbase database.
+.cindex "InterBase lookup type"
+.cindex "lookup" "InterBase"
+&(ibase)&: This does a lookup in an InterBase database.
.next
.cindex "LDAP" "lookup type"
.cindex "lookup" "LDAP"
PostgreSQL database. See section &<<SECTsql>>&.
.next
-.new
.cindex "sqlite lookup type"
.cindex "lookup" "sqlite"
&(sqlite)&: The format of the query is a file name followed by an SQL statement
that is passed to an SQLite database. See section &<<SECTsqlite>>&.
-.wen
.next
&(testdb)&: This is a lookup type that is used for testing Exim. It is
require condition = \
${lookup whoson {$sender_host_address}{yes}{no}}
.endd
-.new
The query consists of a single IP address. The value returned is the name of
the authenticated user, which is stored in the variable &$value$&. However, in
this example, the data in &$value$& is not used; the result of the lookup is
one of the fixed strings &"yes"& or &"no"&.
-.wen
.endlist
.code
${lookup dnsdb{mx=a.b.example}{$value}fail}
.endd
-.new
If the lookup succeeds, the result is placed in &$value$&, which in this case
-is used on its own as the result. If the lookup succeeds, the &`fail`& keyword
-causes a &'forced expansion failure'& &-- see section &<<SECTforexpfai>>& for
-an explanation of what this means.
-.wen
+is used on its own as the result. If the lookup &new("does not succeed,") the
+&`fail`& keyword causes a &'forced expansion failure'& &-- see section
+&<<SECTforexpfai>>& for an explanation of what this means.
The supported DNS record types are A, CNAME, MX, NS, PTR, SRV, and TXT, and,
when Exim is compiled with IPv6 support, AAAA (and A6 if that is also
for the high-level domains such as &%com%& or &%co.uk%& are not going to be on
such a list.
-.new
.cindex "CSA" "in &(dnsdb)& lookup"
A third pseudo-type is CSA (Client SMTP Authorization). This looks up SRV
records according to the CSA rules, which are described in section
has two space-separated fields: an authorization code and a target host name.
The authorization code can be &"Y"& for yes, &"N"& for no, &"X"& for explicit
authorization required but absent, or &"?"& for unknown.
-.wen
.section "Multiple dnsdb lookups"
spaces. If a value contains spaces it must be enclosed in double quotes, and
when double quotes are used, backslash is interpreted in the usual way inside
them. The following names are recognized:
+.new
.display
&`DEREFERENCE`& set the dereferencing parameter
&`NETTIME `& set a timeout for a network operation
&`USER `& set the DN, for authenticating the LDAP bind
&`PASS `& set the password, likewise
+&`REFERRALS `& set the referrals parameter
&`SIZE `& set the limit for the number of entries returned
&`TIME `& set the maximum waiting time for a query
.endd
The value of the DEREFERENCE parameter must be one of the words &"never"&,
-&"searching"&, &"finding"&, or &"always"&.
+&"searching"&, &"finding"&, or &"always"&. The value of the REFERRALS parameter
+must be &"follow"& (the default) or &"nofollow"&. The latter stops the LDAP
+library from trying to follow referrals issued by the LDAP server.
+.wen
The name CONNECT is an obsolete name for NETTIME, retained for
backwards compatibility. This timeout (specified as a number of seconds) is
.section "SQL lookups" "SECTsql"
-.new
.cindex "SQL lookup types"
-Exim can support lookups in Interbase, MySQL, Oracle, PostgreSQL, and SQLite
+Exim can support lookups in InterBase, MySQL, Oracle, PostgreSQL, and SQLite
databases. Queries for these databases contain SQL statements, so an example
might be
-.wen
.code
${lookup mysql{select mailbox from users where id='userx'}\
{$value}fail}
with a newline between the data for each row.
-.section "More about MySQL, PostgreSQL, Oracle, and Interbase"
+.section "More about MySQL, PostgreSQL, Oracle, and InterBase"
.cindex "MySQL" "lookup type"
.cindex "PostgreSQL lookup type"
.cindex "lookup" "MySQL"
.cindex "lookup" "PostgreSQL"
.cindex "Oracle" "lookup type"
.cindex "lookup" "Oracle"
-.cindex "Interbase lookup type"
-.cindex "lookup" "Interbase"
-If any MySQL, PostgreSQL, Oracle, or Interbase lookups are used, the
+.cindex "InterBase lookup type"
+.cindex "lookup" "InterBase"
+If any MySQL, PostgreSQL, Oracle, or InterBase lookups are used, the
&%mysql_servers%&, &%pgsql_servers%&, &%oracle_servers%&, or &%ibase_servers%&
option (as appropriate) must be set to a colon-separated list of server
information. Each item in the list is a slash-separated list of four items:
update, or delete command), the result of the lookup is the number of rows
affected.
-.new
.section "More about SQLite" "SECTsqlite"
.cindex "lookup" "SQLite"
.cindex "SQLite lookup type"
waits for the lock to be released. In Exim, the default timeout is set
to 5 seconds, but it can be changed by means of the &%sqlite_lock_timeout%&
option.
-.wen
+.ecindex IIDfidalo1
+.ecindex IIDfidalo2
. ////////////////////////////////////////////////////////////////////////////
.chapter "Domain, host, address, and local part lists" &&&
"CHAPdomhosaddlists" &&&
"Domain, host, and address lists"
-.cindex "list of domains; hosts; etc."
+.scindex IIDdohoadli "lists of domains; hosts; etc."
A number of Exim configuration options contain lists of domains, hosts,
email addresses, or local parts. For example, the &%hold_domains%& option
contains a list of domains whose delivery is currently suspended. These lists
.section "Negated items in lists"
.cindex "list" "negation"
-.cindex "negation in lists"
+.cindex "negation" "in lists"
Items in a list may be positive or negative. Negative items are indicated by a
leading exclamation mark, which may be followed by optional white space. A list
defines a set of items (domains, etc). When Exim processes one of these lists,
non-constant pattern. This is not the case. The keys in an &(lsearch)& file are
always fixed strings, just as for any other single-key lookup type.
+.new
If you want to use a file to contain wild-card patterns that form part of a
list, just give the file name on its own, without a search type, as described
-in the previous section.
+in the previous section. You could also use the &(wildlsearch)& or
+&(nwildlsearch)&, but there is no advantage in doing this.
+.wen
list.
&*Note*&: This section applies to permanent lookup failures. It does &'not'&
-apply to temporary DNS errors. They always cause a defer action.
+apply to temporary DNS errors. They always cause a defer action (except when
+&%dns_again_means_nonexist%& converts them into permanent errors).
detected by a regular expression that matches an empty string,
and by a query-style lookup that succeeds when &$sender_address$& is empty.
-The following kinds of address list pattern can match any address, including
-the empty address that is characteristic of bounce message senders:
+Non-empty items in an address list can be straightforward email addresses. For
+example:
+.code
+senders = jbc@askone.example : hs@anacreon.example
+.endd
+A certain amount of wildcarding is permitted. If a pattern contains an @
+character, but is not a regular expression and does not begin with a
+semicolon-terminated lookup type (described below), the local part of the
+subject address is compared with the local part of the pattern, which may start
+with an asterisk. If the local parts match, the domain is checked in exactly
+the same way as for a pattern in a domain list. For example, the domain can be
+wildcarded, refer to a named list, or be a lookup:
+.code
+deny senders = *@*.spamming.site:\
+ *@+hostile_domains:\
+ bozo@partial-lsearch;/list/of/dodgy/sites:\
+ *@dbm;/bad/domains.db
+.endd
+.cindex "local part" "starting with !"
+.cindex "address list" "local part starting with !"
+If a local part that begins with an exclamation mark is required, it has to be
+specified using a regular expression, because otherwise the exclamation mark is
+treated as a sign of negation, as is standard in lists.
+
+If a non-empty pattern that is not a regular expression or a lookup does not
+contain an @ character, it is matched against the domain part of the subject
+address. The only two formats that are recognized this way are a literal
+domain, or a domain pattern that starts with *. In both these cases, the effect
+is the same as if &`*@`& preceded the pattern. For example:
+.code
+deny senders = enemy.domain : *.enemy.domain
+.endd
+
+The following kinds of more complicated address list pattern can match any
+address, including the empty address that is characteristic of bounce message
+senders:
.ilist
-As explained above, if a pattern item is empty, it matches the empty address
-(and no others).
-
-.next
.cindex "regular expressions" "in address list"
.cindex "address list" "regular expression in"
If (after expansion) a pattern starts with &"^"&, a regular expression match is
as part of the string expansion. The simplest way to do this is to use &`\N`&
to mark that part of the string as non-expandable. For example:
.code
-deny senders = \N^\d{8}.+@spamhaus.example$\N : ...
+deny senders = \N^.*this.*@example\.com$\N : \
+ \N^\d{8}.+@spamhaus.example$\N : ...
.endd
-The &`\N`& sequences are removed by the expansion, so this item does indeed
-start with &"^"& by the time it is being interpreted as an address pattern.
+The &`\N`& sequences are removed by the expansion, so these items do indeed
+start with &"^"& by the time they are being interpreted as address patterns.
.next
.cindex "address list" "lookup for complete address"
The @@<&'lookup'&> style of item can also be used with a query-style
lookup, but in this case, the chaining facility is not available. The lookup
can only return a single list of local parts.
-.next
-If a pattern contains an @ character, but is not a regular expression and does
-not begin with a lookup type as described above, the local part of the subject
-address is compared with the local part of the pattern, which may start with an
-asterisk. If the local parts match, the domain is checked in exactly the same
-way as for a pattern in a domain list. For example, the domain can be
-wildcarded, refer to a named list, or be a lookup:
-.code
-deny senders = *@*.spamming.site:\
- *@+hostile_domains:\
- bozo@partial-lsearch;/list/of/dodgy/sites:\
- *@dbm;/bad/domains.db
-.endd
-.cindex "local part" "starting with !"
-.cindex "address list" "local part starting with !"
-If a local part that begins with an exclamation mark is required, it has to be
-specified using a regular expression, because otherwise the exclamation mark is
-treated as a sign of negation.
-.next
-If a pattern is not one of the above syntax forms, that is, if a
-non-empty pattern that is not a regular expression or a lookup does not contain
-an @ character, it is matched against the domain part of the subject address.
-The only two formats that are recognized this way are a literal domain, or a
-domain pattern that starts with *. In both these cases, the effect is the same
-as if &`*@`& preceded the pattern.
.endlist
&*Warning*&: There is an important difference between the address list items
&`@mx_any`&, &`@mx_primary`&, and &`@mx_secondary`&) are not recognized.
Refer to section &<<SECTdomainlist>>& for details of the other available item
types.
+.ecindex IIDdohoadli
. ////////////////////////////////////////////////////////////////////////////
.chapter "String expansions" "CHAPexpand"
-.cindex "expansion" "of strings"
+.scindex IIDstrexp "expansion" "of strings"
Many strings in Exim's run time configuration are expanded before use. Some of
them are expanded every time they are used; others are expanded only once.
one argument, because it reduces the number of braces and therefore makes the
string easier to understand.
-.new
.vitem "&*${dlfunc{*&<&'file'&>&*}{*&<&'function'&>&*}{*&<&'arg'&>&*}&&&
{*&<&'arg'&>&*}...}*&"
-
+.cindex &%dlfunc%&
This expansion dynamically loads and then calls a locally-written C function.
This functionality is available only if Exim is compiled with
.code
When compiling a function that is to be used in this way with gcc,
you need to add &%-shared%& to the gcc command. Also, in the Exim build-time
configuration, you must add &%-export-dynamic%& to EXTRALIBS.
-.wen
.vitem "&*${extract{*&<&'key'&>&*}{*&<&'string1'&>&*}{*&<&'string2'&>&*}&&&
{*&<&'string3'&>&*}}*&"
.cindex "expansion" "extracting substrings by key"
+.cindex "&%extract%&" "substrings by key"
The key and <&'string1'&> are first expanded separately. Leading and trailing
white space is removed from the key (but not from any of the strings). The key
must not consist entirely of digits. The expanded <&'string1'&> must be of the
.vitem "&*${extract{*&<&'number'&>&*}{*&<&'separators'&>&*}&&&
{*&<&'string1'&>&*}{*&<&'string2'&>&*}{*&<&'string3'&>&*}}*&"
.cindex "expansion" "extracting substrings by number"
+.cindex "&%extract%&" "substrings by number"
The <&'number'&> argument must consist entirely of decimal digits,
apart from leading and trailing white space, which is ignored.
This is what distinguishes this form of &%extract%& from the previous kind. It
.vitem &*${hmac{*&<&'hashname'&>&*}{*&<&'secret'&>&*}{*&<&'string'&>&*}}*&
.cindex "expansion" "hmac hashing"
+.cindex &%hmac%&
This function uses cryptographic hashing (either MD5 or SHA-1) to convert a
shared secret and some text into a message authentication code, as specified in
RFC 2104. This differs from &`${md5:secret_text...}`& or
.vitem &*${if&~*&<&'condition'&>&*&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}}*&
.cindex "expansion" "conditional"
+.cindex "&%if%&, expansion item"
If <&'condition'&> is true, <&'string1'&> is expanded and replaces the whole
item; otherwise <&'string2'&> is used. The available conditions are described
in section &<<SECTexpcond>>& below. For example:
.vitem &*${length{*&<&'string1'&>&*}{*&<&'string2'&>&*}}*&
.cindex "expansion" "string truncation"
+.cindex "&%length%&" "expansion item"
The &%length%& item is used to extract the initial portion of a string. Both
strings are expanded, and the first one must yield a number, <&'n'&>, say. If
you are using a fixed value for the number, that is, if <&'string1'&> does not
.vitem "&*${lookup&~*&<&'search&~type'&>&*&~{*&<&'query'&>&*}&~&&&
{*&<&'string1'&>&*}&~{*&<&'string2'&>&*}}*&"
.cindex "expansion" "lookup in"
-.cindex "file" "lookup"
+.cindex "file" "lookups"
.cindex "lookup" "in expanded string"
The two forms of lookup item specify data lookups in files and databases, as
discussed in chapter &<<CHAPfdlookup>>&. The first form is used for single-key
out the use of this expansion item in filter files.
-.new
.vitem &*${prvs{*&<&'address'&>&*}{*&<&'secret'&>&*}{*&<&'keynumber'&>&*}}*&
.cindex "prvs" "expansion item"
The first argument is a complete email address and the second is secret
to be typically used with the &%return_path%& option on an &(smtp)& transport
as part of a bounce address tag validation (BATV) scheme. For more discussion
and an example, see section &<<SECTverifyPRVS>>&.
-.wen
-.new
.vitem "&*${prvscheck{*&<&'address'&>&*}{*&<&'secret'&>&*}&&&
{*&<&'string'&>&*}}*&"
.cindex "prvscheck" "expansion item"
All three variables can be used in the expansion of the third argument.
However, once the expansion is complete, only &$prvscheck_result$& remains set.
For more discussion and an example, see section &<<SECTverifyPRVS>>&.
-.wen
.vitem &*${readfile{*&<&'file&~name'&>&*}{*&<&'eol&~string'&>&*}}*&
.cindex "expansion" "inserting an entire file"
.cindex "file" "inserting into expansion"
+.cindex "&%readfile%& expansion item"
The file name and end-of-line string are first expanded separately. The file is
then read, and its contents replace the entire item. All newline characters in
the file are replaced by the end-of-line string if it is present. Otherwise,
{*&<&'timeout'&>&*}{*&<&'eol&~string'&>&*}{*&<&'fail&~string'&>&*}}*&"
.cindex "expansion" "inserting from a socket"
.cindex "socket" "use of in expansion"
-This item inserts data that is read from a Unix domain socket into the expanded
-string. The minimal way of using it uses just two arguments:
+.cindex "&%readsocket%& expansion item"
+This item inserts data from a Unix domain or Internet socket into the expanded
+string. The minimal way of using it uses just two arguments, as in these
+examples:
.code
${readsocket{/socket/name}{request string}}
+${readsocket{inet:some.host:1234}{request string}}
.endd
-Exim connects to the socket, writes the request string (unless it is an
-empty string) and reads from the socket until an end-of-file is read. A timeout
-of 5 seconds is applied. Additional, optional arguments extend what can be
-done. Firstly, you can vary the timeout. For example:
+For a Unix domain socket, the first substring must be the path to the socket.
+For an Internet socket, the first substring must contain &`inet:`& followed by
+a host name or IP address, followed by a colon and a port, which can be a
+number or the name of a TCP port in &_/etc/services_&. An IP address may
+optionally be enclosed in square brackets. This is best for IPv6 addresses. For
+example:
+.code
+${readsocket{inet:[::1]:1234}{request string}}
+.endd
+Only a single host name may be given, but if looking it up yields more than
+one IP address, they are each tried in turn until a connection is made. For
+both kinds of socket, Exim makes a connection, writes the request string
+(unless it is an empty string) and reads from the socket until an end-of-file
+is read. A timeout of 5 seconds is applied. Additional, optional arguments
+extend what can be done. Firstly, you can vary the timeout. For example:
.code
-${readsocket{/socket/name}{request-string}{3s}}
+${readsocket{/socket/name}{request string}{3s}}
.endd
A fourth argument allows you to change any newlines that are in the data
that is read, in the same way as for &%readfile%& (see above). This example
turns them into spaces:
.code
-${readsocket{/socket/name}{request-string}{3s}{ }}
+${readsocket{inet:127.0.0.1:3294}{request string}{3s}{ }}
.endd
As with all expansions, the substrings are expanded before the processing
happens. Errors in these sub-expansions cause the expansion to fail. In
.next
Failure to connect the socket;
.next
-Failure to write the request-string;
+Failure to write the request string;
.next
Timeout on reading from the socket.
.endlist
you supply a fifth substring, it is expanded and used when any of the above
errors occurs. For example:
.code
-${readsocket{/socket/name}{request-string}{3s}{\n}\
+${readsocket{/socket/name}{request string}{3s}{\n}\
{socket failure}}
.endd
-You can test for the existence of the socket by wrapping this expansion in
-&`${if exists`&, but there is a race condition between that test and the
-actual opening of the socket, so it is safer to use the fifth argument if you
-want to be absolutely sure of avoiding an expansion error for a non-existent
-socket.
+You can test for the existence of a Unix domain socket by wrapping this
+expansion in &`${if exists`&, but there is a race condition between that test
+and the actual opening of the socket, so it is safer to use the fifth argument
+if you want to be absolutely sure of avoiding an expansion error for a
+non-existent Unix domain socket, or a failure to connect to an Internet socket.
The &(redirect)& router has an option called &%forbid_filter_readsocket%& which
locks out the use of this expansion item in filter files.
.vitem "&*${run{*&<&'command'&>&*&~*&<&'args'&>&*}{*&<&'string1'&>&*}&&&
{*&<&'string2'&>&*}}*&"
.cindex "expansion" "running a command"
+.cindex "&%run%& expansion item"
The command and its arguments are first expanded separately, and then the
command is run in a separate process, but under the same uid and gid. As in
other command executions from Exim, a shell is not used by default. If you want
a shell, you must explicitly code it.
-.new
.cindex "return code" "from &%run%& expansion"
.cindex "&$value$&"
If the command succeeds (gives a zero return code) <&'string1'&> is expanded
&"fail"& (not in braces) to force expansion failure if the command does not
succeed. If both strings are omitted, the result is contents of the standard
output on success, and nothing on failure.
-.wen
.cindex "&$runrc$&"
The return code from the command is put in the variable &$runrc$&, and this
.vitem &*${sg{*&<&'subject'&>&*}{*&<&'regex'&>&*}{*&<&'replacement'&>&*}}*&
.cindex "expansion" "string substitution"
+.cindex "&%sg%& expansion item"
This item works like Perl's substitution operator (s) with the global (/g)
option; hence its name. However, unlike the Perl equivalent, Exim does not
modify the subject string; instead it returns the modified string for insertion
.vitem "&*${tr{*&<&'subject'&>&*}{*&<&'characters'&>&*}&&&
{*&<&'replacements'&>&*}}*&"
.cindex "expansion" "character translation"
+.cindex "&%tr%& expansion item"
This item does single-character translation on its subject string. The second
argument is a list of characters to be translated in the subject string. Each
matching character is replaced by the corresponding character from the
.vlist
.vitem &*${address:*&<&'string'&>&*}*&
.cindex "expansion" "RFC 2822 address handling"
+.cindex "&%address%&" "expansion item"
The string is interpreted as an RFC 2822 address, as it might appear in a
header line, and the effective address is extracted from it. If the string does
not parse successfully, the result is empty.
-.new
.vitem &*${base62:*&<&'digits'&>&*}*&
-.cindex "base62"
+.cindex "&%base62%&"
.cindex "expansion" "conversion to base 62"
The string must consist entirely of decimal digits. The number is converted to
base 62 and output as a string of six characters, including leading zeros. In
its message identifiers (because those systems do not have case-sensitive file
names), base 36 is used by this operator, despite its name. &*Note*&: Just to
be absolutely clear: this is &'not'& base64 encoding.
-.wen
-.new
.vitem &*${base62d:*&<&'base-62&~digits'&>&*}*&
-.cindex "base62"
+.cindex "&%base62d%&"
.cindex "expansion" "conversion to base 62"
The string must consist entirely of base-62 digits, or, in operating
environments where Exim uses base 36 instead of base 62 for its message
identifiers, base-36 digits. The number is converted to decimal and output as a
string.
-.wen
.vitem &*${domain:*&<&'string'&>&*}*&
.cindex "domain" "extraction"
.vitem &*${escape:*&<&'string'&>&*}*&
.cindex "expansion" "escaping non-printing characters"
+.cindex "&%escape%&, expansion item"
If the string contains any non-printing characters, they are converted to
escape sequences starting with a backslash. Whether characters with the most
significant bit set (so-called &"8-bit characters"&) count as printing or not
.vitem &*${eval:*&<&'string'&>&*}*&&~and&~&*${eval10:*&<&'string'&>&*}*&
.cindex "expansion" "expression evaluation"
.cindex "expansion" "arithmetic expression"
-.new
+.cindex "&%eval%& expansion item"
These items supports simple arithmetic in expansion strings. The string (after
expansion) must be a conventional arithmetic expression, but it is limited to
five basic operators (plus, minus, times, divide, remainder) and parentheses.
All operations are carried out using integer arithmetic. Plus and minus have a
lower priority than times, divide, and remainder; operators with the same
priority are evaluated from left to right.
-.wen
+.new
For &%eval%&, numbers may be decimal, octal (starting with &"0"&) or
hexadecimal (starting with &"0x"&). For &%eval10%&, all numbers are taken as
-decimal, even if they start with a leading zero. This can be useful when
-processing numbers extracted from dates or times, which often do have leading
-zeros.
+decimal, even if they start with a leading zero; hexadecimal numbers are not
+permitted. This can be useful when processing numbers extracted from dates or
+times, which often do have leading zeros.
+.wen
A number may be followed by &"K"& or &"M"& to multiply it by 1024 or 1024*1024,
respectively. Negative numbers are supported. The result of the computation is
a decimal representation of the answer (without &"K"& or &"M"&). For example:
-.new
.display
&`${eval:1+1} `& yields 2
&`${eval:1+2*3} `& yields 7
&`${eval:(1+2)*3} `& yields 9
&`${eval:2+42%5} `& yields 4
.endd
-.wen
As a more realistic example, in an ACL you might have
.code
.cindex "Unicode"
.cindex "UTF-8" "conversion from"
.cindex "expansion" "UTF-8 conversion"
+.cindex "&%from_utf8%&"
The world is slowly moving towards Unicode, although there are no standards for
email yet. However, other applications (including some databases) are starting
to store data in Unicode, using UTF-8 encoding. This operator converts from a
.vitem &*${hex2b64:*&<&'hexstring'&>&*}*&
.cindex "base64 encoding" "conversion from hex"
.cindex "expansion" "hex to base64"
+.cindex "&%hex2b64%&"
This operator converts a hex string into one that is base64 encoded. This can
be useful for processing the output of the MD5 and SHA-1 hashing functions.
.cindex "string" "case forcing"
.cindex "lower casing"
.cindex "expansion" "case forcing"
+.cindex "&%lc%& expansion item"
This forces the letters in the string into lower-case, for example:
.code
${lc:$local_part}
.vitem &*${length_*&<&'number'&>&*:*&<&'string'&>&*}*&
.cindex "expansion" "string truncation"
+.cindex "&%length%&" "expansion item"
The &%length%& operator is a simpler interface to the &%length%& function that
can be used when the parameter is a fixed number (as opposed to a string that
changes when expanded). The effect is the same as
.vitem &*${local_part:*&<&'string'&>&*}*&
.cindex "expansion" "local part extraction"
+.cindex "&%local_part%& expansion item"
The string is interpreted as an RFC 2822 address and the local part is
extracted from it. If the string does not parse successfully, the result is
empty.
.cindex "IP address" "masking"
.cindex "CIDR notation"
.cindex "expansion" "IP address masking"
+.cindex "&%mask%&, expansion item"
If the form of the string to be operated on is not an IP address followed by a
slash and an integer (that is, a network address in CIDR notation), the
expansion fails. Otherwise, this operator converts the IP address to binary,
.vitem &*${md5:*&<&'string'&>&*}*&
.cindex "MD5 hash"
.cindex "expansion" "MD5 hash"
+.cindex "&%md5%& expansion item"
The &%md5%& operator computes the MD5 hash value of the string, and returns it
as a 32-digit hexadecimal number, in which any letters are in lower case.
.vitem &*${quote:*&<&'string'&>&*}*&
.cindex "quoting" "in string expansions"
.cindex "expansion" "quoting"
+.cindex "&%quote%&, expansion item"
The &%quote%& operator puts its argument into double quotes if it
is an empty string or
contains anything other than letters, digits, underscores, dots, and hyphens.
variable or a message header.
.vitem &*${quote_local_part:*&<&'string'&>&*}*&
+.cindex "&%quote_local_part%& expansion item"
This operator is like &%quote%&, except that it quotes the string only if
required to do so by the rules of RFC 2822 for quoting local parts. For
example, a plus sign would not cause quoting (but it would for &%quote%&).
yields an unchanged string.
-.vitem &*${rxquote:*&<&'string'&>&*}*&
-.cindex "quoting" "in regular expressions"
-.cindex "regular expressions" "quoting"
-The &%rxquote%& operator inserts a backslash before any non-alphanumeric
-characters in its argument. This is useful when substituting the values of
-variables or headers inside regular expressions.
-
-
.vitem &*${rfc2047:*&<&'string'&>&*}*&
.cindex "expansion" "RFC 2047"
.cindex "RFC 2047" "expansion operator"
+.cindex "&%rfc2047%& expansion item"
This operator encodes text according to the rules of RFC 2047. This is an
encoding that is used in header lines to encode non-ASCII characters. It is
assumed that the input string is in the encoding specified by the
+.vitem &*${rxquote:*&<&'string'&>&*}*&
+.cindex "quoting" "in regular expressions"
+.cindex "regular expressions" "quoting"
+.cindex "&%rxquote%& expansion item"
+The &%rxquote%& operator inserts a backslash before any non-alphanumeric
+characters in its argument. This is useful when substituting the values of
+variables or headers inside regular expressions.
+
+
.vitem &*${sha1:*&<&'string'&>&*}*&
.cindex "SHA-1 hash"
.cindex "expansion" "SHA-1 hashing"
+.cindex "&%sha2%& expansion item"
The &%sha1%& operator computes the SHA-1 hash value of the string, and returns
it as a 40-digit hexadecimal number, in which any letters are in upper case.
.vitem &*${stat:*&<&'string'&>&*}*&
.cindex "expansion" "statting a file"
.cindex "file" "extracting characteristics"
+.cindex "&%stat%& expansion item"
The string, after expansion, must be a file path. A call to the &[stat()]&
function is made for this path. If &[stat()]& fails, an error occurs and the
expansion fails. If it succeeds, the data from the stat replaces the item, as a
&"links"&, &"uid"&, &"gid"&, &"size"&, &"atime"&, &"mtime"&, and &"ctime"&. You
can extract individual fields using the &%extract%& expansion item.
-.new
The use of the &%stat%& expansion in users' filter files can be locked out by
the system administrator. &*Warning*&: The file size may be incorrect on 32-bit
systems for files larger than 2GB.
-.wen
.vitem &*${str2b64:*&<&'string'&>&*}*&
.cindex "expansion" "base64 encoding"
.cindex "base64 encoding" "in string expansion"
+.cindex "&%str2b64%& expansion item"
This operator converts a string into one that is base64 encoded.
.vitem &*${strlen:*&<&'string'&>&*}*&
.cindex "expansion" "string length"
.cindex "string" "length in expansion"
+.cindex "&%strlen%& expansion item"
The item is replace by the length of the expanded string, expressed as a
decimal number. &*Note*&: Do not confuse &%strlen%& with &%length%&.
.vitem &*${substr_*&<&'start'&>&*_*&<&'length'&>&*:*&<&'string'&>&*}*&
-.cindex "&%substr%&"
+.cindex "&%substr%& expansion item"
.cindex "substring extraction"
.cindex "expansion" "substring expansion"
The &%substr%& operator is a simpler interface to the &%substr%& function that
See the description of the general &%substr%& item above for details. The
abbreviation &%s%& can be used when &%substr%& is used as an operator.
+.vitem &*${time_eval:*&<&'string'&>&*}*&
+.cindex "&%time_eval%& expansion item"
+.cindex "time interval" "decoding"
+This item converts an Exim time interval such as &`2d4h5m`& into a number of
+seconds.
+
.vitem &*${time_interval:*&<&'string'&>&*}*&
-.cindex "&%time_interval%&"
+.cindex "&%time_interval%& expansion item"
.cindex "time interval" "formatting"
The argument (after sub-expansion) must be a sequence of decimal digits that
represents an interval of time as a number of seconds. It is converted into a
.cindex "string" "case forcing"
.cindex "upper casing"
.cindex "expansion" "case forcing"
+.cindex "&%uc%& expansion item"
This forces the letters in the string into upper-case.
.endlist
.vlist
.vitem &*!*&<&'condition'&>
.cindex "expansion" "negating a condition"
+.cindex "negation" "in expansion condition"
Preceding any condition with an exclamation mark negates the result of the
condition.
.vitem &*crypteq&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
.cindex "expansion" "encrypted comparison"
.cindex "encrypted strings" "comparing"
+.cindex "&%crypteq%& expansion condition"
This condition is included in the Exim binary if it is built to support any
authentication mechanisms (see chapter &<<CHAPSMTPAUTH>>&). Otherwise, it is
necessary to define SUPPORT_CRYPTEQ in &_Local/Makefile_& to get &%crypteq%&
.vitem &*def:*&<&'variable&~name'&>
.cindex "expansion" "checking for empty variable"
+.cindex "&%def%& expansion condition"
The &%def%& condition must be followed by the name of one of the expansion
variables defined in section &<<SECTexpvar>>&. The condition is true if the
variable does not contain the empty string. For example:
.vitem &*eq&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
.cindex "string" "comparison"
.cindex "expansion" "string comparison"
+.cindex "&%eq%& expansion condition"
The two substrings are first expanded. The condition is true if the two
resulting strings are identical, including the case of letters.
.vitem &*eqi&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
.cindex "string" "comparison"
.cindex "expansion" "string comparison"
+.cindex "&%eqi%& expansion condition"
The two substrings are first expanded. The condition is true if the two
resulting strings are identical when compared in a case-independent way.
.vitem &*exists&~{*&<&'file&~name'&>&*}*&
.cindex "expansion" "file existence test"
.cindex "file" "existence test"
+.cindex "&%exists%&, expansion condition"
The substring is first expanded and then interpreted as an absolute path. The
condition is true if the named file (or directory) exists. The existence test
is done by calling the &[stat()]& function. The use of the &%exists%& test in
.cindex "delivery" "first"
.cindex "first delivery"
.cindex "expansion" "first delivery test"
+.cindex "&%first_delivery%& expansion condition"
This condition, which has no data, is true during a message's first delivery
attempt. It is false during any subsequent delivery attempts.
.vitem &*ge&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
+.cindex "&%ge%& expansion condition"
See &*gei*&.
.vitem &*gei&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
.cindex "string" "comparison"
.cindex "expansion" "string comparison"
+.cindex "&%gei%& expansion condition"
The two substrings are first expanded. The condition is true if the first
string is lexically greater than or equal to the second string: for &%ge%& the
comparison includes the case of letters, whereas for &%gei%& the comparison is
case-independent.
.vitem &*gt&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
+.cindex "&%gt%& expansion condition"
See &*gti*&.
.vitem &*gti&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
.cindex "string" "comparison"
.cindex "expansion" "string comparison"
+.cindex "&%gti%& expansion condition"
The two substrings are first expanded. The condition is true if the first
string is lexically greater than the second string: for &%gt%& the comparison
includes the case of letters, whereas for &%gti%& the comparison is
case-independent.
.vitem &*isip&~{*&<&'string'&>&*}*&
+.cindex "&%isip%& expansion condition"
See &*isip6*&.
.vitem &*isip4&~{*&<&'string'&>&*}*&
+.cindex "&%isip4%& expansion condition"
See &*isip6*&.
.vitem &*isip6&~{*&<&'string'&>&*}*&
.cindex "IP address" "testing string format"
.cindex "string" "testing for IP address"
+.cindex "&%isip6%& expansion condition"
The substring is first expanded, and then tested to see if it has the form of
an IP address. Both IPv4 and IPv6 addresses are valid for &%isip%&, whereas
&%isip4%& and &%isip6%& test just for IPv4 or IPv6 addresses, respectively. For
.vitem &*ldapauth&~{*&<&'ldap&~query'&>&*}*&
.cindex "LDAP" "use for authentication"
.cindex "expansion" "LDAP authentication test"
+.cindex "&%ldapauth%& expansion condition"
This condition supports user authentication using LDAP. See section
&<<SECTldap>>& for details of how to use LDAP in lookups and the syntax of
queries. For this use, the query must contain a user name and password. The
.vitem &*le&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
+.cindex "&%le%& expansion condition"
See &*lei*&.
.vitem &*lei&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
.cindex "string" "comparison"
.cindex "expansion" "string comparison"
+.cindex "&%lei%& expansion condition"
The two substrings are first expanded. The condition is true if the first
string is lexically less than or equal to the second string: for &%le%& the
comparison includes the case of letters, whereas for &%lei%& the comparison is
case-independent.
.vitem &*lt&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
+.cindex "&%lt%& expansion condition"
See &*lti*&.
.vitem &*lti&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
.cindex "string" "comparison"
.cindex "expansion" "string comparison"
+.cindex "&%lti%& expansion condition"
The two substrings are first expanded. The condition is true if the first
string is lexically less than the second string: for &%lt%& the comparison
includes the case of letters, whereas for &%lti%& the comparison is
.vitem &*match&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
.cindex "expansion" "regular expression comparison"
.cindex "regular expressions" "match in expanded string"
+.cindex "&%match%&, expansion condition"
The two substrings are first expanded. The second is then treated as a regular
expression and applied to the first. Because of the pre-expansion, if the
regular expression contains dollar, or backslash characters, they must be
variables are those of the condition that succeeded.
.vitem &*match_address&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
+.cindex "&%match_address%& expansion condition"
See &*match_local_part*&.
.vitem &*match_domain&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
+.cindex "&%match_domain%& expansion condition"
See &*match_local_part*&.
-.new
.vitem &*match_ip&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
+.cindex "&%match_ip%& expansion condition"
This condition matches an IP address to a list of IP address patterns. It must
be followed by two argument strings. The first (after expansion) must be an IP
address or an empty string. The second (after expansion) is a restricted host
${if match_ip{$sender_host_address}{lsearch;/some/file}...
${if match_ip{$sender_host_address}{net-lsearch;/some/file}...
.endd
+.new
You do need to specify the &`net-`& prefix if you want to specify a
-specific address mask, for example, by using &`net24-`&.
+specific address mask, for example, by using &`net24-`&. However, unless you
+are combining a &%match_ip%& condition with others, it is usually neater to use
+an expansion lookup such as:
+.code
+ ${lookup{${mask:$sender_host_address/24}}lsearch{/some/file}...
+.endd
+.wen
.endlist ilist
Consult section &<<SECThoslispatip>>& for further details of these patterns.
-.wen
.vitem &*match_local_part&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
.cindex "domain list" "in expansion condition"
.cindex "address list" "in expansion condition"
.cindex "local part list" "in expansion condition"
+.cindex "&%match_local_part%& expansion condition"
This condition, together with &%match_address%& and &%match_domain%&, make it
possible to test domain, address, and local part lists within expansions. Each
condition requires two arguments: an item and a list to match. A trivial
.cindex "AUTH" "with PAM"
.cindex "Solaris" "PAM support"
.cindex "expansion" "PAM authentication test"
+.cindex "&%pam%& expansion condition"
&'Pluggable Authentication Modules'&
(&url(http://www.kernel.org/pub/linux/libs/pam/)) are a facility that is
available in the latest releases of Solaris and in some GNU/Linux
separators. If the data is being inserted from a variable, the &%sg%& expansion
item can be used to double any existing colons. For example, the configuration
of a LOGIN authenticator might contain this setting:
+.new
.code
-server_condition = ${if pam{$1:${sg{$2}{:}{::}}}{yes}{no}}
+server_condition = ${if pam{$auth1:${sg{$auth2}{:}{::}}}}
.endd
For a PLAIN authenticator you could use:
.code
-server_condition = ${if pam{$2:${sg{$3}{:}{::}}}{yes}{no}}
+server_condition = ${if pam{$auth2:${sg{$auth3}{:}{::}}}}
.endd
+.wen
In some operating systems, PAM authentication can be done only from a process
running as root. Since Exim is running as the Exim user when receiving
messages, this means that PAM cannot be used directly in those systems.
.cindex "&'pwcheck'& daemon"
.cindex "Cyrus"
.cindex "expansion" "&'pwcheck'& authentication test"
+.cindex "&%pwcheck%& expansion condition"
This condition supports user authentication using the Cyrus &'pwcheck'& daemon.
This is one way of making it possible for passwords to be checked by a process
that is not running as root. &*Note*&: The use of &'pwcheck'& is now
The &%pwcheck%& condition takes one argument, which must be the user name and
password, separated by a colon. For example, in a LOGIN authenticator
configuration, you might have this:
+.new
.code
-server_condition = ${if pwcheck{$1:$2}{1}{0}}
+server_condition = ${if pwcheck{$auth1:$auth2}}
.endd
+.wen
.vitem &*queue_running*&
.cindex "queue runner" "detecting when delivering from"
.cindex "expansion" "queue runner test"
+.cindex "&%queue_runnint%& expansion condition"
This condition, which has no data, is true during delivery attempts that are
initiated by queue runner processes, and false otherwise.
.vitem &*radius&~{*&<&'authentication&~string'&>&*}*&
.cindex "Radius"
.cindex "expansion" "Radius authentication"
+.cindex "&%radiu%& expansion condition"
Radius authentication (RFC 2865) is supported in a similar way to PAM. You must
set RADIUS_CONFIG_FILE in &_Local/Makefile_& to specify the location of
the Radius client configuration file in order to build Exim with Radius
support.
-.new
With just that one setting, Exim expects to be linked with the &%radiusclient%&
library, using the original API. If you are using release 0.4.0 or later of
this library, you need to set
.endd
in &_Local/Makefile_& when building Exim. You can also link Exim with the
&%libradius%& library that comes with FreeBSD. To do this, set
-.wen
.code
RADIUS_LIB_TYPE=RADLIB
.endd
Radius client library, which calls the Radius server. The condition is true if
the authentication is successful. For example:
.code
-server_condition = ${if radius{<arguments>}{yes}{no}}
+server_condition = ${if radius{<arguments>}}
.endd
.cindex "&'saslauthd'& daemon"
.cindex "Cyrus"
.cindex "expansion" "&'saslauthd'& authentication test"
+.cindex "&%saslauthd%& expansion condition"
This condition supports user authentication using the Cyrus &'saslauthd'&
daemon. This replaces the older &'pwcheck'& daemon, which is now deprecated.
Using this daemon is one way of making it possible for passwords to be checked
Up to four arguments can be supplied to the &%saslauthd%& condition, but only
two are mandatory. For example:
+.new
.code
-server_condition = ${if saslauthd{{$1}{$2}}{1}{0}}
+server_condition = ${if saslauthd{{$auth1}{$auth2}}}
.endd
+.wen
The service and the realm are optional (which is why the arguments are enclosed
in their own set of braces). For details of the meaning of the service and
realm, and how to run the daemon, consult the Cyrus documentation.
files include an &%if%& command with its own regular expression matching
condition.
-.vitem "&$acl_c0$& &-- &$acl_c9$&"
+.vitem "&$acl_c0$& &-- &$acl_c19$&"
Values can be placed in these variables by the &%set%& modifier in an ACL. The
values persist throughout the lifetime of an SMTP connection. They can be used
-to pass information between ACLs and different invocations of the same ACL.
-When a message is received, the values of these variables are saved with the
-message, and can be accessed by filters, routers, and transports during
+to pass information between ACLs and between different invocations of the same
+ACL. When a message is received, the values of these variables are saved with
+the message, and can be accessed by filters, routers, and transports during
subsequent delivery.
-.vitem "&$acl_m0$& &-- &$acl_m9$&"
+.vitem "&$acl_m0$& &-- &$acl_m19$&"
Values can be placed in these variables by the &%set%& modifier in an ACL. They
retain their values while a message is being received, but are reset
afterwards. They are also reset by MAIL, RSET, EHLO, HELO, and after starting a
saved with the message, and can be accessed by filters, routers, and transports
during subsequent delivery.
-.new
.vitem &$acl_verify_message$&
.cindex "&$acl_verify_message$&"
After an address verification has failed, this variable contains the failure
You can use &$acl_verify_message$& during the expansion of the &%message%& or
&%log_message%& modifiers, to include information about the verification
failure.
-.wen
.vitem &$address_data$&
.cindex "&$address_data$&"
When, as a result of aliasing or forwarding, a message is directed to a pipe,
this variable holds the pipe command when the transport is running.
+.vitem "&$auth1$& &-- &$auth3$&"
+.cindex "&$auth1$&, &$auth2$&, etc"
+These variables are used in SMTP authenticators (see chapters
+&<<CHAPplaintext>>&&--&<<CHAPspa>>&). Elsewhere, they are empty.
+
.vitem &$authenticated_id$&
.cindex "authentication" "id"
.cindex "&$authenticated_id$&"
&$authenticated_id$& (see chapter &<<CHAPSMTPAUTH>>&). For example, a
user/password authenticator configuration might preserve the user name for use
in the routers. Note that this is not the same information that is saved in
-&$sender_host_authenticated$&. When a message is submitted locally (that is,
-not over a TCP connection), the value of &$authenticated_id$& is the login name
-of the calling process.
+&$sender_host_authenticated$&.
+&new("When a message is submitted locally (that is, not over a TCP connection)
+the value of &$authenticated_id$& is normally the login name of the calling
+process. However, a trusted user can override this by means of the &%-oMai%&
+command line option.")
+
+
+
.vitem &$authenticated_sender$&
.cindex "sender" "authenticated"
available during delivery in the &$authenticated_sender$& variable. If the
sender is not trusted, Exim accepts the syntax of AUTH=, but ignores the data.
+.new
.cindex "&$qualify_domain$&"
When a message is submitted locally (that is, not over a TCP connection), the
value of &$authenticated_sender$& is an address constructed from the login
-name of the calling process and &$qualify_domain$&.
+name of the calling process and &$qualify_domain$&, except that a trusted user
+can override this by means of the &%-oMas%& command line option.
+.wen
.vitem &$authentication_failed$&
of the environment variable HOME.
.vitem &$host$&
+.new
.cindex "&$host$&"
-When the &(smtp)& transport is expanding its options for encryption using TLS,
-&$host$& contains the name of the host to which it is connected. Likewise, when
-used in the client part of an authenticator configuration (see chapter
-&<<CHAPSMTPAUTH>>&), &$host$& contains the name of the server to which the
-client is connected.
+If a router assigns an address to a transport (any transport), and passes a
+list of hosts with the address, the value of &$host$& when the transport starts
+to run is the name of the first host on the list. Note that this applies both
+to local and remote transports.
.cindex "transport" "filter"
.cindex "filter" "transport filter"
-When used in a transport filter (see chapter &<<CHAPtransportgeneric>>&)
-&$host$& refers to the host involved in the current connection. When a local
-transport is run as a result of a router that sets up a host list, &$host$&
-contains the name of the first host.
+For the &(smtp)& transport, if there is more than one host, the value of
+&$host$& changes as the transport works its way through the list. In
+particular, when the &(smtp)& transport is expanding its options for encryption
+using TLS, or for specifying a transport filter (see chapter
+&<<CHAPtransportgeneric>>&), &$host$& contains the name of the host to which it
+is connected.
+
+When used in the client part of an authenticator configuration (see chapter
+&<<CHAPSMTPAUTH>>&), &$host$& contains the name of the server to which the
+client is connected.
+.wen
+
.vitem &$host_address$&
.cindex "&$host_address$&"
of the temporary file which is about to be renamed. It can be used to construct
a unique name for the file.
-.new
.vitem &$interface_address$&
.cindex "&$interface_address$&"
As soon as a server starts processing a TCP/IP connection, this variable is set
ACL. See also the &%-oMi%& command line option. As well as being used in ACLs,
these variable could be used, for example, to make the file name for a TLS
certificate depend on which interface and/or port is being used.
-.wen
.vitem &$interface_port$&
.cindex "&$interface_port$&"
separates the body from the header. Newlines are included in the count. See
also &$message_size$&, &$body_linecount$&, and &$body_zerocount$&.
-.new
.vitem &$message_exim_id$&
.cindex "&$message_exim_id$&"
When a message is being received or delivered, this variable contains the
received. &*Note*&: This is &'not'& the contents of the &'Message-ID:'& header
line; it is the local id that Exim assigns to the message, for example:
&`1BXTIK-0001yO-VA`&.
-.wen
.vitem &$message_headers$&
This variable contains a concatenation of all the header lines when a message
lines are separated by newline characters.
.vitem &$message_id$&
-.new
This is an old name for &$message_exim_id$&, which is now deprecated.
-.wen
-.new
.vitem &$message_linecount$&
.cindex "&$message_linecount$&"
This variable contains the total number of lines in the header and body of the
.endd
In the MAIL and RCPT ACLs, the value is zero because at that stage the
message has not yet been received.
-.wen
.vitem &$message_size$&
.cindex "size" "of message"
.cindex "transport" "filter"
.cindex "&$pipe_addresses$&"
This is not an expansion variable, but is mentioned here because the string
-&"$pipe_addresses"& is handled specially in the command specification for the
+&`$pipe_addresses`& is handled specially in the command specification for the
&(pipe)& transport (chapter &<<CHAPpipetransport>>&) and in transport filters
(described under &%transport_filter%& in chapter &<<CHAPtransportgeneric>>&).
It cannot be used in general expansion strings, and provokes an &"unknown
qualified host name. See also &$smtp_active_hostname$&.
-.new
.vitem &$prvscheck_address$&
This variable is used in conjunction with the &%prvscheck%& expansion item,
which is described in sections &<<SECTexpansionitems>>& and
This variable is used in conjunction with the &%prvscheck%& expansion item,
which is described in sections &<<SECTexpansionitems>>& and
&<<SECTverifyPRVS>>&.
-.wen
.vitem &$qualify_domain$&
.cindex "&$qualify_domain$&"
messages that are injected locally by trusted callers. This is commonly used to
identify messages that are being re-injected after some kind of scanning.
-.new
.vitem &$received_time$&
.cindex "&$received_time$&"
This variable contains the date and time when the current message was received,
as a number of seconds since the start of the Unix epoch.
-.wen
.vitem &$recipient_data$&
.cindex "&$recipient_data$&"
.olist
In a system filter file.
.next
-In the ACLs associated with the DATA command, that is, the ACLs defined by
-&%acl_smtp_predata%& and &%acl_smtp_data%&.
+.new
+In the ACLs associated with the DATA command and with non-SMTP messages, that
+is, the ACLs defined by &%acl_smtp_predata%&, &%acl_smtp_data%&,
+&%acl_smtp_mime%&, &%acl_not_smtp_start%&, &%acl_not_smtp%&, and
+&%acl_not_smtp_mime%&.
+.wen
.endlist
from the count. While a message is being received over SMTP, the number
increases for each accepted recipient. It can be referenced in an ACL.
+
+.new
+.vitem &$regex_match_string$&
+.cindex "&$regex_match_string$&"
+This variable is set to contain the matching regular expression after a
+&%regex%& ACL condition has matched (see section &<<SECTscanregex>>&).
+.wen
+
+
.vitem &$reply_address$&
.cindex "&$reply_address$&"
When a message is being processed, this variable contains the contents of the
&'Reply-To:'& header line if one exists and it is not empty, or otherwise the
-contents of the &'From:'& header line.
+contents of the &'From:'& header line. Apart from the removal of leading
+white space, the value is not processed in any way. In particular, no RFC 2047
+decoding or character code translation takes place.
.vitem &$return_path$&
.cindex "&$return_path$&"
the verified host name or to the host's IP address in square brackets.
.vitem &$sender_helo_name$&
-.cindex "&$sender_hslo_name$&"
+.cindex "&$sender_helo_name$&"
When a message is received from a remote host that has issued a HELO or EHLO
command, the argument of that command is placed in this variable. It is also
set if HELO or EHLO is used when a message is received using SMTP locally via
DNS timeout), &$host_lookup_deferred$& is set to &"1"&, and
&$host_lookup_failed$& remains set to &"0"&.
+.new
Once &$host_lookup_failed$& is set to &"1"&, Exim does not try to look up the
host name again if there is a subsequent reference to &$sender_host_name$&
-in the same Exim process, but it does try again if &$sender_host_deferred$&
+in the same Exim process, but it does try again if &$host_lookup_deferred$&
is set to &"1"&.
+.wen
Exim does not automatically look up every calling host's name. If you want
maximum efficiency, you should arrange your configuration so that it avoids
been received locally, this variable contains the login name of the user that
called Exim.
-.new
.vitem &$sender_rate_$&&'xxx'&
A number of variables whose names begin &$sender_rate_$& are set as part of the
&%ratelimit%& ACL condition. Details are given in section
&<<SECTratelimiting>>&.
-.wen
.vitem &$sender_rcvhost$&
.cindex "DNS" "reverse lookup"
&$smtp_active_hostname$& is saved with any message that is received, so its
value can be consulted during routing and delivery.
-.new
.vitem &$smtp_command$&
.cindex "&$smtp_command$&"
During the processing of an incoming SMTP command, this variable contains the
command, the address in &$smtp_command$& is the original address before any
rewriting, whereas the values in &$local_part$& and &$domain$& are taken from
the address after SMTP-time rewriting.
-.wen
.vitem &$smtp_command_argument$&
-.new
.cindex "SMTP command" "argument for"
.cindex "&$smtp_command_argument$&"
While an ACL is running to check an SMTP command, this variable contains the
argument, that is, the text that follows the command name, with leading white
space removed. Following the introduction of &$smtp_command$&, this variable is
somewhat redundant, but is retained for backwards compatibility.
-.wen
.vitem "&$sn0$& &-- &$sn9$&"
These variables are copies of the values of the &$n0$& &-- &$n9$& accumulators
This variable is set only during the creation of a message warning about a
delivery delay. Details of its use are explained in section &<<SECTcustwarn>>&.
.endlist
+.ecindex IIDstrexp
. ////////////////////////////////////////////////////////////////////////////
.chapter "Embedded Perl" "CHAPperl"
-.cindex "Perl" "calling from Exim"
+.scindex IIDperl "Perl" "calling from Exim"
Exim can be built to include an embedded Perl interpreter. When this is done,
Perl subroutines can be called as part of the string expansion process. To make
use of the Perl support, you need version 5.004 or later of Perl installed on
example, the code for the subroutine is empty, so it does nothing, but you can
include any Perl code that you like. The text of the &%warn%& message is passed
as the first subroutine argument.
-
+.ecindex IIDperl
. ////////////////////////////////////////////////////////////////////////////
.section "IPv6 address scopes"
+.cindex "IPv6" "address scopes"
IPv6 addresses have &"scopes"&, and a host with multiple hardware interfaces
can, in principle, have the same link-local IPv6 address on different
interfaces. Thus, additional information is needed, over and above the IP
function.) Of course, this means that the additional functionality of
&[getaddrinfo()]& &-- recognizing scoped addresses &-- is lost.
+.section "Disabling IPv6"
+.cindex "IPv6" "disabling"
+Sometimes it happens that an Exim binary that was compiled with IPv6 support is
+run on a host whose kernel does not support IPv6. The binary will fall back to
+using IPv4, but it may waste resources looking up AAAA records, and trying to
+connect to IPv6 addresses, causing delays to mail delivery. If you set the
+.oindex "&%disable_ipv6%&"
+&%disable_ipv6%& option true, even if the Exim binary has IPv6 support, no IPv6
+activities take place. AAAA records are never looked up, and any IPv6 addresses
+that are listed in &%local_interfaces%&, data for the &(manualroute)& router,
+etc. are ignored. If IP literals are enabled, the &(ipliteral)& router declines
+to handle IPv6 literal addresses.
+
+On the other hand, when IPv6 is in use, there may be times when you want to
+disable it for certain hosts or domains. You can use the &%dns_ipv4_lookup%&
+option to globally suppress the lookup of AAAA records for specified domains,
+and you can use the &%ignore_target_hosts%& generic router option to ignore
+IPv6 addresses in an individual router.
+
.section "Examples of starting a listening daemon"
. ////////////////////////////////////////////////////////////////////////////
.chapter "Main configuration" "CHAPmainconfig"
-.cindex "configuration file" "main section"
-.cindex "main configuration"
+.scindex IIDconfima "configuration file" "main section"
+.scindex IIDmaiconf "main configuration"
The first part of the run time configuration file contains three types of item:
.ilist
.section "Miscellaneous"
.table2
.row &%bi_command%& "to run for &%-bi%& command line option"
+.row &%disable_ipv6%& "do no IPv6 processing"
.row &%keep_malformed%& "for broken files &-- should not happen"
.row &%localhost_number%& "for unique message ids in clusters"
.row &%message_body_visible%& "how much to show in &$message_body$&"
.table2
.row &%acl_not_smtp%& "ACL for non-SMTP messages"
.row &%acl_not_smtp_mime%& "ACL for non-SMTP MIME parts"
+.new
+.row &%acl_not_smtp_start%& "ACL for start of non-SMTP message"
+.wen
.row &%acl_smtp_auth%& "ACL for AUTH"
.row &%acl_smtp_connect%& "ACL for connection"
.row &%acl_smtp_data%& "ACL for DATA"
.row &%check_rfc2047_length%& "check length of RFC 2047 &""encoded &&&
words""&"
.row &%delivery_date_remove%& "from incoming messages"
-.row &%envelope_to_remote%& "from incoming messages"
+.row &%envelope_to_remove%& "from incoming messages"
.row &%extract_addresses_remove_arguments%& "affects &%-t%& processing"
.row &%headers_charset%& "default for translations"
.row &%qualify_domain%& "default for senders"
.section "Routing and delivery"
.table2
+.row &%disable_ipv6%& "do no IPv6 processing"
.row &%dns_again_means_nonexist%& "for broken domains"
.row &%dns_check_names_pattern%& "pre-DNS syntax check"
.row &%dns_ipv4_lookup%& "only v4 lookup for these domains"
.option acl_not_smtp main string&!! unset
.cindex "&ACL;" "for non-SMTP messages"
.cindex "non-SMTP messages" "ACLs for"
-This option defines the ACL that is run when a non-SMTP message is on the point
-of being accepted. See chapter &<<CHAPACL>>& for further details.
+This option defines the ACL that is run when a non-SMTP message has been
+read and is on the point of being accepted. See chapter &<<CHAPACL>>& for
+further details.
-.new
.option acl_not_smtp_mime main string&!! unset
This option defines the ACL that is run for individual MIME parts of non-SMTP
messages. It operates in exactly the same way as &%acl_smtp_mime%& operates for
SMTP messages.
+
+.new
+.option acl_not_smtp_start main string&!! unset
+.cindex "&ACL;" "at start of non-SMTP message"
+.cindex "non-SMTP messages" "ACLs for"
+This option defines the ACL that is run before Exim starts reading a
+non-SMTP message. See chapter &<<CHAPACL>>& for further details.
.wen
.option acl_smtp_auth main string&!! unset
.option admin_groups main "string list&!!" unset
.cindex "admin user"
-.new
This option is expanded just once, at the start of Exim's processing. If the
current group or any of the supplementary groups of an Exim caller is in this
colon-separated list, the caller has admin privileges. If all your system
admin privileges by putting that group in &%admin_groups%&. However, this does
not permit them to read Exim's spool files (whose group owner is the Exim gid).
To permit this, you have to add individuals to the Exim group.
-.wen
.option allow_domain_literals main boolean false
.cindex "domain literal"
.option auto_thaw main time 0s
-.new
.cindex "thawing messages"
.cindex "unfreezing messages"
If this option is set to a time greater than zero, a queue runner will try a
&*Note*&: This is an old option, which predates &%timeout_frozen_after%& and
&%ignore_bounce_errors_after%&. It is retained for compatibility, but it is not
thought to be very useful any more, and its use should probably be avoided.
-.wen
.option av_scanner main string "see below"
This option is available if Exim is built with the content-scanning extension.
.option bounce_return_body main boolean true
.cindex "bounce message" "including body"
This option controls whether the body of an incoming message is included in a
-bounce message when &%bounce_return_message%& is true. If it is not set, only
-the message header is included.
+bounce message when &%bounce_return_message%& is true. The default setting
+causes the entire message, both header and body, to be returned (subject to the
+value of &%bounce_return_size_limit%&). If this option is false, only the
+message header is included. In the case of a non-SMTP message containing an
+error that is detected during reception, only those header lines preceding the
+point at which the error was detected are returned.
.cindex "bounce message" "including original"
.option bounce_return_message main boolean true
-If this option is set false, the original message is not included in bounce
-messages generated by Exim. See also &%bounce_return_size_limit%&.
+If this option is set false, none of the original message is included in
+bounce messages generated by Exim. See also &%bounce_return_size_limit%& and
+&%bounce_return_body%&.
.option bounce_return_size_limit main integer 100K
listens. See chapter &<<CHAPinterfaces>>& for details of how it is used. For
backward compatibility, &%daemon_smtp_port%& (singular) is a synonym.
-.new
.option daemon_startup_retries main integer 9
.cindex "daemon startup" "retrying"
This option, along with &%daemon_startup_sleep%&, controls the retrying done by
.option daemon_startup_sleep main time 30s
See &%daemon_startup_retries%&.
-.wen
.option delay_warning main "time list" 24h
.cindex "warning of delay"
expansion. Otherwise &$domain$& is empty. If the result of the expansion is a
forced failure, an empty string, or a string matching any of &"0"&, &"no"& or
&"false"& (the comparison being done caselessly) then the warning message is
-not sent. The default is
+not sent. The default is:
+.new
.code
-delay_warning_condition = \
- ${if match{$h_precedence:}{(?i)bulk|list|junk}{no}{yes}}
+delay_warning_condition = ${if or {\
+ { !eq{$h_list-id:$h_list-post:$h_list-subscribe:}{} }\
+ { match{$h_precedence:}{(?i)bulk|list|junk} }\
+ { match{$h_auto-submitted:}{(?i)auto-generated|auto-replied} }\
+ } {no}{yes}}
.endd
-which suppresses the sending of warnings about messages that have &"bulk"&,
-&"list"& or &"junk"& in a &'Precedence:'& header.
+This suppresses the sending of warnings for messages that contain &'List-ID:'&,
+&'List-Post:'&, or &'List-Subscribe:'& headers, or have &"bulk"&, &"list"& or
+&"junk"& in a &'Precedence:'& header, or have &"auto-generated"& or
+&"auto-replied"& in an &'Auto-Submitted:'& header.
+.wen
.option deliver_drop_privilege main boolean false
.cindex "unprivileged delivery"
removed at the time the message is received, to avoid any problems that might
occur when a delivered message is subsequently sent on to some other recipient.
+
+.option disable_ipv6 main boolean false
+.cindex "IPv6" "disabling"
+If this option is set true, even if the Exim binary has IPv6 support, no IPv6
+activities take place. AAAA records are never looked up, and any IPv6 addresses
+that are listed in &%local_interfaces%&, data for the &%manualroute%& router,
+etc. are ignored. If IP literals are enabled, the &(ipliteral)& router declines
+to handle IPv6 literal addresses.
+
+
.option dns_again_means_nonexist main "domain list&!!" unset
.cindex "DNS" "&""try again""& response; overriding"
DNS lookups give a &"try again"& response for the DNS errors
.code
dns_again_means_nonexist = *.in-addr.arpa
.endd
-This option applies to all DNS lookups that Exim does. The &(dnslookup)& router
-has some options of its own for controlling what happens when lookups for MX or
-SRV records give temporary errors. These more specific options are applied
-after the global option.
+This option applies to all DNS lookups that Exim does. It also applies when the
+&[gethostbyname()]& or &[getipnodebyname()]& functions give temporary errors,
+since these are most likely to be caused by DNS lookup problems. The
+&(dnslookup)& router has some options of its own for controlling what happens
+when lookups for MX or SRV records give temporary errors. These more specific
+options are applied after this global option.
.option dns_check_names_pattern main string "see below"
.cindex "DNS" "pre-check of name syntax"
When this option is set to a non-empty string, it causes Exim to check domain
-names for illegal characters before handing them to the DNS resolver, because
-some resolvers give temporary errors for malformed names. If a domain name
-contains any illegal characters, a &"not found"& result is forced, and the
-resolver is not called. The check is done by matching the domain name against a
-regular expression, which is the value of this option. The default pattern is
+names for characters that are not allowed in host names before handing them to
+the DNS resolver, because some resolvers give temporary errors for names that
+contain unusual characters. If a domain name contains any unwanted characters,
+a &"not found"& result is forced, and the resolver is not called. The check is
+done by matching the domain name against a regular expression, which is the
+value of this option. The default pattern is
.code
dns_check_names_pattern = \
- (?i)^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$
+ (?i)^(?>(?(1)\.|())[^\W_](?>[a-z0-9/-]*[^\W_])?)+$
.endd
-which permits only letters, digits, and hyphens in components, but they may not
-start or end with a hyphen.
-If you set &%allow_utf8_domains%&, you must modify this pattern, or set the
-option to an empty string.
+which permits only letters, digits, slashes, and hyphens in components, but
+they must start and end with a letter or digit. Hyphens are not, in fact,
+permitted in host names, but they are found in certain NS records (which can be
+accessed in Exim by using a &%dnsdb%& lookup). If you set
+&%allow_utf8_domains%&, you must modify this pattern, or set the option to an
+empty string.
-.new
.option dns_csa_search_limit main integer 5
This option controls the depth of parental searching for CSA SRV records in the
DNS, as described in more detail in section &<<SECTverifyCSA>>&.
This option controls whether or not an IP address, given as a CSA domain, is
reversed and looked up in the reverse DNS, as described in more detail in
section &<<SECTverifyCSA>>&.
-.wen
.option dns_ipv4_lookup main "domain list&!!" unset
.cindex "IPv6" "DNS lookup for AAAA records"
.cindex "DNS" "IPv6 lookup for AAAA records"
-When Exim is compiled with IPv6 support, it looks for IPv6 address records
-(AAAA and, if configured, A6) as well as IPv4 address records when trying to
-find IP addresses for hosts, unless the host's domain matches this list.
+When Exim is compiled with IPv6 support and &%disable_ipv6%& is not set, it
+looks for IPv6 address records (AAAA records) as well as IPv4 address records
+(A records) when trying to find IP addresses for hosts, unless the host's
+domain matches this list.
This is a fudge to help with name servers that give big delays or otherwise do
-not work for the new IPv6 record types. If Exim is handed an IPv6 address
-record as a result of an MX lookup, it always recognizes it, and may as a
-result make an outgoing IPv6 connection. All this option does is to make Exim
-look only for IPv4-style A records when it needs to find an IP address for a
-host name. In due course, when the world's name servers have all been upgraded,
-there should be no need for this option.
+not work for the AAAA record type. In due course, when the world's name
+servers have all been upgraded, there should be no need for this option.
.option dns_retrans main time 0s
.option errors_reply_to main string unset
.cindex "bounce message" "&'Reply-to:'& in"
-Exim's bounce and delivery warning messages contain the header line
+By default, Exim's bounce and delivery warning messages contain the header line
.display
&`From: Mail Delivery System <Mailer-Daemon@`&&'qualify-domain'&&`>`&
.endd
+.oindex &%quota_warn_message%&
where &'qualify-domain'& is the value of the &%qualify_domain%& option.
+A warning message that is generated by the &%quota_warn_message%& option in an
+&(appendfile)& transport may contain its own &'From:'& header line that
+overrides the default.
+
Experience shows that people reply to bounce messages. If the
&%errors_reply_to%& option is set, a &'Reply-To:'& header is added to bounce
and warning messages. For example:
errors_reply_to = postmaster@my.domain.example
.endd
The value of the option is not expanded. It must specify a valid RFC 2822
-address.
+address. However, if a warning message that is generated by the
+&%quota_warn_message%& option in an &(appendfile)& transport contain its
+own &'Reply-To:'& header line, the value of the &%errors_reply_to%& option is
+not used.
.option exim_group main string "compile-time configured"
.option helo_try_verify_hosts main "host list&!!" unset
-.new
.cindex "HELO verifying" "optional"
.cindex "EHLO verifying" "optional"
By default, Exim just checks the syntax of HELO and EHLO commands (see
rejected with a 550 error, and entries are written to the main and reject logs.
If a MAIL command is received before EHLO or HELO, it is rejected with a 503
error.
-.wen
.option hold_domains main "domain list&!!" unset
.cindex "domain" "delaying delivery"
.option max_username_length main integer 0
-.cindex "length of login name"
+.cindex "length" "of login name"
.cindex "user name" "maximum length"
.cindex "limit" "user name length"
Some operating systems are broken in that they truncate long arguments to
.option never_users main "string list&!!" unset
-.new
This option is expanded just once, at the start of Exim's processing. Local
message deliveries are normally run in processes that are setuid to the
recipient, and remote deliveries are normally run under Exim's own uid and gid.
It is usually desirable to prevent any deliveries from running as root, as a
safety precaution.
-.wen
When Exim is built, an option called FIXED_NEVER_USERS can be set to a
list of users that must not be used for local deliveries. This list is fixed in
is set, code values of 128 and above are also considered to be printing
characters.
+This option also affects the header syntax checks performed by the
+&(autoreply)& transport, and whether Exim uses RFC 2047 encoding of
+the user's full name when constructing From: and Sender: addresses (as
+described in section &<<SECTconstr>>&). Setting this option can cause
+Exim to generate eight bit message headers that do not conform to the
+standards.
+
.option process_log_path main string unset
.cindex "process log path"
If this option is set, queue runs happen in order of message arrival instead of
in an arbitrary order. For this to happen, a complete list of the entire queue
must be set up before the deliveries start. When the queue is all held in a
-single directory (the default),
-
-a single list is created for both the ordered and the non-ordered cases.
-However, if &%split_spool_directory%& is set, a single list is not created when
-&%queue_run_in_order%& is false. In this case, the sub-directories are
-processed one at a time (in a random order), and this avoids setting up one
-huge list for the whole queue. Thus, setting &%queue_run_in_order%& with
-&%split_spool_directory%& may degrade performance when the queue is large,
-because of the extra work in setting up the single, large list. In most
-situations, &%queue_run_in_order%& should not be set.
+single directory (the default), a single list is created for both the ordered
+and the non-ordered cases. However, if &%split_spool_directory%& is set, a
+single list is not created when &%queue_run_in_order%& is false. In this case,
+the sub-directories are processed one at a time (in a random order), and this
+avoids setting up one huge list for the whole queue. Thus, setting
+&%queue_run_in_order%& with &%split_spool_directory%& may degrade performance
+when the queue is large, because of the extra work in setting up the single,
+large list. In most situations, &%queue_run_in_order%& should not be set.
however, interlock with other processes, so additional queue runners can be
started by other means, or by killing and restarting the daemon.
-.new
Setting this option to zero does not suppress queue runs; rather, it disables
the limit, allowing any number of simultaneous queue runner processes to be
run. If you do not want queue runs to occur, omit the &%-q%&&'xx'& setting on
the daemon's command line.
-.wen
.option queue_smtp_domains main "domain list&!!" unset
.cindex "queueing incoming messages"
&"Received:"& and conform to the RFC 2822 specification for &'Received:'&
header lines. The default setting is:
-.new
.code
received_header_text = Received: \
${if def:sender_rcvhost {from $sender_rcvhost\n\t}\
{${if def:sender_ident \
- {from ${quote_local_part: $sender_ident} }}\
+ {from ${quote_local_part:$sender_ident} }}\
${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
by $primary_hostname \
${if def:received_protocol {with $received_protocol}} \
id $message_exim_id\
${if def:received_for {\n\tfor $received_for}}
.endd
-.wen
The reference to the TLS cipher is omitted when Exim is built without TLS
support. The use of conditional expansions ensures that this works for both
Chapter &<<CHAPretry>>& describes Exim's mechanisms for controlling the
intervals between delivery attempts for messages that cannot be delivered
straight away. This option sets an overall limit to the length of time between
-retries.
+retries. It cannot be set greater than 24 hours; any attempt to do so forces
+the default value.
.option return_path_remove main boolean true
RFC 1413 identification calls are made to any client host which matches an item
in the list.
-
-.option rfc1413_query_timeout main time 30s
+.option rfc1413_query_timeout main time 5s
.cindex "RFC 1413" "query timeout"
.cindex "timeout" "for RFC 1413 call"
This sets the timeout on RFC 1413 identification calls. If it is set to zero,
can send them messages, and the rate at which an individual message can specify
recipients.
-.new
Exim has two rate-limiting facilities. This section describes the older
facility, which can limit rates within a single connection. The newer
&%ratelimit%& ACL condition can limit rates across all connections. See section
&<<SECTratelimiting>>& for details of the newer facility.
-.wen
When a host matches &%smtp_ratelimit_hosts%&, the values of
&%smtp_ratelimit_mail%& and &%smtp_ratelimit_rcpt%& are used to control the
By using this option to override the compiled-in path, it is possible to run
tests of Exim without using the standard spool.
-.new
.option sqlite_lock_timeout main time 5s
.cindex "sqlite" "lock timeout"
This option controls the timeout that the &(sqlite)& lookup uses when trying to
access an SQLite database. See section &<<SECTsqlite>>& for more details.
-.wen
.option strip_excess_angle_brackets main boolean false
.cindex "angle brackets" "excess"
.option tls_privatekey main string&!! unset
.cindex "TLS" "server private key; location of"
The value of this option is expanded, and must then be the absolute path to a
-file which contains the server's private key. If this option is unset, the
-private key is assumed to be in the same file as the server's certificates. See
-chapter &<<CHAPTLS>>& for further details.
+file which contains the server's private key. If this option is unset, or if
+the expansion is forced to fail, or the result is an empty string, the private
+key is assumed to be in the same file as the server's certificates. See chapter
+&<<CHAPTLS>>& for further details.
.option tls_remember_esmtp main boolean false
.option trusted_groups main "string list&!!" unset
.cindex "trusted group"
.cindex "group" "trusted"
-.new
This option is expanded just once, at the start of Exim's processing. If this
option is set, any process that is running in one of the listed groups, or
which has one of them as a supplementary group, is trusted. The groups can be
details of what trusted callers are permitted to do. If neither
&%trusted_groups%& nor &%trusted_users%& is set, only root and the Exim user
are trusted.
-.wen
.option trusted_users main "string list&!!" unset
.cindex "trusted user"
.cindex "user" "trusted"
-.new
This option is expanded just once, at the start of Exim's processing. If this
option is set, any process that is running as one of the listed users is
trusted. The users can be specified numerically or by name. See section
&<<SECTtrustedadmin>>& for details of what trusted callers are permitted to do.
If neither &%trusted_groups%& nor &%trusted_users%& is set, only root and the
Exim user are trusted.
-.wen
.option unknown_login main string&!! unset
.cindex "uid (user id)" "unknown caller"
.cindex "reject log" "disabling"
If this option is set false, Exim no longer writes anything to the reject log.
See chapter &<<CHAPlog>>& for details of what Exim writes to its logs.
+.ecindex IIDconfima
+.ecindex IIDmaiconf
. ////////////////////////////////////////////////////////////////////////////
.chapter "Generic options for routers" "CHAProutergeneric"
-.cindex "options" "generic; for routers"
-.cindex "generic options" "router"
+.scindex IIDgenoprou1 "options" "generic; for routers"
+.scindex IIDgenoprou2 "generic options" "router"
This chapter describes the generic options that apply to all routers.
Those that are preconditions are marked with ‡ in the &"use"& field.
.option address_data routers string&!! unset
.cindex "router" "data attached to address"
-.new
The string is expanded just before the router is run, that is, after all the
precondition tests have succeeded. If the expansion is forced to fail, the
router declines, the value of &%address_data%& remains unchanged, and the
&%more%& option controls what happens next. Other expansion failures cause
delivery of the address to be deferred.
-.wen
.cindex "&$address_data$&"
When the expansion succeeds, the value is retained with the address, and can be
routed because Exim has run out of routers. The default message is
&"Unrouteable address"&. This option is useful only on routers that have
&%more%& set false, or on the very last router in a configuration, because the
-value that is used is taken from the last router that is considered. &new("This
+value that is used is taken from the last router that is considered. This
includes a router that is skipped because its preconditions are not met, as
-well as a router that declines.") For example, using the default configuration,
+well as a router that declines. For example, using the default configuration,
you could put:
.code
cannot_route_message = Remote domain not found in DNS
.option errors_to routers string&!! unset
.cindex "envelope sender"
.cindex "router" "changing address for errors"
-If a router successfully handles an address, it may queue the address for
-delivery or it may generate child addresses. In both cases, if there is a
-delivery problem during later processing, the resulting bounce message is sent
-to the address that results from expanding this string, provided that the
-address verifies successfully. &%errors_to%& is expanded before
-&%headers_add%&, &%headers_remove%&, and &%transport%&.
-
-If the option is unset, or the expansion is forced to fail, or the result of
+If a router successfully handles an address, it may assign the address to a
+transport for delivery or it may generate child addresses. In both cases, if
+there is a delivery problem during later processing, the resulting bounce
+message is sent to the address that results from expanding this string,
+provided that the address verifies successfully. The &%errors_to%& option is
+expanded before &%headers_add%&, &%headers_remove%&, and &%transport%&.
+
+The &%errors_to%& setting associated with an address can be overridden if it
+subsequently passes through other routers that have their own &%errors_to%&
+settings, or if the message is delivered by a transport with a &%return_path%&
+setting.
+
+If &%errors_to%& is unset, or the expansion is forced to fail, or the result of
the expansion fails to verify, the errors address associated with the incoming
address is used. At top level, this is the envelope sender. A non-forced
expansion failure causes delivery to be deferred.
If an address for which &%errors_to%& has been set ends up being delivered over
SMTP, the envelope sender for that delivery is the &%errors_to%& value, so that
any bounces that are generated by other MTAs on the delivery route are also
-sent there. The most common use of &%errors_to%& is probably to direct mailing
-list bounces to the manager of the list, as described in section
-&<<SECTmailinglists>>&.
-
-The &%errors_to%& setting associated with an address can be overridden if it
-subsequently passes through other routers that have their own &%errors_to%&
-settings,
-or if it is delivered by a transport with a &%return_path%& setting.
-
-You can set &%errors_to%& to the empty string by either of these settings:
+sent there. You can set &%errors_to%& to the empty string by either of these
+settings:
.code
errors_to =
-errors_to =
+errors_to = ""
.endd
An expansion item that yields an empty string has the same effect. If you do
this, a locally detected delivery error for addresses processed by this router
path in &$address_data$& in the router, and reinstate it in the transport by
setting &%return_path%&.
+The most common use of &%errors_to%& is to direct mailing list bounces to the
+manager of the list, as described in section &<<SECTmailinglists>>&, or to
+implement VERP (Variable Envelope Return Paths) (see section &<<SECTverp>>&).
+
.option expn routers&!? boolean true
.option fallback_hosts routers "string list" unset
-.new
.cindex "router" "fallback hosts"
.cindex "fallback" "hosts specified on router"
String expansion is not applied to this option. The argument must be a
each name or address. In fact, the format of each item is exactly the same as
defined for the list of hosts in a &(manualroute)& router (see section
&<<SECTformatonehostitem>>&).
-.wen
If a router queues an address for a remote transport, this host list is
associated with the address, and used instead of the transport's fallback host
.option headers_add routers string&!! unset
-.new
.cindex "header lines" "adding"
.cindex "router" "adding header lines"
This option specifies a string of text that is expanded at routing time, and
message is in the process of being transported. This means that references to
header lines in string expansions in the transport's configuration do not
&"see"& the added header lines.
-.wen
The &%headers_add%& option is expanded after &%errors_to%&, but before
&%headers_remove%& and &%transport%&. If the expanded string is empty, or if
&*Warning 1*&: The &%headers_add%& option cannot be used for a &(redirect)&
router that has the &%one_time%& option set.
-.new
&*Warning 2*&: If the &%unseen%& option is set on the router, all header
additions are deleted when the address is passed on to subsequent routers.
-.wen
.option headers_remove routers string&!! unset
-.new
.cindex "header lines" "removing"
.cindex "router" "removing header lines"
This option specifies a string of text that is expanded at routing time, and
the message is in the process of being transported. This means that references
to header lines in string expansions in the transport's configuration still
&"see"& the original header lines.
-.wen
The &%headers_remove%& option is expanded after &%errors_to%& and
&%headers_add%&, but before &%transport%&. If the expansion is forced to fail,
&*Warning 1*&: The &%headers_remove%& option cannot be used for a &(redirect)&
router that has the &%one_time%& option set.
-.new
&*Warning 2*&: If the &%unseen%& option is set on the router, all header
removal requests are deleted when the address is passed on to subsequent
routers.
-.wen
.option ignore_target_hosts routers "host list&!!" unset
Similarly, if &%ignore_target_hosts%& is set on an &(ipliteral)& router, the
router declines if presented with one of the listed addresses.
-.new
You can use this option to disable the use of IPv4 or IPv6 for mail delivery by
means of the first or the second of the following settings, respectively:
.code
.endd
The pattern in the first line matches all IPv4 addresses, whereas the pattern
in the second line matches all IPv6 addresses.
-.wen
This option may also be useful for ignoring link-local and site-local IPv6
addresses. Because, like all host lists, the value of &%ignore_target_hosts%&
Wildcarding can be used to set up multiple user mailboxes, as described in
section &<<SECTmulbox>>&.
-.new
.cindex "&$local_part$&"
.cindex "&$local_part_prefix$&"
During the testing of the &%local_parts%& option, and while the router is
behaviour of the router. If the callout feature of verification is in use, this
means that the full address, including the prefix, will be used during the
callout.
-.wen
The prefix facility is commonly used to handle local parts of the form
&%owner-something%&. Another common use is to support local parts of the form
deliveries stand out more visibly from remote ones. In the &"local"& style, the
recipient address is given just as the local part, without a domain. The use of
this style is controlled by this option. It defaults to true for the &(accept)&
-router, and false for all the others. &new("This option applies only when a
+router, and false for all the others. This option applies only when a
router assigns an address to a transport. It has no effect on routers that
-redirect addresses.")
+redirect addresses.
does not affect the behaviour if one of the precondition tests fails. In that
case, the address is always passed to the next router.
-.new
Note that &%address_data%& is not considered to be a precondition. If its
expansion is forced to fail, the router declines, and the value of &%more%&
controls what happens next.
-.wen
.option pass_on_timeout routers boolean false
While the router is running, &%router_home_directory%& overrides the value of
&$home$& that came from &%check_local_user%&.
-When a router accepts an address and routes it to a transport (including the
-cases when a redirect router generates a pipe, file, or autoreply delivery),
-the home directory setting for the transport is taken from the first of these
-values that is set:
+When a router accepts an address and assigns it to a local transport (including
+the cases when a &(redirect)& router generates a pipe, file, or autoreply
+delivery), the home directory setting for the transport is taken from the first
+of these values that is set:
.ilist
The &%home_directory%& option on the transport;
the value of &%unseen%& contains expansion items (and therefore, presumably, is
sometimes true and sometimes false).
-.new
.cindex "copy of message (&%unseen%& option)"
The &%unseen%& option can be used to cause copies of messages to be delivered
to some other destination, while also carrying out a normal delivery. In
one that is delivered as specified by this router, and a clone that goes on to
be routed further. For this reason, &%unseen%& may not be combined with the
&%one_time%& option in a &(redirect)& router.
-.wen
&*Warning*&: Header lines added to the address (or specified for removal) by
this router or by previous routers affect the &"unseen"& copy of the message
or testing sender verification using &%-bvs%&.
See section &<<SECTrouprecon>>& for a list of the order in which preconditions
are evaluated.
+.ecindex IIDgenoprou1
+.ecindex IIDgenoprou2
. ////////////////////////////////////////////////////////////////////////////
.chapter "The dnslookup router" "CHAPdnslookup"
-.cindex "&(dnslookup)& router"
-.cindex "routers" "&(dnslookup)&"
+.scindex IIDdnsrou1 "&(dnslookup)& router"
+.scindex IIDdnsrou2 "routers" "&(dnslookup)&"
The &(dnslookup)& router looks up the hosts that handle mail for the
recipient's domain in the DNS. A transport must always be set for this router,
unless &%verify_only%& is set.
&'klingon.dictionary.fict.example'& is looked up, and if this fails,
&'klingon.dictionary.ref.example'& is tried. Note that the &%qualify_single%&
and &%search_parents%& options can cause some widening to be undertaken inside
-the DNS resolver. &new("&%widen_domains%& is not applied to sender addresses
-when verifying, unless &%rewrite_headers%& is false (not the default).")
+the DNS resolver. &%widen_domains%& is not applied to sender addresses
+when verifying, unless &%rewrite_headers%& is false (not the default).
.section "Effect of qualify_single and search_parents"
.endd
that may happen while processing a router precondition before the router is
entered. No widening ever takes place for these lookups.
+.ecindex IIDdnsrou1
+.ecindex IIDdnsrou2
This router has no private options. Unless it is being used purely for
verification (see &%verify_only%&) a transport is required to be defined by the
generic &%transport%& option. The router accepts the address if its domain part
-takes the form of an RFC 2822 domain literal, that is, an IP address enclosed
-in square brackets. For example, the &(ipliteral)& router handles the address
+takes the form of an RFC 2822 domain literal. For example, the &(ipliteral)&
+router handles the address
.code
root@[192.168.1.1]
.endd
-by setting up delivery to the host with that IP address.
+by setting up delivery to the host with that IP address. IPv4 domain literals
+consist of an IPv4 address enclosed in square brackets. IPv6 domain literals
+are similar, but the address is preceded by &`ipv6:`&. For example:
+.code
+postmaster@[ipv6:fe80::a00:20ff:fe86:a061.5678]
+.endd
+Exim allows &`ipv4:`& before IPv4 addresses, for consistency, and on the
+grounds that sooner or later somebody will try it.
.cindex "&%self%& option" "in &(ipliteral)& router"
If the IP address matches something in &%ignore_target_hosts%&, the router
. ////////////////////////////////////////////////////////////////////////////
.chapter "The manualroute router"
-.cindex "&(manualroute)& router"
-.cindex "routers" "&(manualroute)&"
+.scindex IIDmanrou1 "&(manualroute)& router"
+.scindex IIDmanrou2 "routers" "&(manualroute)&"
.cindex "domain" "manually routing"
The &(manualroute)& router is so-called because it provides a way of manually
routing an address according to its domain. It is mainly used when you want to
.section "Format of the list of hosts"
-.new
A list of hosts, whether obtained via &%route_data%& or &%route_list%&, is
always separately expanded before use. If the expansion fails, the router
declines. The result of the expansion must be a colon-separated list of names
and/or IP addresses, optionally also including ports. The format of each item
in the list is described in the next section. The list separator can be changed
as described in section &<<SECTlistconstruct>>&.
-.wen
If the list of hosts was obtained from a &%route_list%& item, the following
variables are set during its expansion:
.section "Format of one host item" "SECTformatonehostitem"
-.new
Each item in the list of hosts is either a host name or an IP address,
optionally with an attached port number. When no port is given, an IP address
is not enclosed in brackets. When a port is specified, it overrides the port
route_list = * "</ [10.1.1.1]:1225 / [::1]:1226"
.endd
.endlist
-.wen
.section "How the list of hosts is used" "SECThostshowused"
When an address is routed to an &(smtp)& transport by &(manualroute)&, each of
.code
route_list = * x.y.z:p.q.r/MX:e.f.g
.endd
-.new
If this feature is used with a port specifier, the port must come last. For
example:
.code
route_list = * dom1.tld/mx::1225
.endd
-.wen
If the &%hosts_randomize%& option is set, the order of the items in the list is
randomized before any lookups are done. Exim then scans the list; for any name
that is not followed by &`/MX`& it looks up an IP address. If this turns out to
makes clear the distinction between the domain name
&'darksite.ethereal.example'& and the UUCP host name &'darksite'&.
.endlist
+.ecindex IIDmanrou1
+.ecindex IIDmanrou2
. ////////////////////////////////////////////////////////////////////////////
.chapter "The queryprogram router" "CHAPdriverlast"
-.cindex "&(queryprogram)& router"
-.cindex "routers" "&(queryprogram)&"
+.scindex IIDquerou1 "&(queryprogram)& router"
+.scindex IIDquerou2 "routers" "&(queryprogram)&"
.cindex "routing" "by external program"
The &(queryprogram)& router routes an address by running an external command
and acting on its output. This is an expensive way to route, and is intended
.option command_group queryprogram string unset
.cindex "gid (group id)" "in &(queryprogram)& router"
-This option specifies a gid to be set when running the command. It must be set
-if &%command_user%& specifies a numerical uid. If it begins with a digit, it is
-interpreted as the numerical value of the gid. Otherwise it is looked up using
-&[getgrnam()]&.
+This option specifies a gid to be set when running the command while routing an
+address for deliver. It must be set if &%command_user%& specifies a numerical
+uid. If it begins with a digit, it is interpreted as the numerical value of the
+gid. Otherwise it is looked up using &[getgrnam()]&.
.option command_user queryprogram string unset
.cindex "uid (user id)" "for &(queryprogram)&"
This option must be set. It specifies the uid which is set when running the
-command. If it begins with a digit it is interpreted as the numerical value of
-the uid. Otherwise, it is looked up using &[getpwnam()]& to obtain a value for
-the uid and, if &%command_group%& is not set, a value for the gid also.
+command while routing an address for delivery. If the value begins with a digit,
+it is interpreted as the numerical value of the uid. Otherwise, it is looked up
+using &[getpwnam()]& to obtain a value for the uid and, if &%command_group%& is
+not set, a value for the gid also.
+
+&*Warning:*& Changing uid and gid is possible only when Exim is running as
+root, which it does during a normal delivery in a conventional configuration.
+However, when an address is being verified during message reception, Exim is
+usually running as the Exim user, not as root. If the &(queryprogram)& router
+is called from a non-root process, Exim cannot change uid or gid before running
+the command. In this circumstance the command runs under the current uid and
+gid.
.option current_directory queryprogram string /
.endd
routes the address to the default transport, passing a list of two hosts. When
the transport runs, the string &"rule1"& is in &$address_data$&.
+.ecindex IIDquerou1
+.ecindex IIDquerou2
. ////////////////////////////////////////////////////////////////////////////
.chapter "The redirect router" "CHAPredirect"
-.cindex "&(redirect)& router"
-.cindex "routers" "&(redirect)&"
+.scindex IIDredrou1 "&(redirect)& router"
+.scindex IIDredrou2 "routers" "&(redirect)&"
.cindex "alias file" "in a &(redirect)& router"
.cindex "address redirection" "&(redirect)& router"
The &(redirect)& router handles several kinds of address redirection. Its most
.ilist
When Exim is receiving an incoming SMTP message from a remote host, it is
-running under the Exim uid, not as root.
-No additional groups are set up, even if the Exim uid is a member of other
-groups (that is, the &[initgroups()]& function is not run).
-Exim is unable to change uid to read the file as the user, and it may not be
-able to read it as the Exim user. So in practice the router may not be able to
-operate.
+running under the Exim uid, not as root. Exim is unable to change uid to read
+the file as the user, and it may not be able to read it as the Exim user. So in
+practice the router may not be able to operate.
.next
However, even when the router can operate, the existence of a &_.forward_& file
is unimportant when verifying an address. What should be checked is whether the
.code
X.Employee: :fail: Gone away, no forwarding address
.endd
+.new
In the case of an address that is being verified from an ACL or as the subject
of a
.cindex "VRFY error text" "display of"
VRFY command, the text is included in the SMTP error response by
default.
.cindex "EXPN error text" "display of"
-The text is not included in the response to an EXPN command.
+The text is not included in the response to an EXPN command. In non-SMTP cases
+the text is included in the error message that Exim generates.
+
+.cindex "SMTP" "error codes"
+By default, Exim sends a 451 SMTP code for a &':defer:'&, and 550 for
+&':fail:'&. However, if the message starts with three digits followed by a
+space, optionally followed by an extended code of the form &'n.n.n'&, also
+followed by a space, and the very first digit is the same as the default error
+code, the code from the message is used instead. If the very first digit is
+incorrect, a panic error is logged, and the default code is used. You can
+suppress the use of the supplied code in a redirect router by setting the
+&%forbid_smtp_code%& option true. In this case, any SMTP code is quietly
+ignored.
.cindex "&$acl_verify_message$&"
In an ACL, an explicitly provided message overrides the default, but the
default message is available in the variable &$acl_verify_message$& and can
-therefore be included in a custom message if this is desired. Exim sends a 451
-SMTP code for a &':defer:'&, and 550 for &':fail:'&. In non-SMTP cases the text
-is included in the error message that Exim generates.
+therefore be included in a custom message if this is desired.
+.wen
Normally the error text is the rest of the redirection list &-- a comma does
not terminate it &-- but a newline does act as a terminator. Newlines are not
it is running, the file name is in &$address_file$&.
+.new
+.option filter_prepend_home redirect boolean true
+When this option is true, if a &(save)& command in an Exim filter specifies a
+relative path, and &$home$& is defined, it is automatically prepended to the
+relative path. If this option is set false, this action does not happen. The
+relative path is then passed to the transport unmodified.
+.wen
+
+
.option forbid_blackhole redirect boolean false
If this option is true, the &':blackhole:'& item may not appear in a
redirection list.
locks out the Sieve's &"keep"& facility.
-.new
.option forbid_filter_dlfunc redirect boolean false
.cindex "filter" "locking out certain features"
If this option is true, string expansions in Exim filters are not allowed to
make use of the &%dlfunc%& expansion facility to run dynamically loaded
functions.
-.wen
.option forbid_filter_existstest redirect boolean false
-.new
.cindex "expansion" "statting a file"
If this option is true, string expansions in Exim filters are not allowed to
make use of the &%exists%& condition or the &%stat%& expansion item.
-.wen
.option forbid_filter_logwrite redirect boolean false
If this option is true, use of the logging facility in Exim filters is not
&%allow_filter%& is true.
+.new
+.cindex "SMTP" "error codes"
+.option forbid_smtp_code redirect boolean false
+If this option is set true, any SMTP error codes that are present at the start
+of messages specified for &`:defer:`& or &`:fail:`& are quietly ignored, and
+the default codes (451 and 550, respectively) are always used.
+.wen
+
+
.option hide_child_in_errmsg redirect boolean false
to pipe or file deliveries or auto-replies) &%forbid_file%&, &%forbid_pipe%&,
and &%forbid_filter_reply%& are forced to be true when &%one_time%& is set.
-.new
&*Warning 3*&: The &%unseen%& generic router option may not be set with
&%one_time%&.
-.wen
The original top-level address is remembered with each of the generated
addresses, and is output in any log messages. However, any intermediate parent
.option qualify_domain redirect string&!! unset
.cindex "&$qualify_recipient$&"
-If this option is set and an unqualified address (one without a domain) is
-generated, it is qualified with the domain specified by expanding this string,
-instead of the global setting in &%qualify_recipient%&. If the expansion fails,
-the router declines. If you want to revert to the default, you can have the
-expansion generate &$qualify_recipient$&.
-
+If this option is set, and an unqualified address (one without a domain) is
+generated, and that address would normally be qualified by the global setting
+in &%qualify_recipient%&, it is instead qualified with the domain specified by
+expanding this string. If the expansion fails, the router declines. If you want
+to revert to the default, you can have the expansion generate
+&$qualify_recipient$&.
+
+This option applies to all unqualified addresses generated by Exim filters,
+but for traditional &_.forward_& files, it applies only to addresses that are
+not preceded by a backslash. Sieve filters cannot generate unqualified
+addresses.
.option qualify_preserve_domain redirect boolean false
.cindex "domain" "in redirection; preserving"
.cindex "preserving domain in redirection"
.cindex "address redirection" "domain; preserving"
-If this is set and an unqualified address (one without a domain) is generated,
-it is qualified with the domain of the
-parent address (the immediately preceding ancestor) instead of the local
-&%qualify_domain%& or global &%qualify_recipient%& value.
+If this option is set, the router's local &%qualify_domain%& option must not be
+set (a configuration error occurs if it is). If an unqualified address (one
+without a domain) is generated, it is qualified with the domain of the parent
+address (the immediately preceding ancestor) instead of the global
+&%qualify_recipient%& value. In the case of a traditional &_.forward_& file,
+this applies whether or not the address is preceded by a backslash.
.option repeat_use redirect boolean true
and are rewritten according to the global rewriting rules.
-.new
.option sieve_subaddress redirect string&!! unset
The value of this option is passed to a Sieve filter to specify the
:subaddress part of an address.
The value of this option is passed to a Sieve filter to specify the :user part
of an address. However, if it is unset, the entire original local part
(including any prefix or suffix) is used for :user.
-.wen
.option sieve_vacation_directory redirect string&!! unset
-.new
.cindex "Sieve filter" "vacation directory"
To enable the &"vacation"& extension for Sieve filters, you must set
&%sieve_vacation_directory%& to the directory where vacation databases are held
(do not put anything else in that directory), and ensure that the
&%reply_transport%& option refers to an &(autoreply)& transport. Each user
needs their own directory; Exim will create it if necessary.
-.wen
.option syntax_errors_to redirect string unset
See &%skip_syntax_errors%& above.
+.ecindex IIDredrou1
+.ecindex IIDredrou2
.chapter "Environment for running local transports" "CHAPenvironment" &&&
"Environment for local transports"
-.cindex "local transports" "environment for"
-.cindex "environment for local transports"
-.cindex "transport" "local; environment for"
+.scindex IIDenvlotra1 "local transports" "environment for"
+.scindex IIDenvlotra2 "environment for local transports"
+.scindex IIDenvlotra3 "transport" "local; environment for"
Local transports handle deliveries to files and pipes. (The &(autoreply)&
transport can be thought of as similar to a pipe.) Exim always runs transports
in subprocesses, under specified uids and gids. Typical deliveries to local
receive the message is used, and if &%group%& is not set, the corresponding
original gid is also used.
-.new
This is the detailed preference order for obtaining a gid; the first of the
following that is set is used:
Of course, an error will still occur if the uid that is chosen is on the
&%never_users%& list.
-.wen
other means). In this case, the variables associated with the local part are
never set, &$domain$& is set only if all the addresses have the same domain,
and &$original_domain$& is never set.
+.ecindex IIDenvlotra1
+.ecindex IIDenvlotra2
+.ecindex IIDenvlotra3
. ////////////////////////////////////////////////////////////////////////////
.chapter "Generic options for transports" "CHAPtransportgeneric"
-
-.cindex "generic options" "transport"
-.cindex "options" "generic; for transports"
-.cindex "transport" "generic options for"
+.scindex IIDgenoptra1 "generic options" "transport"
+.scindex IIDgenoptra2 "options" "generic; for transports"
+.scindex IIDgenoptra3 "transport" "generic options for"
The following generic options apply to all transports:
.option home_directory transports string&!! unset
.cindex "transport" "home directory for"
.cindex "&$home$&"
-This option specifies a home directory setting for the transport, overriding
-any value that may be set by the router. The home directory is placed in
-&$home$& while expanding the transport's private options. It is also used as
-the current directory if no current directory is set by the
+This option specifies a home directory setting for a local transport,
+overriding any value that may be set by the router. The home directory is
+placed in &$home$& while expanding the transport's private options. It is also
+used as the current directory if no current directory is set by the
&%current_directory%& option on the transport or the
-&%transport_current_directory%& option on the router.
-If the expansion fails for any reason, including forced failure, an error is
-logged, and delivery is deferred.
+&%transport_current_directory%& option on the router. If the expansion fails
+for any reason, including forced failure, an error is logged, and delivery is
+deferred.
.option initgroups transports boolean false
.code
RCPT TO:<xyz@some.domain>
.endd
-&new("This is also the case when an ACL-time callout is being used to verify a
-recipient address.") However, if &%rcpt_include_affixes%& is set true, the
+This is also the case when an ACL-time callout is being used to verify a
+recipient address. However, if &%rcpt_include_affixes%& is set true, the
whole local part is included in the RCPT command. This option applies to BSMTP
deliveries by the &(appendfile)& and &(pipe)& transports as well as to the
&(lmtp)& and &(smtp)& transports.
only effect is to change the address that is placed in the &'Return-path:'&
header line, if one is added to the message (see the next option).
+.new
+&*Note:*& A changed return path is not logged unless you add
+&%return_path_on_delivery%& to the log selector.
+.wen
+
.cindex "&$return_path$&"
The expansion can refer to the existing value via &$return_path$&. This is
either the message's envelope sender, or an address set by the
&%errors_to%& option on a router. If the expansion is forced to fail, no
replacement occurs; if it fails for another reason, delivery is deferred. This
option can be used to support VERP (Variable Envelope Return Paths) &-- see
-chapter &<<CHAPSMTP>>&.
+section &<<SECTverp>>&.
-&*Note*&: If a delivery error is detected locally,
-including the case when a remote server rejects a message at SMTP time,
-the bounce message is not sent to the value of this option, but to the
-previously set errors address (which defaults to the incoming sender address).
+&*Note*&: If a delivery error is detected locally, including the case when a
+remote server rejects a message at SMTP time, the bounce message is not sent to
+the value of this option. It is sent to the previously set errors address.
+This defaults to the incoming sender address, but can be changed by setting
+&%errors_to%& in a router.
individual users or via a system filter.
When the message is about to be written out, the command specified by
-&%transport_filter%& is started up in a separate, &new(parallel) process, and
+&%transport_filter%& is started up in a separate, parallel process, and
the entire message, including the header lines, is passed to it on its standard
input (this in fact is done from a third process, to avoid deadlock). The
command must be specified as an absolute path.
The standard error for the filter process is set to the same destination as its
standard output; this is read and written to the message's ultimate
-destination. &new("The process that writes the message to the filter, the
+destination. The process that writes the message to the filter, the
filter itself, and the original process that reads the result and delivers it
-are all run in parallel, like a shell pipeline.")
+are all run in parallel, like a shell pipeline.
The filter can perform any transformations it likes, but of course should take
care not to break RFC 2822 syntax. A demonstration Perl script is provided in
final newline when SMTP is in use. All messages transmitted over SMTP must end
with a newline, so Exim supplies one if it is missing.
-.new
.cindex "content scanning" "per user"
A transport filter can be used to provide content-scanning on a per-user basis
at delivery time if the only required effect of the scan is to modify the
message. For example, a content scan could insert a new header line containing
a spam score. This could be interpreted by a filter in the user's MUA. It is
not possible to discard a message at this stage.
-.wen
.cindex "SMTP" "SIZE"
A problem might arise if the filter increases the size of a message that is
The value of the &%transport_filter%& option is the command string for starting
the filter, which is run directly from Exim, not under a shell. The string is
parsed by Exim in the same way as a command string for the &(pipe)& transport:
-Exim breaks it up into arguments and then expands each argument separately.
-&new("Any kind of expansion failure causes delivery to be deferred.") The
-special argument &$pipe_addresses$& is replaced by a number of arguments, one
-for each address that applies to this delivery. (This isn't an ideal name for
-this feature here, but as it was already implemented for the &(pipe)&
-transport, it seemed sensible not to change it.)
+Exim breaks it up into arguments and then expands each argument separately (see
+section &<<SECThowcommandrun>>&). Any kind of expansion failure causes delivery
+to be deferred. The special argument &$pipe_addresses$& is replaced by a number
+of arguments, one for each address that applies to this delivery. (This isn't
+an ideal name for this feature here, but as it was already implemented for the
+&(pipe)& transport, it seemed sensible not to change it.)
.cindex "&$host$&"
.cindex "&$host_address$&"
transport_filter = /some/directory/transport-filter.pl \
$host $host_address $sender_address $pipe_addresses
.endd
-The filter process is run under the same uid and gid as the normal delivery.
-For remote deliveries this is the Exim uid/gid by default.
-.new
-The command should normally yield a zero return code. Transport filters are not
-supposed to fail. A non-zero code is taken to mean that the transport filter
-encountered some serious problem. Delivery of the message is deferred; the
-message remains on the queue and is tried again later. It is not possible to
-cause a message to be bounced from a transport filter.
-.wen
+Two problems arise if you want to use more complicated expansion items to
+generate transport filter commands, both of which due to the fact that the
+command is split up &'before'& expansion.
+.ilist
+If an expansion item contains white space, you must quote it, so that it is all
+part of the same command item. If the entire option setting is one such
+expansion item, you have to take care what kind of quoting you use. For
+example:
+.code
+transport_filter = '/bin/cmd${if eq{$host}{a.b.c}{1}{2}}'
+.endd
+This runs the command &(/bin/cmd1)& if the host name is &'a.b.c'&, and
+&(/bin/cmd2)& otherwise. If double quotes had been used, they would have been
+stripped by Exim when it read the option's value. When the value is used, if
+the single quotes were missing, the line would be split into two items,
+&`/bin/cmd${if`& and &`eq{$host}{a.b.c}{1}{2}`&, and an error would occur when
+Exim tried to expand the first one.
+.next
+Except for the special case of &$pipe_addresses$& that is mentioned above, an
+expansion cannot generate multiple arguments, or a command name followed by
+arguments. Consider this example:
+.code
+transport_filter = ${lookup{$host}lsearch{/some/file}\
+ {$value}{/bin/cat}}
+.endd
+The result of the lookup is interpreted as the name of the command, even
+if it contains white space. The simplest way round this is to use a shell:
+.code
+transport_filter = /bin/sh -c ${lookup{$host}lsearch{/some/file}\
+ {$value}{/bin/cat}}
+.endd
+.endlist
+
+The filter process is run under the same uid and gid as the normal delivery.
+For remote deliveries this is the Exim uid/gid by default. The command should
+normally yield a zero return code. Transport filters are not supposed to fail.
+A non-zero code is taken to mean that the transport filter encountered some
+serious problem. Delivery of the message is deferred; the message remains on
+the queue and is tried again later. It is not possible to cause a message to be
+bounced from a transport filter.
If a transport filter is set on an autoreply transport, the original message is
passed through the filter as it is being copied into the newly generated
.option transport_filter_timeout transports time 5m
-.new
.cindex "transport filter" "timeout"
When Exim is reading the output of a transport filter, it a applies a timeout
that can be set by this option. Exceeding the timeout is normally treated as a
way as a timeout in the pipe command itself. By default, a timeout is a hard
error, but if the &(pipe)& transport's &%timeout_defer%& option is set true, it
becomes a temporary error.
-.wen
.option user transports string&!! "Exim user"
sure you know what you are doing. When a remote transport is running, it needs
to be able to access Exim's hints databases, because each host may have its own
retry data.
+.ecindex IIDgenoptra1
+.ecindex IIDgenoptra2
+.ecindex IIDgenoptra3
acceptable.
.endlist
-The three local transports (&(appendfile)&, &(lmtp)&, and &(pipe)&) all have
-the same options for controlling multiple (&"batched"&) deliveries, namely
-&%batch_max%& and &%batch_id%&. To save repeating the information for each
-transport, these options are described here.
+These three local transports all have the same options for controlling multiple
+(&"batched"&) deliveries, namely &%batch_max%& and &%batch_id%&. To save
+repeating the information for each transport, these options are described here.
The &%batch_max%& option specifies the maximum number of addresses that can be
-delivered together in a single run of the transport. Its default value is one.
-When more than one address is routed to a transport that has a &%batch_max%&
-value greater than one, the addresses are delivered in a batch (that is, in a
-single run of the transport), subject to certain conditions:
+delivered together in a single run of the transport. Its default value is one
+(no batching). When more than one address is routed to a transport that has a
+&%batch_max%& value greater than one, the addresses are delivered in a batch
+(that is, in a single run of the transport with multiple recipients), subject
+to certain conditions:
.ilist
.cindex "&$local_part$&"
.cindex "customizing" "batching condition"
If &%batch_id%& is set, it is expanded for each address, and only those
addresses with the same expanded value are batched. This allows you to specify
-customized batching conditions.
-Failure of the expansion for any reason, including forced failure, disables
-batching, but it does not stop the delivery from taking place.
+customized batching conditions. Failure of the expansion for any reason,
+including forced failure, disables batching, but it does not stop the delivery
+from taking place.
.next
Batched addresses must also have the same errors address (where to send
delivery errors), the same header additions and removals, the same user and
be the same.
.endlist
-.cindex "&'Envelope-to:'& header line"
-If the generic &%envelope_to_add%& option is set for the transport, the
-&'Envelope-to:'& header that is added to the message contains all the addresses
-that are batched together.
-
-The &(appendfile)& and &(pipe)& transports have an option called &%use_bsmtp%&,
-which causes them to deliver the message in &"batched SMTP"& format, with the
-envelope represented as SMTP commands. The &%check_string%& and
-&%escape_string%& options are forced to the values
+In the case of the &(appendfile)& and &(pipe)& transports, batching applies
+both when the file or pipe command is specified in the transport, and when it
+is specified by a &(redirect)& router, but all the batched addresses must of
+course be routed to the same file or pipe command. These two transports have an
+option called &%use_bsmtp%&, which causes them to deliver the message in
+&"batched SMTP"& format, with the envelope represented as SMTP commands. The
+&%check_string%& and &%escape_string%& options are forced to the values
.code
check_string = "."
escape_string = ".."
given in section &<<SECTbatchSMTP>>&. The &(lmtp)& transport does not have a
&%use_bsmtp%& option, because it always delivers using the SMTP protocol.
+.cindex "&'Envelope-to:'& header line"
+If the generic &%envelope_to_add%& option is set for a batching transport, the
+&'Envelope-to:'& header that is added to the message contains all the addresses
+that are being processed together. If you are using a batching &(appendfile)&
+transport without &%use_bsmtp%&, the only way to preserve the recipient
+addresses is to set the &%envelope_to_add%& option.
+
.cindex "&(pipe)& transport" "with multiple addresses"
.cindex "&$pipe_addresses$&"
-If you are not using BSMTP, but are using a &(pipe)& transport, you can include
-&$pipe_addresses$& as part of the command. This is not a true variable; it is
-a bit of magic that causes each of the recipient addresses to be inserted into
-the command as a separate argument. This provides a way of accessing all the
-addresses that are being delivered in the batch.
+If you are using a &(pipe)& transport without BSMTP, and setting the
+transport's &%command%& option, you can include &$pipe_addresses$& as part of
+the command. This is not a true variable; it is a bit of magic that causes each
+of the recipient addresses to be inserted into the command as a separate
+argument. This provides a way of accessing all the addresses that are being
+delivered in the batch. &*Note:*& This is not possible for pipe commands that
+are specififed by a &(redirect)& router.
-If you are using a batching &(appendfile)& transport without &%use_bsmtp%&, the
-only way to preserve the recipient addresses is to set the &%envelope_to_add%&
-option. This causes an &'Envelope-to:'& header line to be added to the message,
-containing all the recipients.
. ////////////////////////////////////////////////////////////////////////////
.chapter "The appendfile transport" "CHAPappendfile"
-.cindex "&(appendfile)& transport"
-.cindex "transports" "&(appendfile)&"
+.scindex IIDapptra1 "&(appendfile)& transport"
+.scindex IIDapptra2 "transports" "&(appendfile)&"
.cindex "directory creation"
.cindex "creating directories"
The &(appendfile)& transport delivers a message by appending it to an existing
.option file_must_exist appendfile boolean false
-If this option is true, the file specified by the &%file%& option must exist,
-and an error occurs if it does not. Otherwise, it is created if it does not
-exist.
+.new
+If this option is true, the file specified by the &%file%& option must exist.
+A temporary error occurs if it does not, causing delivery to be deferred.
+If this option is false, the file is created if it does not exist.
+.wen
.option lock_fcntl_timeout appendfile time 0s
.option lockfile_mode appendfile "octal integer" 0600
This specifies the mode of the created lock file, when a lock file is being
-used (see &%use_lockfile%&).
+used (see &%use_lockfile%& and &%use_mbx_lock%&).
.option lockfile_timeout appendfile time 30m
.cindex "maildir format" "quota; directories included in"
.cindex "quota" "maildir; directories included in"
This option is relevant only when &%maildir_use_size_file%& is set. It defines
-a regular expression for specifying directories that should be included in the
-quota calculation. The default value is
+a regular expression for specifying directories, relative to the quota
+directory (see &%quota_directory%&), that should be included in the quota
+calculation. The default value is:
.code
maildir_quota_directory_regex = ^(?:cur|new|\..*)$
.endd
-which includes the &_cur_& and &_new_& directories, and any maildir++ folders
+This includes the &_cur_& and &_new_& directories, and any maildir++ folders
(directories whose names begin with a dot). If you want to exclude the
&_Trash_&
folder from the count (as some sites do), you need to change this setting to
maildir_quota_directory_regex = ^(?:cur|new|\.(?!Trash).*)$
.endd
This uses a negative lookahead in the regular expression to exclude the
-directory whose name is &_.Trash_&.
+directory whose name is &_.Trash_&. When a directory is excluded from quota
+calculations, quota processing is bypassed for any messages that are delivered
+directly into that directory.
.option maildir_retries appendfile integer 10
Setting this option true enables support for &_maildirsize_& files. Exim
creates a &_maildirsize_& file in a maildir if one does not exist, taking the
quota from the &%quota%& option of the transport. If &%quota%& is unset, the
-value is zero. See section &<<SECTmaildirdelivery>>& below for further details.
+value is zero. See &%maildir_quota_directory_regex%& above and section
+&<<SECTmaildirdelivery>>& below for further details.
+
+.option maildirfolder_create_regex appendfile string unset
+.cindex "maildir format" "&_maildirfolder_& file"
+.cindex "&_maildirfolder_&, creating"
+The value of this option is a regular expression. If it is unset, it has no
+effect. Otherwise, before a maildir delivery takes place place, the pattern is
+matched against the name of the maildir directory, that is, the directory
+containing the &_new_& and &_tmp_& subdirectories that will be used for the
+delivery. If there is a match, Exim checks for the existence of a file called
+&_maildirfolder_& in the directory, and creates it if it does not exist.
+See section &<<SECTmaildirdelivery>>& for more details.
.option mailstore_format appendfile boolean false
Nevertheless, it seems best to stick to the &'used'& figure, because this is
the obvious value which users understand most easily.
-.new
The value of the option is expanded, and must then be a numerical value
(decimal point allowed), optionally followed by one of the letters K, M, or G,
for kilobytes, megabytes, or gigabytes. If Exim is running on a system with
large file support (Linux and FreeBSD have this), mailboxes larger than 2G can
be handled.
-.wen
&*Note*&: A value of zero is interpreted as &"no quota"&.
This option applies when the &%directory%& option is set. It limits the total
number of files in the directory (compare the inode limit in system quotas). It
can only be used if &%quota%& is also set. The value is expanded; an expansion
-failure causes delivery to be deferred.
+failure causes delivery to be deferred. A value of zero is interpreted as
+&"no quota"&.
.option quota_is_inclusive appendfile boolean true
maildir_tag = ,S=$message_size
quota_size_regex = ,S=(\d+)
.endd
-.new
An alternative to &$message_size$& is &$message_linecount$&, which contains the
number of lines in the message.
-.wen
The regular expression should not assume that the length is at the end of the
file name (even though &%maildir_tag%& puts it there) because maildir MUAs
If &%quota%& is not set, a setting of &%quota_warn_threshold%& that ends with a
percent sign is ignored.
-.new
The warning message itself is specified by the &%quota_warn_message%& option,
and it must start with a &'To:'& header line containing the recipient(s) of the
warning message. These do not necessarily have to include the recipient(s) of
the original message. A &'Subject:'& line should also normally be supplied. You
-can include any other header lines that you want.
-.wen
+can include any other header lines that you want. If you do not include a
+&'From:'& line, the default is:
+.code
+From: Mail Delivery System <mailer-daemon@$qualify_domain_sender>
+.endd
+.oindex &%errors_reply_to%&
+If you supply a &'Reply-To:'& line, it overrides the global &%errors_reply_to%&
+option.
The &%quota%& option does not have to be set in order to use this option; they
are independent of one another except when the threshold is specified as a
/tmp/.<device-number>.<inode-number>
.endd
using the device and inode numbers of the open mailbox file, in accordance with
-the MBX locking rules.
+the MBX locking rules. This file is created with a mode that is specified by
+the &%lockfile_mode%& option.
If Exim fails to lock the file, there are two possible courses of action,
depending on the value of the locking timeout. This is obtained from
.cindex "maildir format" "description of"
If the &%maildir_format%& option is true, Exim delivers each message by writing
it to a file whose name is &_tmp/<stime>.H<mtime>P<pid>.<host>_& in the
-given directory. If the delivery is successful, the file is renamed into the
+directory that is defined by the &%directory%& option (the &"delivery
+directory"&). If the delivery is successful, the file is renamed into the
&_new_& subdirectory.
In the file name, <&'stime'&> is the current time of day in seconds, and
opening it. If any response other than ENOENT (does not exist) is given,
Exim waits 2 seconds and tries again, up to &%maildir_retries%& times.
+Before Exim carries out a maildir delivery, it ensures that subdirectories
+called &_new_&, &_cur_&, and &_tmp_& exist in the delivery directory. If they
+do not exist, Exim tries to create them and any superior directories in their
+path, subject to the &%create_directory%& and &%create_file%& options. If the
+&%maildirfolder_create_regex%& option is set, and the regular expression it
+contains matches the delivery directory, Exim also ensures that a file called
+&_maildirfolder_& exists in the delivery directory. If a missing directory or
+&_maildirfolder_& file cannot be created, delivery is deferred.
+
+These features make it possible to use Exim to create all the necessary files
+and directories in a maildir mailbox, including subdirectories for maildir++
+folders. Consider this example:
+.code
+maildir_format = true
+directory = /var/mail/$local_part\
+ ${if eq{$local_part_suffix}{}{}\
+ {/.${substr_1:$local_part_suffix}}}
+maildirfolder_create_regex = /\.[^/]+$
+.endd
+If &$local_part_suffix$& is empty (there was no suffix for the local part),
+delivery is into a toplevel maildir with a name like &_/var/mail/pimbo_& (for
+the user called &'pimbo'&). The pattern in &%maildirfolder_create_regex%& does
+not match this name, so Exim will not look for or create the file
+&_/var/mail/pimbo/maildirfolder_&, though it will create
+&_/var/mail/pimbo/{cur,new,tmp}_& if necessary.
+
+However, if &$local_part_suffix$& contains &`-eximusers`& (for example),
+delivery is into the maildir++ folder &_/var/mail/pimbo/.eximusers_&, which
+does match &%maildirfolder_create_regex%&. In this case, Exim will create
+&_/var/mail/pimbo/.eximusers/maildirfolder_& as well as the three maildir
+directories &_/var/mail/pimbo/.eximusers/{cur,new,tmp}_&.
+
+&*Warning:*& Take care when setting &%maildirfolder_create_regex%& that it does
+not inadvertently match the toplevel maildir directory, because a
+&_maildirfolder_& file at top level would completely break quota calculations.
+
.cindex "quota" "in maildir delivery"
.cindex "maildir++"
If Exim is required to check a &%quota%& setting before a maildir delivery, and
.cindex "maildir format" "&_maildirsize_& file"
If &%maildir_use_size_file%& is true, Exim implements the maildir++ rules for
storing quota and message size information in a file called &_maildirsize_&
-within the maildir directory. If this file does not exist, Exim creates it,
-setting the quota from the &%quota%& option of the transport. If the maildir
-directory itself does not exist, it is created before any attempt to write a
-&_maildirsize_& file.
+within the toplevel maildir directory. If this file does not exist, Exim
+creates it, setting the quota from the &%quota%& option of the transport. If
+the maildir directory itself does not exist, it is created before any attempt
+to write a &_maildirsize_& file.
The &_maildirsize_& file is used to hold information about the sizes of
messages in the maildir, thus speeding up quota calculations. The quota value
file is maintained (with a zero quota setting), but no quota is imposed.
A regular expression is available for controlling which directories in the
-maildir participate in quota calculations. See the description of the
-&%maildir_quota_directory_regex%& option above for details.
-
+maildir participate in quota calculations when a &_maildirsizefile_& is in use.
+See the description of the &%maildir_quota_directory_regex%& option above for
+details.
.section "Mailstore delivery"
greater than one. Finally, &%mailstore_suffix%& is expanded and the result
appended to the file, followed by a newline if it does not end with one.
-.new
If expansion of &%mailstore_prefix%& or &%mailstore_suffix%& ends with a forced
failure, it is ignored. Other expansion errors are treated as serious
configuration errors, and delivery is deferred. The variable
&$mailstore_basename$& is available for use during these expansions.
-.wen
.section "Non-special new file delivery"
might be used. A message is written to a file with a temporary name, which is
then renamed when the delivery is complete. The final name is obtained by
expanding the contents of the &%directory_file%& option.
+.ecindex IIDapptra1
+.ecindex IIDapptra2
. ////////////////////////////////////////////////////////////////////////////
.chapter "The autoreply transport"
-.cindex "transports" "&(autoreply)&"
-.cindex "&(autoreply)& transport"
+.scindex IIDauttra1 "transports" "&(autoreply)&"
+.scindex IIDauttra2 "&(autoreply)& transport"
The &(autoreply)& transport is not a true transport in that it does not cause
-the message to be transmitted. Instead, it generates a new mail message.
+the message to be transmitted. Instead, it generates a new mail message as an
+automatic reply to the incoming message. &'References:'& and
+&'Auto-Submitted:'& header lines are included. These are constructed according
+to the rules in RFCs 2822 and 3834, respectively.
If the router that passes the message to this transport does not have the
&%unseen%& option set, the original message (for the current recipient) is not
.option never_mail autoreply "address list&!!" unset
If any run of the transport creates a message with a recipient that matches any
item in the list, that recipient is quietly discarded. If all recipients are
-discarded, no message is created.
+discarded, no message is created. This applies both when the recipients are
+generated by a filter and when they are specified in the transport.
.option to autoreply string&!! unset
This specifies recipients of the message and the contents of the &'To:'& header
when the message is specified by the transport.
+.ecindex IIDauttra1
+.ecindex IIDauttra2
is passed to the new process using the standard input and output to operate the
LMTP protocol.
-.new
.option ignore_quota lmtp boolean false
.cindex "LMTP" "ignoring quota errors"
If this option is set true, the string &`IGNOREQUOTA`& is added to RCPT
commands, provided that the LMTP server has advertised support for IGNOREQUOTA
in its response to the LHLO command.
-.wen
.option socket lmtp string&!! unset
This option must be set if &%command%& is not set. The result of expansion must
. ////////////////////////////////////////////////////////////////////////////
.chapter "The pipe transport" "CHAPpipetransport"
-.cindex "transports" "&(pipe)&"
-.cindex "&(pipe)& transport"
+.scindex IIDpiptra1 "transports" "&(pipe)&"
+.scindex IIDpiptra2 "&(pipe)& transport"
The &(pipe)& transport is used to deliver messages via a pipe to a command
running in another process. One example is the use of &(pipe)& as a
pseudo-remote transport for passing messages to some other delivery mechanism
is specified by the &%command%& option on the transport.
.next
.cindex "&$pipe_addresses$&"
-If the &%batch_max%& option is set greater than 1 (the default), the transport
-can be called upon to handle more than one address in a single run. In this
-case, &$local_part$& is not set (because it is not unique). However, the
-pseudo-variable &$pipe_addresses$& (described in section
-&<<SECThowcommandrun>>& below) contains all the addresses that are being
-handled.
+If the &%batch_max%& option is set greater than 1 (the default is 1), the
+transport can handle more than one address in a single run. In this case, when
+more than one address is routed to the transport, &$local_part$& is not set
+(because it is not unique). However, the pseudo-variable &$pipe_addresses$&
+(described in section &<<SECThowcommandrun>>& below) contains all the addresses
+that are routed to the transport.
.next
.cindex "&$address_pipe$&"
A router redirects an address directly to a pipe command (for example, from an
-alias or forward file). In this case, &$local_part$& contains the local part
-that was redirected, and &$address_pipe$& contains the text of the pipe
-command itself. The &%command%& option on the transport is ignored.
+alias or forward file). In this case, &$address_pipe$& contains the text of the
+pipe command, and the &%command%& option on the transport is ignored. If only
+one address is being transported (&%batch_max%& is not greater than one, or
+only one address was redirected to this pipe command), &$local_part$& contains
+the local part that was redirected.
.endlist
other cases, the uid and gid have to be specified explicitly, either on the
transport or on the router that handles the address. Current and &"home"&
directories are also controllable. See chapter &<<CHAPenvironment>>& for
-details of the local delivery environment.
-
+details of the local delivery environment and chapter &<<CHAPbatching>>&
+for a discussion of local delivery batching.
.section "Concurrent delivery"
to ensure that it is all in one argument. The expansion is done in this way,
argument by argument, so that the number of arguments cannot be changed as a
result of expansion, and quotes or backslashes in inserted variables do not
-interact with external quoting.
+interact with external quoting. However, this leads to problems if you want to
+generate multiple arguments (or the command name plus arguments) from a single
+expansion. In this situation, the simplest solution is to use a shell. For
+example:
+.code
+command = /bin/sh -c ${lookup{$local_part}lsearch{/some/file}}
+.endd
.cindex "transport" "filter"
.cindex "filter" "transport filter"
from the transport unless the status value is one of those listed in
&%temp_errors%&; these cause the delivery to be deferred and tried again later.
-.new
&*Note*&: This option does not apply to timeouts, which do not return a status.
See the &%timeout_defer%& option for how timeouts are handled.
-.wen
.option log_defer_output pipe boolean false
.cindex "&(pipe)& transport" "logging output"
and kills the whole process group on a timeout. However, this can be defeated
if one of the processes starts a new process group.
-.new
.option timeout_defer pipe boolean false
A timeout in a &(pipe)& transport, either in the command that the transport
runs, or in a transport filter that is associated with it, is by default
treated as a hard error, and the delivery fails. However, if &%timeout_defer%&
is set true, both kinds of timeout become temporary errors, causing the
delivery to be deferred.
-.wen
.option umask pipe "octal integer" 022
This specifies the umask setting for the subprocess that runs the command.
you can do so by setting the &%message_prefix%& option. See section
&<<SECTbatchSMTP>>& for details of batch SMTP.
+.option use_classresources pipe boolean false
+.cindex "class resources (BSD)"
+This option is available only when Exim is running on FreeBSD, NetBSD, or
+BSD/OS. If it is set true, the &[setclassresources()]& function is used to set
+resource limits when a &(pipe)& transport is run to perform a delivery. The
+limits for the uid under which the pipe is to run are obtained from the login
+class database.
+
.option use_crlf pipe boolean false
.cindex "carriage return"
Note the unsetting of &%message_prefix%& and &%message_suffix%&, and the use of
&%return_output%& to cause any text written by Cyrus to be returned to the
sender.
+.ecindex IIDpiptra1
+.ecindex IIDpiptra2
. ////////////////////////////////////////////////////////////////////////////
. ////////////////////////////////////////////////////////////////////////////
.chapter "The smtp transport" "CHAPsmtptrans"
-.cindex "transports" "&(smtp)&"
-.cindex "&(smtp)& transport"
+.scindex IIDsmttra1 "transports" "&(smtp)&"
+.scindex IIDsmttra2 "&(smtp)& transport"
The &(smtp)& transport delivers messages over TCP/IP connections using the SMTP
or LMTP protocol. The list of hosts to try can either be taken from the address
that is being processed (having been set up by the router), or specified
.option authenticated_sender smtp string&!! unset
.cindex "Cyrus"
-When Exim has authenticated as a client, this option sets a value for the
-AUTH= item on outgoing MAIL commands, overriding any existing
-authenticated sender value. If the string expansion is forced to fail, the
-option is ignored. Other expansion failures cause delivery to be deferred. If
-the result of expansion is an empty string, that is also ignored.
+When Exim has authenticated as a client, or if &%authenticated_sender_force%&
+is true, this option sets a value for the AUTH= item on outgoing MAIL commands,
+overriding any existing authenticated sender value. If the string expansion is
+forced to fail, the option is ignored. Other expansion failures cause delivery
+to be deferred. If the result of expansion is an empty string, that is also
+ignored.
If the SMTP session is not authenticated, the expansion of
&%authenticated_sender%& still happens (and can cause the delivery to be
-deferred if it fails), but no AUTH= item is added to MAIL commands.
+deferred if it fails), but no AUTH= item is added to MAIL commands
+unless &%authenticated_sender_force%& is true.
This option allows you to use the &(smtp)& transport in LMTP mode to
deliver mail to Cyrus IMAP and provide the proper local part as the
value.
+.option authenticated_sender_force smtp boolean false
+If this option is set true, the &%authenticated_sender%& option's value
+is used for the AUTH= item on outgoing MAIL commands, even if Exim has not
+authenticated as a client.
+
+
.option command_timeout smtp time 5m
This sets a timeout for receiving a response to an SMTP command that has been
sent out. It is also used when waiting for the initial banner line from the
.option fallback_hosts smtp "string list" unset
-.new
.cindex "fallback" "hosts specified on transport"
String expansion is not applied to this option. The argument must be a
colon-separated list of host names or IP addresses, optionally also including
&<<SECTlistconstruct>>&. Each individual item in the list is the same as an
item in a &%route_list%& setting for the &(manualroute)& router, as described
in section &<<SECTformatonehostitem>>&.
-.wen
Fallback hosts can also be specified on routers, which associate them with the
addresses they process. As for the &%hosts%& option without &%hosts_override%&,
.option helo_data smtp string&!! &`$primary_hostname`&
.cindex "HELO argument" "setting"
.cindex "EHLO argument" "setting"
-.new
-The value of this option is expanded, and used as the argument for the EHLO or
-HELO command that starts the outgoing SMTP session. The variables &$host$& and
-&$host_address$& are set to the identity of the remote host, and can be used to
-generate different values for different servers.
-.wen
+.cindex "LHLO argument" "setting"
+The value of this option is expanded, and used as the argument for the EHLO,
+HELO, or LHLO command that starts the outgoing SMTP or LMTP session. The
+variables &$host$& and &$host_address$& are set to the identity of the remote
+host, and can be used to generate different values for different servers.
.option hosts smtp "string list&!!" unset
Hosts are associated with an address by a router such as &(dnslookup)&, which
&%hosts%& are also used, whether or not the address has its own hosts, if
&%hosts_override%& is set.
-.new
The string is first expanded, before being interpreted as a colon-separated
list of host names or IP addresses, possibly including port numbers. The
separator may be changed to something other than colon, as described in section
item in a &%route_list%& setting for the &(manualroute)& router, as described
in section &<<SECTformatonehostitem>>&. However, note that the &`/MX`& facility
of the &(manualroute)& router is not available here.
-.wen
If the expansion fails, delivery is deferred. Unless the failure was caused by
the inability to complete a lookup, the error is logged to the panic log as
unreachable hosts.
-.new
.option lmtp_ignore_quota smtp boolean false
.cindex "LMTP" "ignoring quota errors"
If this option is set true when the &%protocol%& option is set to &"lmtp"&, the
string &`IGNOREQUOTA`& is added to RCPT commands, provided that the LMTP server
has advertised support for IGNOREQUOTA in its response to the LHLO command.
-.wen
.option max_rcpt smtp integer 100
.cindex "RCPT" "maximum number of outgoing"
client's private key. This is used when sending a message over an encrypted
connection using a client certificate. The values of &$host$& and
&$host_address$& are set to the name and address of the server during the
-expansion. If this option is unset, the private key is assumed to be in the
-same file as the certificate. See chapter &<<CHAPTLS>>& for details of TLS.
+expansion. If this option is unset, or the expansion is forced to fail, or the
+result is an empty string, the private key is assumed to be in the same file as
+the certificate. See chapter &<<CHAPTLS>>& for details of TLS.
.option tls_require_ciphers smtp string&!! unset
Exim never tries more than this number of IP addresses; if it hits this limit
and they are all timed out, the email address is bounced, even though not all
possible IP addresses have been tried.
+.ecindex IIDsmttra1
+.ecindex IIDsmttra2
. ////////////////////////////////////////////////////////////////////////////
.chapter "Address rewriting" "CHAPrewrite"
-.cindex "rewriting" "addresses"
+.scindex IIDaddrew "rewriting" "addresses"
There are some circumstances in which Exim automatically rewrites domains in
addresses. The two most common are when an address is given without a domain
(referred to as an &"unqualified address"&) or when an address contains an
addresses and addresses in header lines. Each rule specifies the types of
address to which it applies.
-Rewriting of addresses in header lines applies only to those headers that
-were received with the message, and, in the case of transport rewriting, those
-that were added by a system filter. That is, it applies only to those headers
-that are common to all copies of the message. Header lines that are added by
-individual routers or transports (and which are therefore specific to
-individual recipient addresses) are not rewritten.
+.new
+Whether or not addresses in header lines are rewritten depends on the origin of
+the headers and the type of rewriting. Global rewriting, that is, rewriting
+rules from the rewrite section of the configuration file, is applied only to
+those headers that were received with the message. Header lines that are added
+by ACLs or by a system filter or by individual routers or transports (which
+are specific to individual recipient addresses) are not rewritten by the global
+rules.
+
+Rewriting at transport time, by means of the &%headers_rewrite%& option,
+applies all headers except those added by routers and transports. That is, as
+well as the headers that were received with the message, it also applies to
+headers that were added by an ACL or a system filter.
+.wen
+
In general, rewriting addresses from your own system or domain has some
legitimacy. Rewriting other addresses should be done only with great care and
as they were before (that is, they contain the unrewritten &-- except for
SMTP-time rewriting &-- address).
-Once a message's header lines have been received, all the envelope recipient
-addresses are permanently rewritten, and rewriting is also applied to the
-addresses in the header lines (if configured).
+As soon as a message's header lines have been received, all the envelope
+recipient addresses are permanently rewritten, and rewriting is also applied to
+the addresses in the header lines (if configured). This happens before adding
+any header lines that were specified in MAIL or RCPT ACLs, and
.cindex "&[local_scan()]& function" "address rewriting; timing of"
-Thus, all the rewriting is completed before the DATA ACL and
-&[local_scan()]& functions are run.
+before the DATA ACL and &[local_scan()]& functions are run.
When an address is being routed, either for delivery or for verification,
rewriting is applied immediately to child addresses that are generated by
redirection, unless &%no_rewrite%& is set on the router.
-.cindex "envelope sender" "rewriting"
+.cindex "envelope sender" "rewriting at transport time"
.cindex "rewriting" "at transport time"
+.cindex "header lines" "rewriting at transport time"
At transport time, additional rewriting of addresses in header lines can be
specified by setting the generic &%headers_rewrite%& option on a transport.
This option contains rules that are identical in form to those in the rewrite
-section of the configuration file. In addition, the outgoing envelope sender
-can be rewritten by means of the &%return_path%& transport option. However, it
-is not possible to rewrite envelope recipients at transport time.
+section of the configuration file. They are applied to the original message
+header lines and any that were added by ACLs or a system filter. They are not
+applied to header lines that are added by routers or the transport.
+
+The outgoing envelope sender can be rewritten by means of the &%return_path%&
+transport option. However, it is not possible to rewrite envelope recipients at
+transport time.
to be local. If the bang path addresses are received via SMTP, it is safer to
use the &"S"& flag to rewrite them as they are received, so that relay checking
can be done on the rewritten addresses.
+.ecindex IIDaddrew
. ////////////////////////////////////////////////////////////////////////////
.chapter "Retry configuration" "CHAPretry"
-.cindex "retry configuration" "description of"
-.cindex "configuration file" "retry section"
+.scindex IIDretconf1 "retry configuration" "description of"
+.scindex IIDregconf2 "configuration file" "retry section"
The &"retry"& section of the run time configuration file contains a list of
-retry rules which control how often Exim tries to deliver messages that cannot
+retry rules that control how often Exim tries to deliver messages that cannot
be delivered at the first attempt. If there are no retry rules, temporary
errors are treated as permanent. The &%-brt%& command line option can be used
-to test which retry rule will be used for a given address or domain.
+to test which retry rule will be used for a given address, domain and error.
The most common cause of retries is temporary failure to deliver to a remote
host because the host is down, or inaccessible because of a network problem.
subsequent delivery attempts from queue runs occur only when the retry time for
the local address is reached.
+.new
+.section "Changing retry rules"
+If you change the retry rules in your configuration, you should consider
+whether or not to delete the retry data that is stored in Exim's spool area in
+files with names like &_db/retry_&. Deleting any of Exim's hints files is
+always safe; that is why they are called &"hints"&.
+
+The hints retry data contains suggested retry times based on the previous
+rules. In the case of a long-running problem with a remote host, it might
+record the fact that the host has timed out. If your new rules increase the
+timeout time for such a host, you should definitely remove the old retry data
+and let Exim recreate it, based on the new rules. Otherwise Exim might bounce
+messages that it should now be retaining.
+.wen
+
-.section "Retry rules"
+.section "Format of retry rules"
.cindex "retry" "rules"
Each retry rule occupies one line and consists of three or four parts,
separated by white space: a pattern, an error name, an optional list of sender
The pattern is any single item that may appear in an address list (see section
&<<SECTaddresslist>>&). It is in fact processed as a one-item address list,
which means that it is expanded before being tested against the address that
-has been delayed. Address list processing treats a plain domain name as if it
-were preceded by &"*@"&, which makes it possible for many retry rules to start
-with just a domain. For example,
+has been delayed. &new("A negated address list item is permitted.") Address
+list processing treats a plain domain name as if it were preceded by &"*@"&,
+which makes it possible for many retry rules to start with just a domain. For
+example,
.code
lookingglass.fict.example * F,24h,30m;
.endd
&%retry_use_local_part%& is set for the transport (it defaults true for all
local transports).
-When Exim is looking for a retry rule after a remote delivery attempt has
-failed, what happens depends on the type of failure. After a 4&'xx'& SMTP
-response for a recipient address, the whole address is used when searching the
-retry rules. The rule that is found is used to create a retry time for the
-failing address.
+However, when Exim is looking for a retry rule after a remote delivery attempt
+suffers an address error (a 4&'xx'& SMTP response for a recipient address), the
+whole address is always used as the key when searching the retry rules. The
+rule that is found is used to create a retry time for the failing address.
-.section "Choosing which retry rule to use for host errors"
+.section "Choosing which retry rule to use for host and message errors"
For a temporary error that is not related to an individual address (for
example, a connection timeout), each line in the retry configuration is checked
twice. First, the name of the remote host is used as a domain name (preceded by
&'a.b.c.example'&, the second rule is used. The second rule is also used if
routing to &'a.b.c.example'& suffers a temporary failure.
-.new
&*Note*&: The host name is used when matching the patterns, not its IP address.
However, if a message is routed directly to an IP address without the use of a
host name, for example, if a &(manualroute)& router contains a setting such as:
.endd
then the &"host name"& that is used when searching for a retry rule is the
textual form of the IP address.
-.wen
.section "Retry rules for specific errors"
.cindex "retry" "specific errors; specifying"
Authentication failed when trying to send to a host in the
&%hosts_require_auth%& list in an &(smtp)& transport.
+.vitem &%data_4xx%&
+A 4&'xx'& error was received for an outgoing DATA command, either immediately
+after the command, or after sending the message's data.
+
+.vitem &%mail_4xx%&
+A 4&'xx'& error was received for an outgoing MAIL command.
+
.vitem &%rcpt_4xx%&
-A 4&'xx'& error was received for an outgoing RCPT command. Either the first or
-both of the x's can be given as specific digits, for example: &`rcpt_45x`& or
-&`rcpt_436`&. For example, to recognize 452 errors given to RCPT commands by a
-particular host, and have retries every ten minutes and a one-hour timeout, you
-could set up a retry rule of this form:
+A 4&'xx'& error was received for an outgoing RCPT command.
+.endlist
+
+For the three 4&'xx'& errors, either the first or both of the x's can be given
+as specific digits, for example: &`mail_45x`& or &`rcpt_436`&. For example, to
+recognize 452 errors given to RCPT commands for addresses in a certain domain,
+and have retries every ten minutes with a one-hour timeout, you could set up a
+retry rule of this form:
.code
-the.host.name rcpt_452 F,1h,10m
+the.domain.name rcpt_452 F,1h,10m
.endd
These errors apply to both outgoing SMTP (the &(smtp)& transport) and outgoing
LMTP (either the &(lmtp)& transport, or the &(smtp)& transport in LMTP mode).
-Note, however, that they apply only to responses to RCPT commands.
+
+.vlist
+.vitem &%lost_connection%&
+A server unexpectedly closed the SMTP connection. There may, of course,
+legitimate reasons for this (host died, network died), but if it repeats a lot
+for the same host, it indicates something odd.
.vitem &%refused_MX%&
A connection to a host obtained from an MX record was refused.
.vitem &%timeout%&
There was a timeout while connecting or during an SMTP session.
+.vitem &%tls_required%&
+The server was required to use TLS (it matched &%hosts_require_tls%& in the
+&(smtp)& transport), but either did not offer TLS, or it responded with 4&'xx'&
+to STARTTLS, or there was a problem setting up the TLS connection.
+
.vitem &%quota%&
A mailbox quota was exceeded in a local delivery by the &(appendfile)&
transport.
specific sender. In particular, this can be used to define retry rules that
apply only to bounce messages. The third item in a retry rule can be of this
form:
-.code
-senders=<address list>
+.display
+&`senders=`&<&'address list'&>
.endd
The retry timings themselves are then the fourth item. For example:
.code
* rcpt_4xx senders=: F,1h,30m
.endd
-matches 4&'xx'& errors for bounce messages sent to any host. If the address
-list contains white space, it must be enclosed in quotes. For example:
+matches recipient 4&'xx'& errors for bounce messages sent to any address at any
+host. If the address list contains white space, it must be enclosed in quotes.
+For example:
.code
-a.domain auth_failed senders="xb.dom : yc.dom" G,8h,10m,1.5
+a.domain rcpt_452 senders="xb.dom : yc.dom" G,8h,10m,1.5
.endd
-.new
&*Warning*&: This facility can be unhelpful if it is used for host errors
-(those that do not depend on the recipient). The reason is that the sender is
-used only to match the retry rule. Once the rule has been found for a host
-error, its contents are used to set a retry time for the host, and this will
-apply to all messages, not just those with specific senders.
-.wen
+(which do not depend on the recipient). The reason is that the sender is used
+only to match the retry rule. Once the rule has been found for a host error,
+its contents are used to set a retry time for the host, and this will apply to
+all messages, not just those with specific senders.
When testing retry rules using &%-brt%&, you can supply a sender using the
&%-f%& command line option, like this:
specifies a starting value for the interval, and the second a multiplier, which
is used to increase the size of the interval at each retry.
.next
-.new
&'H'&: retry at randomized intervals. The arguments are as for &'G'&. For each
retry, the previous interval is multiplied by the factor in order to get a
maximum for the next interval. The mininum interval is the first argument of
rule has been found to be helpful in cluster configurations when all the
members of the cluster restart at once, and may therefore synchronize their
queue processing times.
-.wen
.endlist
When computing the next retry time, the algorithm definitions are scanned in
.cindex "limit" "retry interval"
.cindex "retry interval" "maximum"
.cindex "&%retry_interval_max%&"
-&%retry_interval_max%& limits the maximum interval between retries.
+&%retry_interval_max%& limits the maximum interval between retries. It
+cannot be set greater than &`24h`&, which is its default value.
A single remote domain may have a number of hosts associated with it, and each
host may have more than one IP address. Retry algorithms are selected on the
deliver to permanently failing IP addresses than when &%delay_after_cutoff%& is
true.
+.section "Deliveries that work intermittently"
+.cindex "retry" "intermittently working deliveries"
+Some additional logic is needed to cope with cases where a host is
+intermittently available, or when a message has some attribute that prevents
+its delivery when others to the same address get through. In this situation,
+because some messages are successfully delivered, the &"retry clock"& for the
+host or address keeps getting reset by the successful deliveries, and so
+failing messages remain on the queue for ever because the cutoff time is never
+reached.
+
+Two exceptional actions are applied to prevent this happening. The first
+applies to errors that are related to a message rather than a remote host.
+Section &<<SECToutSMTPerr>>& has a discussion of the different kinds of error;
+examples of message-related errors are 4&'xx'& responses to MAIL or DATA
+commands, and quota failures. For this type of error, if a message's arrival
+time is earlier than the &"first failed"& time for the error, the earlier time
+is used when scanning the retry rules to decide when to try next and when to
+time out the address.
+
+The exceptional second action applies in all cases. If a message has been on
+the queue for longer than the cutoff time of any applicable retry rule for a
+given address, a delivery is attempted for that address, even if it is not yet
+time, and if this delivery fails, the address is timed out. A new retry time is
+not computed in this case, so that other messages for the same address are
+considered immediately.
+.ecindex IIDretconf1
+.ecindex IIDregconf2
-.section "Ultimate address timeout"
-.cindex "retry" "ultimate address timeout"
-An additional rule is needed to cope with cases where a host is intermittently
-available, or when a message has some attribute that prevents its delivery when
-others to the same address get through. In this situation, because some
-messages are successfully delivered, the &"retry clock"& for the address keeps
-getting restarted, and so a message could remain on the queue for ever. To
-prevent this, if a message has been on the queue for longer than the cutoff
-time of any applicable retry rule for a given address, a delivery is attempted
-for that address, even if it is not yet time, and if this delivery fails, the
-address is timed out. A new retry time is not computed in this case, so that
-other messages for the same address are considered immediately.
. ////////////////////////////////////////////////////////////////////////////
.chapter "SMTP authentication" "CHAPSMTPAUTH"
-.cindex "SMTP" "authentication configuration"
-.cindex "authentication"
+.scindex IIDauthconf1 "SMTP" "authentication configuration"
+.scindex IIDauthconf2 "authentication"
The &"authenticators"& section of Exim's run time configuration is concerned
with SMTP authentication. This facility is an extension to the SMTP protocol,
described in RFC 2554, which allows a client SMTP host to authenticate itself
cram:
driver = cram_md5
public_name = CRAM-MD5
- server_secret = ${if eq{$1}{ph10}{secret1}fail}
+ server_secret = ${if eq{$auth1}{ph10}{secret1}fail}
client_name = ph10
client_secret = secret2
.endd
&%qualify_domain%& is treated as authenticated. However, if the
&%authenticated_sender%& option is set on the &(smtp)& transport, it overrides
the authenticated sender that was received with the message.
+.ecindex IIDauthconf1
+.ecindex IIDauthconf2
. ////////////////////////////////////////////////////////////////////////////
.chapter "The plaintext authenticator" "CHAPplaintext"
-.cindex "&(plaintext)& authenticator"
-.cindex "authenticators" "&(plaintext)&"
+.scindex IIDplaiauth1 "&(plaintext)& authenticator"
+.scindex IIDplaiauth2 "authenticators" "&(plaintext)&"
The &(plaintext)& authenticator can be configured to support the PLAIN and
LOGIN authentication mechanisms, both of which transfer authentication data as
plain (unencrypted) text (though base64 encoded). The use of plain text is a
-security risk. If you use one of these mechanisms without also making use of
-SMTP encryption (see chapter &<<CHAPTLS>>&) you should not use the same
-passwords for SMTP connections as you do for login accounts.
-
+security risk; you are strongly advised to insist on the use of SMTP encryption
+(see chapter &<<CHAPTLS>>&) if you use the PLAIN or LOGIN mechanisms. If you do
+use unencrypted plain text, you should not use the same passwords for SMTP
+connections as you do for login accounts.
.section "Using plaintext in a server"
.cindex "options" "&(plaintext)& authenticator (server)"
.cindex "binary zero" "in &(plaintext)& authenticator"
.cindex "numerical variables (&$1$& &$2$& etc)" &&&
"in &(plaintext)& authenticator"
+.cindex "&$auth1$&, &$auth2$&, etc"
.cindex "base64 encoding" "in &(plaintext)& authenticator"
The data sent by the client with the AUTH command, or in response to
subsequent prompts, is base64 encoded, and so may contain any byte values
when decoded. If any data is supplied with the command, it is treated as a
-list of strings, separated by NULs (binary zeros), which are placed in the
-expansion variables &$1$&, &$2$&, etc. If there are more strings in
-&%server_prompts%& than the number of strings supplied with the AUTH
-command, the remaining prompts are used to obtain more data. Each response from
-the client may be a list of NUL-separated strings.
+list of strings, separated by NULs (binary zeros), the first three of which are
+placed in the expansion variables &$auth1$&, &$auth2$&, and &$auth3$& (neither
+LOGIN nor PLAIN uses more than three strings).
+
+For compatibility with previous releases of Exim, the values are also placed in
+the expansion variables &$1$&, &$2$&, and &$3$&. However, the use of these
+variables for this purpose is now deprecated, as it can lead to confusion in
+string expansions that also use them for other things.
+
+If there are more strings in &%server_prompts%& than the number of strings
+supplied with the AUTH command, the remaining prompts are used to obtain more
+data. Each response from the client may be a list of NUL-separated strings.
.cindex "&$authenticated_id$&"
Once a sufficient number of data strings have been received,
public_name = PLAIN
server_prompts = :
server_condition = \
- ${if and {{eq{$2}{username}}{eq{$3}{mysecret}}}{yes}{no}}
- server_set_id = $2
+ ${if and {{eq{$auth2}{username}}{eq{$auth3}{mysecret}}}}
+ server_set_id = $auth2
.endd
+.new
+Note that the default result strings from &%if%& (&"true"& or an empty string)
+are exactly what we want here, so they need not be specified. Obviously, if the
+password contains expansion-significant characters such as dollar, backslash,
+or closing brace, they have to be escaped.
+.wen
+
The &%server_prompts%& setting specifies a single, empty prompt (empty items at
the end of a string list are ignored). If all the data comes as part of the
AUTH command, as is commonly the case, the prompt is not used. This
authenticating clients it could make sense.
A more sophisticated instance of this authenticator could use the user name in
-&$2$& to look up a password in a file or database, and maybe do an encrypted
+&$auth2$& to look up a password in a file or database, and maybe do an encrypted
comparison (see &%crypteq%& in chapter &<<CHAPexpand>>&). Here is a example of
this approach, where the passwords are looked up in a DBM file. &*Warning*&:
This is an incorrect example:
+.new
.code
server_condition = \
- ${if eq{$3}{${lookup{$2}dbm{/etc/authpwd}}}{yes}{no}}
+ ${if eq{$auth3}{${lookup{$auth2}dbm{/etc/authpwd}}}}
.endd
-The expansion uses the user name (&$2$&) as the key to look up a password,
-which it then compares to the supplied password (&$3$&). Why is this example
+.wen
+The expansion uses the user name (&$auth2$&) as the key to look up a password,
+which it then compares to the supplied password (&$auth3$&). Why is this example
incorrect? It works fine for existing users, but consider what happens if a
non-existent user name is given. The lookup fails, but as no success/failure
strings are given for the lookup, it yields an empty string. Thus, to defeat
the authentication, all a client has to do is to supply a non-existent user
name and an empty password. The correct way of writing this test is:
+.new
.code
-server_condition = ${lookup{$2}dbm{/etc/authpwd}\
- {${if eq{$value}{$3}{yes}{no}}}{no}}
+server_condition = ${lookup{$auth2}dbm{/etc/authpwd}\
+ {${if eq{$value}{$auth3}}} {false}}
.endd
In this case, if the lookup succeeds, the result is checked; if the lookup
-fails, authentication fails. If &%crypteq%& is being used instead of &%eq%&,
-the first example is in fact safe, because &%crypteq%& always fails if its
-second argument is empty. However, the second way of writing the test makes the
-logic clearer.
-
+fails, &"false"& is returned and authentication fails. If &%crypteq%& is being
+used instead of &%eq%&, the first example is in fact safe, because &%crypteq%&
+always fails if its second argument is empty. However, the second way of
+writing the test makes the logic clearer.
+.wen
.section "The LOGIN authentication mechanism"
public_name = LOGIN
server_prompts = User Name : Password
server_condition = \
- ${if and {{eq{$1}{username}}{eq{$2}{mysecret}}}{yes}{no}}
- server_set_id = $1
+ ${if and {{eq{$auth1}{username}}{eq{$auth2}{mysecret}}}}
+ server_set_id = $auth1
.endd
Because of the way plaintext operates, this authenticator accepts data supplied
with the AUTH command (in contravention of the specification of LOGIN), but
public_name = LOGIN
server_prompts = Username:: : Password::
server_condition = ${if ldapauth \
- {user="cn=${quote_ldap_dn:$1},ou=people,o=example.org" \
- pass=${quote:$2} \
- ldap://ldap.example.org/}{yes}{no}}
- server_set_id = uid=$1,ou=people,o=example.org
+ {user="cn=${quote_ldap_dn:$auth1},ou=people,o=example.org" \
+ pass=${quote:$auth2} \
+ ldap://ldap.example.org/}}
+ server_set_id = uid=$auth1,ou=people,o=example.org
.endd
Note the use of the &%quote_ldap_dn%& operator to correctly quote the DN for
authentication. However, the basic &%quote%& operator, rather than any of the
A number of string expansion features are provided for the purpose of
interfacing to different ways of user authentication. These include checking
traditionally encrypted passwords from &_/etc/passwd_& (or equivalent), PAM,
-Radius, &%ldapauth%&, and &'pwcheck'&. For details see section
+Radius, &%ldapauth%&, &'pwcheck'&, and &'saslauthd'&. For details see section
&<<SECTexpcond>>&.
.section "Using plaintext in a client"
.cindex "options" "&(plaintext)& authenticator (client)"
-The &(plaintext)& authenticator has just one client option:
-
+The &(plaintext)& authenticator has two client options:
+.option client_ignore_invalid_base64 plaintext boolean false
+If the client receives a server prompt that is not a valid base64 string,
+authentication is abandoned by default. However, if this option is set true,
+the error in the challenge is ignored and the client sends the response as
+usual.
.option client_send plaintext string&!! unset
The string is a colon-separated list of authentication data strings. Each
string is independently expanded before being sent to the server. The first
string is sent with the AUTH command; any more strings are sent in response
-to prompts from the server.
+to prompts from the server. Before each string is expanded, the value of the
+most recent prompt is placed in the next &$auth$&<&'n'&> variable, starting
+with &$auth1$& for the first prompt. Up to three prompts are stored in this
+way. Thus, the prompt that is received in response to sending the first string
+(with the AUTH command) can be used in the expansion of the second string, and
+so on. If an invalid base64 string is received when
+&%client_ignore_invalid_base64%& is set, an empty string is put in the
+&$auth$&<&'n'&> variable.
&*Note*&: You cannot use expansion to create multiple strings, because
splitting takes priority and happens first.
The initial colon means that the first string is empty, so no data is sent with
the AUTH command itself. The remaining strings are sent in response to
prompts.
+.ecindex IIDplaiauth1
+.ecindex IIDplaiauth2
. ////////////////////////////////////////////////////////////////////////////
.chapter "The cram_md5 authenticator"
-.cindex "&(cram_md5)& authenticator"
-.cindex "authenticators" "&(cram_md5)&"
+.scindex IIDcramauth1 "&(cram_md5)& authenticator"
+.scindex IIDcramauth2 "authenticators" "&(cram_md5)&"
.cindex "CRAM-MD5 authentication mechanism"
.cindex "authentication" "CRAM-MD5 mechanism"
The CRAM-MD5 authentication mechanism is described in RFC 2195. The server
.option server_secret cram_md5 string&!! unset
.cindex "numerical variables (&$1$& &$2$& etc)" "in &(cram_md5)& authenticator"
When the server receives the client's response, the user name is placed in
-the expansion variable &$1$&, and &%server_secret%& is expanded to obtain the
-password for that user. The server then computes the CRAM-MD5 digest that the
-client should have sent, and checks that it received the correct string. If the
-expansion of &%server_secret%& is forced to fail, authentication fails. If the
-expansion fails for some other reason, a temporary error code is returned to
-the client.
+the expansion variable &$auth1$&, and &%server_secret%& is expanded to
+obtain the password for that user. The server then computes the CRAM-MD5 digest
+that the client should have sent, and checks that it received the correct
+string. If the expansion of &%server_secret%& is forced to fail, authentication
+fails. If the expansion fails for some other reason, a temporary error code is
+returned to the client.
+
+For compatibility with previous releases of Exim, the user name is also placed
+in &$1$&. However, the use of this variables for this purpose is now
+deprecated, as it can lead to confusion in string expansions that also use
+numeric variables for other things.
For example, the following authenticator checks that the user name given by the
client is &"ph10"&, and if so, uses &"secret"& as the password. For any other
fixed_cram:
driver = cram_md5
public_name = CRAM-MD5
- server_secret = ${if eq{$1}{ph10}{secret}fail}
- server_set_id = $1
+ server_secret = ${if eq{$auth1}{ph10}{secret}fail}
+ server_set_id = $auth1
.endd
.cindex "&$authenticated_id$&"
If authentication succeeds, the setting of &%server_set_id%& preserves the user
lookup_cram:
driver = cram_md5
public_name = CRAM-MD5
- server_secret = ${lookup{$1}lsearch{/etc/authpwd}{$value}fail}
- server_set_id = $1
+ server_secret = ${lookup{$auth1}lsearch{/etc/authpwd}{$value}fail}
+ server_set_id = $auth1
.endd
Note that this expansion explicitly forces failure if the lookup fails
because &$1$& contains an unknown user name.
client_name = ph10
client_secret = secret
.endd
+.ecindex IIDcramauth1
+.ecindex IIDcramauth2
. ////////////////////////////////////////////////////////////////////////////
.chapter "The cyrus_sasl authenticator"
-.cindex "&(cyrus_sasl)& authenticator"
-.cindex "authenticators" "&(cyrus_sasl)&"
+.scindex IIDcyrauth1 "&(cyrus_sasl)& authenticator"
+.scindex IIDcyrauth2 "authenticators" "&(cyrus_sasl)&"
.cindex "Cyrus" "SASL library"
The code for this authenticator was provided by Matthew Byng-Maddick of A L
Digital Ltd (&url(http://www.aldigital.co.uk)).
.section "Using cyrus_sasl as a server"
-The &(cyrus_sasl)& authenticator has four private options. It puts the
-username (on a successful authentication) into &$1$&.
+The &(cyrus_sasl)& authenticator has four private options. It puts the username
+(on a successful authentication) into &$auth1$&. For compatibility with
+previous releases of Exim, the username is also placed in &$1$&. However, the
+use of this variable for this purpose is now deprecated, as it can lead to
+confusion in string expansions that also use numeric variables for other
+things.
+
.option server_hostname cyrus_sasl string&!! &`$primary_hostname`&
This option selects the hostname that is used when communicating with
driver = cyrus_sasl
public_name = X-ANYTHING
server_mech = CRAM-MD5
- server_set_id = $1
+ server_set_id = $auth1
.endd
.option server_realm cyrus_sasl string unset
sasl_cram_md5:
driver = cyrus_sasl
public_name = CRAM-MD5
- server_set_id = $1
+ server_set_id = $auth1
sasl_plain:
driver = cyrus_sasl
public_name = PLAIN
- server_set_id = $1
+ server_set_id = $auth1
.endd
Cyrus SASL does implement the LOGIN authentication method, even though it is
not a standard method. It is disabled by default in the source distribution,
but it is present in many binary distributions.
+.ecindex IIDcyrauth1
+.ecindex IIDcyrauth2
. ////////////////////////////////////////////////////////////////////////////
. ////////////////////////////////////////////////////////////////////////////
-.chapter "The spa authenticator"
-.cindex "&(spa)& authenticator"
-.cindex "authenticators" "&(spa)&"
+.chapter "The spa authenticator" "CHAPspa"
+.scindex IIDspaauth1 "&(spa)& authenticator"
+.scindex IIDspaauth2 "authenticators" "&(spa)&"
.cindex "authentication" "Microsoft Secure Password"
.cindex "authentication" "NTLM"
.cindex "Microsoft Secure Password Authentication"
.option server_password spa string&!! unset
.cindex "numerical variables (&$1$& &$2$& etc)" "in &(spa)& authenticator"
This option is expanded, and the result must be the cleartext password for the
-authenticating user, whose name is at this point in &$1$&. For example:
+authenticating user, whose name is at this point in &$auth1$&. For
+compatibility with previous releases of Exim, the user name is also placed in
+&$1$&. However, the use of this variable for this purpose is now deprecated, as
+it can lead to confusion in string expansions that also use numeric variables
+for other things. For example:
.code
spa:
driver = spa
public_name = NTLM
- server_password = ${lookup{$1}lsearch{/etc/exim/spa_clearpass}\
- {$value}fail}
+ server_password = \
+ ${lookup{$auth1}lsearch{/etc/exim/spa_clearpass}{$value}fail}
.endd
If the expansion is forced to fail, authentication fails. Any other expansion
failure causes a temporary error code to be returned.
client_password = msn_plaintext_password
client_domain = DOMAIN_OR_UNSET
.endd
+.ecindex IIDspaauth1
+.ecindex IIDspaauth2
.chapter "Encrypted SMTP connections using TLS/SSL" "CHAPTLS" &&&
"Encrypted SMTP connections"
-.cindex "encryption" "on SMTP connection"
-.cindex "SMTP" "encryption"
+.scindex IIDencsmtp1 "encryption" "on SMTP connection"
+.scindex IIDencsmtp2 "SMTP" "encryption"
.cindex "TLS" "on SMTP connection"
.cindex "OpenSSL"
.cindex "GnuTLS"
this simultaneously (apart from wasting a few resources). Once a file is in
place, new Exim processes immediately start using it.
-.new
For maximum security, the parameters that are stored in this file should be
recalculated periodically, the frequency depending on your paranoia level.
Arranging this is easy in principle; just delete the file when you want new
.endd
If Exim never has to generate the parameters itself, the possibility of
stalling is removed.
-.wen
.section "Requiring specific ciphers in OpenSSL" "SECTreqciphssl"
tls_certificate = /some/file/name
tls_privatekey = /some/file/name
.endd
-The first file contains the server's X509 certificate, and the second contains
-the private key that goes with it. These files need to be readable by the Exim
-user, and must always be given as full path names. They can be the same file if
-both the certificate and the key are contained within it. If &%tls_privatekey%&
-is not set, this is assumed to be the case. The certificate file may also
-contain intermediate certificates that need to be sent to the client to enable
-it to authenticate the server's certificate.
+These options are, in fact, expanded strings, so you can make them depend on
+the identity of the client that is connected if you wish. The first file
+contains the server's X509 certificate, and the second contains the private key
+that goes with it. These files need to be readable by the Exim user, and must
+always be given as full path names. They can be the same file if both the
+certificate and the key are contained within it. If &%tls_privatekey%& is not
+set, or if its expansion is forced to fail or results in an empty string, this
+is assumed to be the case. The certificate file may also contain intermediate
+certificates that need to be sent to the client to enable it to authenticate
+the server's certificate.
If you do not understand about certificates and keys, please try to find a
source of this background information, which is not Exim-specific. (There are a
few comments below in section &<<SECTcerandall>>&.)
&*Note*&: These options do not apply when Exim is operating as a client &--
-they apply only in the case of a server. For a client, you must set the options
-of the same name in an &(smtp)& transport.
+they apply only in the case of a server. If you need to use a certificate in an
+Exim client, you must set the options of the same names in an &(smtp)&
+transport.
-With just these options, Exim will work as a server with clients such as
-Netscape. It does not require the client to have a certificate (but see below
-for how to insist on this). There is one other option that may be needed in
-other situations. If
+With just these options, an Exim server will be able to use TLS. It does not
+require the client to have a certificate (but see below for how to insist on
+this). There is one other option that may be needed in other situations. If
.code
tls_dhparam = /some/file/name
.endd
.code
openssl dhparam
.endd
-for a way of generating this data.
-At present, &%tls_dhparam%& is used only when Exim is linked with OpenSSL. It
-is ignored if GnuTLS is being used.
+for a way of generating this data. At present, &%tls_dhparam%& is used only
+when Exim is linked with OpenSSL. It is ignored if GnuTLS is being used.
The strings supplied for these three options are expanded every time a client
host connects. It is therefore possible to use different certificates and keys
user certificates, see the &'General implementation overview'& chapter of the
Open-source PKI book, available online at
&url(http://ospkibook.sourceforge.net/).
+.ecindex IIDencsmtp1
+.ecindex IIDencsmtp2
. ////////////////////////////////////////////////////////////////////////////
.chapter "Access control lists" "CHAPACL"
-.cindex "&ACL;" "description"
+.scindex IIDacl "&ACL;" "description"
.cindex "control of incoming mail"
.cindex "message" "controlling incoming"
.cindex "policy control" "access control lists"
.cindex "STARTTLS" "ACL for"
.cindex "VRFY" "ACL for"
.cindex "SMTP connection" "ACL for"
-.cindex "non-smtp message" "ACL for"
+.cindex "non-smtp message" "ACLs for"
+.cindex "MIME parts" "ACL for"
.table2 140pt
.row &~&%acl_not_smtp%& "ACL for non-SMTP messages"
+.new
+.row &~&%acl_not_smtp_mime%& "ACL for non-SMTP MIME parts"
+.row &~&%acl_not_smtp_start%& "ACL at start of non-SMTP message"
+.wen
.row &~&%acl_smtp_auth%& "ACL for AUTH"
.row &~&%acl_smtp_connect%& "ACL for start of SMTP connection"
.row &~&%acl_smtp_data%& "ACL after DATA is complete"
testing as possible at RCPT time.
-.section "The non-SMTP ACL"
-.cindex "non-smtp message" "ACL for"
-The non-SMTP ACL applies to all non-interactive incoming messages, that is, it
-applies to batch SMTP as well as to non-SMTP messages. (Batch SMTP is not
-really SMTP.) This ACL is run just before the &[local_scan()]& function. Any
+.new
+.section "The non-SMTP ACLs"
+.cindex "non-smtp message" "ACLs for"
+The non-SMTP ACLs apply to all non-interactive incoming messages, that is, they
+apply to batched SMTP as well as to non-SMTP messages. (Batched SMTP is not
+really SMTP.) Many of the ACL conditions (for example, host tests, and tests on
+the state of the SMTP connection such as encryption and authentication) are not
+relevant and are forbidden in these ACLs. However, the sender and recipients
+are known, so the &%senders%& and &%sender_domains%& conditions and the
+&$sender_address$& and &$recipients$& variables can be used. Variables such as
+&$authenticated_sender$& are also available. You can specify added header lines
+in any of these ACLs.
+
+The &%acl_not_smtp_start%& ACL is run right at the start of receiving a
+non-SMTP message, before any of the message has been read. (This is the
+analogue of the &%acl_smtp_predata%& ACL for SMTP input.) The result of this
+ACL is ignored; it cannot be used to reject a message. If you really need to,
+you could set a value in an ACL variable here and reject based on that in the
+&%acl_not_smtp%& ACL. However, this ACL can be used to set controls, and in
+particular, it can be used to set
+.code
+control = suppress_local_fixups
+.endd
+This cannot be used in the other non-SMTP ACLs because by the time they are
+run, it is too late.
+
+The &%acl_not_smtp_mime%& ACL is available only when Exim is compiled with the
+content-scanning extension. For details, see chapter &<<CHAPexiscan>>&.
+
+The &%acl_not_smtp%& ACL is run just before the &[local_scan()]& function. Any
kind of rejection is treated as permanent, because there is no way of sending a
-temporary error for these kinds of message. Many of the ACL conditions (for
-example, host tests, and tests on the state of the SMTP connection such as
-encryption and authentication) are not relevant and are forbidden in this ACL.
+temporary error for these kinds of message.
-.section "The connect ACL"
+.section "The SMTP connect ACL"
.cindex "SMTP connection" "ACL for"
-The ACL test specified by &%acl_smtp_connect%& happens after the test specified
-by &%host_reject_connection%& (which is now an anomaly) and any TCP Wrappers
-testing (if configured).
+The ACL test specified by &%acl_smtp_connect%& happens at the start of an SMTP
+session, after the test specified by &%host_reject_connection%& (which is now
+an anomaly) and any TCP Wrappers testing (if configured).
+.wen
.section "The DATA ACLs"
your resources.
-.section "The MIME ACL"
+.section "The SMTP MIME ACL"
The &%acl_smtp_mime%& option is available only when Exim is compiled with the
content-scanning extension. For details, see chapter &<<CHAPexiscan>>&.
messages, recipients, etc., and log the totals at QUIT time using one or
more &%logwrite%& modifiers on a &%warn%& verb.
-.new
&*Warning*&: Only the &$acl_c$&&'x'& variables can be used for this, because
the &$acl_m$&&'x'& variables are reset at the end of each incoming message.
-.wen
You do not need to have a final &%accept%&, but if you do, you can use a
&%message%& modifier to specify custom text that is sent as part of the 221
.section "Finding an ACL to use"
.cindex "&ACL;" "finding which to use"
-The value of an &%acl_smtp_%&&'xxx'& option is expanded before use, so you can
-use different ACLs in different circumstances. The resulting string does not
-have to be the name of an ACL in the configuration file; there are other
-possibilities. Having expanded the string, Exim searches for an ACL as follows:
+The value of an &%acl_smtp_%&&'xxx'& option is expanded before use, so
+you can use different ACLs in different circumstances. For example,
+.code
+acl_smtp_rcpt = ${if ={25}{$interface_port} \
+ {acl_check_rcpt} {acl_check_rcpt_submit} }
+.endd
+In the default configuration file there are some example settings for
+providing an RFC 4409 message submission service on port 587 and a
+non-standard &"smtps"& service on port 465. You can use a string
+expansion like this to choose an ACL for MUAs on these ports which is
+more appropriate for this purpose than the default ACL on port 25.
+
+The expanded string does not have to be the name of an ACL in the
+configuration file; there are other possibilities. Having expanded the
+string, Exim searches for an ACL as follows:
.ilist
If the string begins with a slash, Exim uses it as a file name, and reads its
not defined at all. For any defined ACL, the default action when control
reaches the end of the ACL statements is &"deny"&.
+.new
+For &%acl_smtp_quit%& and &%acl_not_smtp_start%& there is no default because
+these two are ACLs that are used only for their side effects. They cannot be
+used to accept or reject anything.
+.wen
+
For &%acl_not_smtp%&, &%acl_smtp_auth%&, &%acl_smtp_connect%&,
&%acl_smtp_data%&, &%acl_smtp_helo%&, &%acl_smtp_mail%&, &%acl_smtp_mailauth%&,
-&%acl_smtp_mime%&, &%acl_smtp_predata%&, &%acl_smtp_quit%&, and
-&%acl_smtp_starttls%&, the action when the ACL is not defined is &"accept"&.
+&%acl_smtp_mime%&, &%acl_smtp_predata%&, and &%acl_smtp_starttls%&, the action
+when the ACL is not defined is &"accept"&.
For the others (&%acl_smtp_etrn%&, &%acl_smtp_expn%&, &%acl_smtp_rcpt%&, and
&%acl_smtp_vrfy%&), the action when the ACL is not defined is &"deny"&.
that contain information about the host and the message's sender (for example,
&$sender_host_address$& and &$sender_address$&) are set, and can be used in ACL
statements. In the case of RCPT (but not MAIL or DATA), &$domain$& and
-&$local_part$& are set from the argument address. &new("The entire SMTP command
-is available in &$smtp_command$&.")
+&$local_part$& are set from the argument address. The entire SMTP command
+is available in &$smtp_command$&.
When an ACL for the AUTH parameter of MAIL is running, the variables that
contain information about the host are set, but &$sender_address$& is not yet
.cindex &$smtp_command$&
When an ACL is being run for AUTH, EHLO, ETRN, EXPN, HELO, STARTTLS, or VRFY,
the remainder of the SMTP command line is placed in &$smtp_command_argument$&,
-&new("and the entire SMTP command is available in &$smtp_command$&.")
+and the entire SMTP command is available in &$smtp_command$&.
These variables can be tested using a &%condition%& condition. For example,
here is an ACL for use with AUTH, which insists that either the session is
encrypted, or the CRAM-MD5 authentication method is used. In other words, it
verified. Otherwise, it rejects the command.
.next
+.new
.cindex "&%warn%&" "ACL verb"
-&%warn%&: If all the conditions are met, a header line is added to an incoming
-message and/or a line is written to Exim's main log. In all cases, control
-passes to the next ACL statement. The text of the added header line and the log
-line are specified by modifiers; if they are not present, a &%warn%& verb just
-checks its conditions and obeys any &"immediate"& modifiers such as &%set%& and
-&%logwrite%&. There is more about adding header lines in section
-&<<SECTaddheadwarn>>&.
+&%warn%&: If all the conditions are true, a line specified by the
+&%log_message%& modifier is written to Exim's main log. Control always passes
+to the next ACL statement. If any condition is false, the log line is not
+written. If an identical log line is requested several times in the same
+message, only one copy is actually written to the log. If you want to force
+duplicates to be written, use the &%logwrite%& modifier instead.
+
+If &%log_message%& is not present, a &%warn%& verb just checks its conditions
+and obeys any &"immediate"& modifiers (such as &%control%&, &%set%&,
+&%logwrite%&, and &%add_header%&) that appear before any failing conditions.
+There is more about adding header lines in section &<<SECTaddheadacl>>&.
If any condition on a &%warn%& statement cannot be completed (that is, there is
-some sort of defer), no header lines are added and the configured log line is
-not written. No further conditions or modifiers in the &%warn%& statement are
-processed. The incident is logged, but the ACL continues to be processed, from
-the next statement onwards.
-
-If a &%message%& modifier is present on a &%warn%& verb in an ACL that is not
-testing an incoming message, it is ignored, and the incident is logged.
+some sort of defer), the log line specified by &%log_message%& is not written.
+No further conditions or modifiers in the &%warn%& statement are processed. The
+incident is logged, and the ACL continues to be processed, from the next
+statement onwards.
+.wen
-A &%warn%& statement may use the &%log_message%& modifier to cause a line to be
-written to the main log when the statement's conditions are true.
-If an identical log line is requested several times in the same message, only
-one copy is actually written to the log. If you want to force duplicates to be
-written, use the &%logwrite%& modifier instead.
.cindex "&$acl_verify_message$&"
When one of the &%warn%& conditions is an address verification that fails, the
of these variables:
.ilist
-The values of &$acl_c0$& to &$acl_c9$& persist throughout an SMTP connection.
-They are never reset. Thus, a value that is set while receiving one message is
-still available when receiving the next message on the same SMTP connection.
+The values of &$acl_c0$& to &$acl_c19$& persist throughout an SMTP
+connection. They are never reset. Thus, a value that is set while receiving one
+message is still available when receiving the next message on the same SMTP
+connection.
.next
-The values of &$acl_m0$& to &$acl_m9$& persist only while a message is being
-received. They are reset afterwards. They are also reset by MAIL, RSET,
+The values of &$acl_m0$& to &$acl_m19$& persist only while a message is
+being received. They are reset afterwards. They are also reset by MAIL, RSET,
EHLO, HELO, and after starting up a TLS session.
.endlist
When a message is accepted, the current values of all the ACL variables are
preserved with the message and are subsequently made available at delivery
-time. The ACL variables are set by modifier called &%set%&. For example:
+time. The ACL variables are set by a modifier called &%set%&. For example:
.code
accept hosts = whatever
set acl_m4 = some value
deny domains = *.dom.example
!verify = recipient
.endd
-.new
causes the ACL to return &"deny"& if the recipient domain ends in
&'dom.example'& and the recipient address cannot be verified. Sometimes
negation can be used on the right-hand side of a condition. For example, these
.endd
However, for many conditions (&%verify%& being a good example), only left-hand
side negation of the whole condition is possible.
-.wen
The arguments of conditions and modifiers are expanded. A forced failure
of an expansion causes a condition to be ignored, that is, it behaves as if the
The ACL modifiers are as follows:
.vlist
+.vitem &*add_header*&&~=&~<&'text'&>
+This modifier specifies one or more header lines that are to be added to an
+incoming message, assuming, of course, that the message is ultimately
+accepted. For details, see section &<<SECTaddheadacl>>&.
+
.vitem &*control*&&~=&~<&'text'&>
.cindex "&%control%&" "ACL modifier"
This modifier affects the subsequent processing of the SMTP connection or of an
the modifier is ignored. For ACLs that are triggered by SMTP commands, the
message is returned as part of the SMTP error response.
-The &%message%& modifier is also used with the &%warn%& verb to specify one or
-more header lines to be added to an incoming message when all the conditions
-are true. See section &<<SECTaddheadwarn>>& for more details. If &%message%& is
-used with &%warn%& in an ACL that is not concerned with receiving a message, it
-has no effect.
+.new
+.cindex "SMTP" "error codes"
+By default, Exim uses a 550 SMTP code when it denies access. However, if the
+message starts with three digits followed by a space, optionally followed by an
+extended code of the form &'n.n.n'&, also followed by a space, and the very
+first digit is the same as the default error code, the code from the message is
+used instead. If the very first digit is incorrect, a panic error is logged,
+and the default code is used.
+.wen
The text is literal; any quotes are taken as literals, but because the string
is expanded, backslash escapes are processed anyway. If the message contains
routers to be passed back as part of the SMTP response, you should either not
use a &%message%& modifier, or make use of &$acl_verify_message$&.
+For compatibility with previous releases of Exim, a &%message%& modifier that
+is used with a &%warn%& verb behaves in a similar way to the &%add_header%&
+modifier, but this usage is now deprecated. However, &%message%& acts only when
+all the conditions are true, wherever it appears in an ACL command, whereas
+&%add_header%& acts as soon as it is encountered. If &%message%& is used with
+&%warn%& in an ACL that is not concerned with receiving a message, it has no
+effect.
+
.vitem &*set*&&~<&'acl_name'&>&~=&~<&'value'&>
.cindex "&%set%&" "ACL modifier"
This modifier puts a value into one of the ACL variables (see section
+
+
.section "Use of the control modifier" "SECTcontrols"
.cindex "&%control%&" "ACL modifier"
The &%control%& modifier supports the following settings:
.vlist
+.vitem &*control&~=&~allow_auth_unadvertised*&
+This modifier allows a client host to use the SMTP AUTH command even when it
+has not been advertised in response to EHLO. Furthermore, because there are
+apparently some really broken clients that do this, Exim will accept AUTH after
+HELO (rather than EHLO) when this control is set. It should be used only if you
+really need it, and you should limit its use to those broken clients that do
+not work without it. For example:
+.code
+warn hosts = 192.168.34.25
+ control = allow_auth_unadvertised
+.endd
+Normally, when an Exim server receives an AUTH command, it checks the name of
+the authentication mechanism that is given in the command to ensure that it
+matches an advertised mechanism. When this control is set, the check that a
+mechanism has been advertised is bypassed. Any configured mechanism can be used
+by the client. This control is permitted only in the connection and HELO ACLs.
+
+
.vitem &*control&~=&~caseful_local_part*&
See below.
work with.
-.new
.vitem &*control&~=&~fakedefer/*&<&'message'&>
.cindex "fake defer"
.cindex "defer" "fake"
550 response. You must take care when using &%fakedefer%& because it causes the
messages to be duplicated when the sender retries. Therefore, you should not
use &%fakedefer%& if the message is to be delivered normally.
-.wen
.vitem &*control&~=&~fakereject/*&<&'message'&>
.cindex "fake rejection"
current message, not to any subsequent ones that may be received in the same
SMTP connection.
+This modifier can optionally be followed by &`/no_tell`&. If the global option
+&%freeze_tell%& is set, it is ignored for the current message (that is, nobody
+is told about the freezing), provided all the &*control=freeze*& modifiers that
+are obeyed for the current message have the &`/no_tell`& option.
+
+
.vitem &*control&~=&~no_mbox_unspool*&
This control is available when Exim is compiled with the content scanning
extension. Content scanning may require a copy of the current message, or parts
The control applies only to the current message, not to any subsequent ones
that may be received in the same SMTP connection.
-.new
.vitem &*control&~=&~suppress_local_fixups*&
.cindex "submission fixups" "suppressing"
This control applies to locally submitted (non TCP/IP) messages, and is the
There is no check that &'From:'& corresponds to the actual sender.
.endlist ilist
-This feature may be useful when a remotely-originated message is accepted,
-passed to some scanning program, and then re-submitted for delivery.
+.new
+This control may be useful when a remotely-originated message is accepted,
+passed to some scanning program, and then re-submitted for delivery. It can be
+used only in the &%acl_smtp_mail%&, &%acl_smtp_rcpt%&, &%acl_smtp_predata%&,
+and &%acl_not_smtp_start%& ACLs, because it has to be set before the message's
+data is read.
+.wen
.endlist vlist
All four possibilities for message fixups can be specified:
.next
Remotely submitted, fixups applied: use &`control`& &`=`& &`submission`&.
.endlist
-.wen
-
-.section "Adding header lines with the warn verb" "SECTaddheadwarn"
+.section "Adding header lines in ACLs" "SECTaddheadacl"
.cindex "header lines" "adding in an ACL"
.cindex "header lines" "position of added lines"
-.cindex "&%warn%&" "ACL verb"
.cindex "&%message%&" "ACL modifier"
-The &%message%& modifier can be used on a &%warn%& statement to add an extra
-header line to an incoming message, as in this example:
+The &%add_header%& modifier can be used to add one or more extra header lines
+to an incoming message, as in this example:
.code
-warn message = X-blacklisted-at: $dnslist_domain
- dnslists = sbl.spamhaus.org : \
+warn dnslists = sbl.spamhaus.org : \
dialup.mail-abuse.org
+ add_header = X-blacklisted-at: $dnslist_domain
.endd
-If an identical header line is requested several times (provoked, for example,
-by multiple RCPT commands), only one copy is actually added to the message.
-If the text of the &%message%& modifier contains one or more newlines that are
-not followed by a space or a tab, it is assumed to contain multiple header
+The &%add_header%& modifier is permitted in the MAIL, RCPT, PREDATA, DATA,
+MIME, and non-SMTP ACLs (in other words, those that are concerned with
+receiving a message). The message must ultimately be accepted for
+&%add_header%& to have any significant effect. You can use &%add_header%& with
+any ACL verb, including &%deny%& (though this is potentially useful only in a
+RCPT ACL).
+
+If the data for the &%add_header%& modifier contains one or more newlines that
+are not followed by a space or a tab, it is assumed to contain multiple header
lines. Each one is checked for valid syntax; &`X-ACL-Warn:`& is added to the
front of any line that is not a valid header line.
-By default, new lines are added at the end of the existing header lines.
-However, you can specify that any particular header line should be added right
-at the start (before all the &'Received:'& lines), immediately after the first
-block of &'Received:'& lines, or immediately before any line that is not a
-&'Received:'& or &'Resent-something:'& header.
+Added header lines are accumulated during the MAIL, RCPT, and predata ACLs.
+They are added to the message before processing the DATA and MIME ACLs.
+However, if an identical header line is requested more than once, only one copy
+is actually added to the message. Further header lines may be accumulated
+during the DATA and MIME ACLs, after which they are added to the message, again
+with duplicates suppressed. Thus, it is possible to add two identical header
+lines to an SMTP message, but only if one is added before DATA and one after.
+In the case of non-SMTP messages, new headers are accumulated during the
+non-SMTP ACLs, and are added to the message after all the ACLs have run. If a
+message is rejected after DATA or by the non-SMTP ACL, all added header lines
+are included in the entry that is written to the reject log.
+
+.cindex "header lines" "added; visibility of"
+Header lines are not visible in string expansions until they are added to the
+message. It follows that header lines defined in the MAIL, RCPT, and predata
+ACLs are not visible until the DATA ACL and MIME ACLs are run. Similarly,
+header lines that are added by the DATA or MIME ACLs are not visible in those
+ACLs. Because of this restriction, you cannot use header lines as a way of
+passing data between (for example) the MAIL and RCPT ACLs. If you want to do
+this, you can use ACL variables, as described in section
+&<<SECTaclvariables>>&.
+
+The &%add_header%& modifier acts immediately it is encountered during the
+processing of an ACL. Notice the difference between these two cases:
+.display
+&`accept add_header = ADDED: some text`&
+&` `&<&'some condition'&>
+
+&`accept `&<&'some condition'&>
+&` add_header = ADDED: some text`&
+.endd
+In the first case, the header line is always added, whether or not the
+condition is true. In the second case, the header line is added only if the
+condition is true. Multiple occurrences of &%add_header%& may occur in the same
+ACL statement. All those that are encountered before a condition fails are
+honoured.
+
+.cindex "&%warn%&" "ACL verb"
+For compatibility with previous versions of Exim, a &%message%& modifier for a
+&%warn%& verb acts in the same way as &%add_header%&, except that it takes
+effect only if all the conditions are true, even if it appears before some of
+them. Furthermore, only the last occurrence of &%message%& is honoured. This
+usage of &%message%& is now deprecated. If both &%add_header%& and &%message%&
+are present on a &%warn%& verb, both are processed according to their
+specifications.
+
+By default, new header lines are added to a message at the end of the existing
+header lines. However, you can specify that any particular header line should
+be added right at the start (before all the &'Received:'& lines), immediately
+after the first block of &'Received:'& lines, or immediately before any line
+that is not a &'Received:'& or &'Resent-something:'& header.
This is done by specifying &":at_start:"&, &":after_received:"&, or
&":at_start_rfc:"& (or, for completeness, &":at_end:"&) before the text of the
header line, respectively. (Header text cannot start with a colon, as there has
to be a header name first.) For example:
.code
-warn message = :after_received:X-My-Header: something or other...
+warn add_header = \
+ :after_received:X-My-Header: something or other...
.endd
-If more than one header is supplied in a single warn statement, each one is
-treated independently and can therefore be placed differently. If you add
-more than one line at the start, or after the Received: block, they will
-end up in reverse order.
+If more than one header line is supplied in a single &%add_header%& modifier,
+each one is treated independently and can therefore be placed differently. If
+you add more than one line at the start, or after the Received: block, they end
+up in reverse order.
&*Warning*&: This facility currently applies only to header lines that are
added in an ACL. It does NOT work for header lines that are added in a
system filter or in a router or transport.
-.new
-.cindex "header lines" "added; visibility of"
-Header lines that are added by an ACL at MAIL or RCPT time are not visible in
-string expansions in ACLs for subsequent RCPT commands or in the
-&%acl_smtp_predata%& ACL. However, they are visible in string expansions in the
-ACL that is run after DATA is complete (the &%acl_smtp_data%& ACL). This is
-also true for header lines that are added in the &%acl_smtp_predata%& ACL.
-However, header lines that are added in the &%acl_smtp_data%& itself are not
-visible during that ACL. If a message is rejected after DATA, all added header
-lines are included in the entry that is written to the reject log.
-.wen
-
-If you want to preserve data between MAIL, RCPT, and the
-&%acl_smtp_predata%& ACLs, you can use ACL variables, as described in section
-&<<SECTaclvariables>>&.
-
-
expanding the string is an empty string, the number zero, or one of the strings
&"no"& or &"false"&, the condition is false. If the result is any non-zero
number, or one of the strings &"yes"& or &"true"&, the condition is true. For
-any other values, some error is assumed to have occurred, and the ACL returns
-&"defer"&.
+any other value, some error is assumed to have occurred, and the ACL returns
+&"defer"&. &new("However, if the expansion is forced to fail, the condition is
+ignored. The effect is to treat it as true, whether it is positive or
+negative.")
.vitem &*decode&~=&~*&<&'location'&>
.cindex "&%decode%&" "ACL condition"
with any of the regular expressions. For details, see chapter
&<<CHAPexiscan>>&.
-.new
.vitem &*ratelimit&~=&~*&<&'parameters'&>
.cindex "rate limiting"
This condition can be used to limit the rate at which a user or host submits
messages. Details are given in section &<<SECTratelimiting>>&.
-.wen
.vitem &*recipients&~=&~*&<&'address&~list'&>
.cindex "&%recipients%&" "ACL condition"
RCPT command, the recipient's domain (which is in &$domain$&) can be used to
influence the sender checking.
-.new
&*Warning*&: It is a bad idea to use this condition on its own as a control on
relaying, because sender addresses are easily, and commonly, forged.
-.wen
.vitem &*senders&~=&~*&<&'address&~list'&>
.cindex "&%senders%&" "ACL condition"
.code
senders = :
.endd
-.new
&*Warning*&: It is a bad idea to use this condition on its own as a control on
relaying, because sender addresses are easily, and commonly, forged.
-.wen
.vitem &*spam&~=&~*&<&'username'&>
.cindex "&%spam%&" "ACL condition"
server requests a certificate only if the client matches &%tls_verify_hosts%&
or &%tls_try_verify_hosts%& (see chapter &<<CHAPTLS>>&).
-.new
.vitem &*verify&~=&~csa*&
.cindex "CSA verification"
This condition checks whether the sending host (the client) is authorized to
send email. Details of how this works are given in section
&<<SECTverifyCSA>>&.
-.wen
.vitem &*verify&~=&~header_sender/*&<&'options'&>
.cindex "&%verify%&" "ACL condition"
.cindex "EHLO" "verifying"
.cindex "verifying" "EHLO"
.cindex "verifying" "HELO"
-.new
This condition is true if a HELO or EHLO command has been received from the
client host, and its contents have been verified. It there has been no previous
attempt to verify the the HELO/EHLO contents, it is carried out when this
condition is encountered. See the description of the &%helo_verify_hosts%& and
&%helo_try_verify_hosts%& options for details of how to request verification
independently of this condition.
-.wen
-.new
.vitem &*verify&~=&~not_blind*&
.cindex "verifying" "not blind"
.cindex "bcc recipients" "verifying none"
There are, of course, many legitimate messages that make use of blind (bcc)
recipients. This check should not be used on its own for blocking messages.
-.wen
.vitem &*verify&~=&~recipient/*&<&'options'&>
dnslists = some.list.example
.endd
-.new
.section "Rate limiting senders" "SECTratelimiting"
.cindex "rate limiting" "client sending"
.cindex "limiting client sending rates"
If the average client sending rate is less than &'m'& messages per time
period &'p'& then the condition is false; otherwise it is true.
-.new
As a side-effect, the &%ratelimit%& condition sets the expansion variable
&$sender_rate$& to the client's computed rate, &$sender_rate_limit$& to the
configured value of &'m'&, and &$sender_rate_period$& to the configured value
&$authenticated_id$&. You must ensure that the lookup key is meaningful; for
example, &$authenticated_id$& is only meaningful if the client has
authenticated, and you can check with with the &%authenticated%& ACL condition.
-.wen
Internally, Exim includes the smoothing constant &'p'& and the options in the
lookup key because they alter the meaning of the stored data. This is not true
message. For example:
.code
# Log all senders' rates
-warn
- ratelimit = 0 / 1h / strict
- log_message = Sender rate $sender_rate / $sender_rate_period
+warn ratelimit = 0 / 1h / strict
+ log_message = Sender rate $sender_rate / $sender_rate_period
-# Slow down fast senders; note the need to truncate $sender_rate at the
-# decimal point.
-warn
- ratelimit = 100 / 1h / per_rcpt / strict
- delay = ${eval: ${sg{$sender_rate}{[.].*}{}} - \
- $sender_rate_limit }s
+# Slow down fast senders; note the need to truncate $sender_rate
+# at the decimal point.
+warn ratelimit = 100 / 1h / per_rcpt / strict
+ delay = ${eval: ${sg{$sender_rate}{[.].*}{}} - \
+ $sender_rate_limit }s
# Keep authenticated users under control
-deny
- authenticated = *
- ratelimit = 100 / 1d / strict / $authenticated_id
+deny authenticated = *
+ ratelimit = 100 / 1d / strict / $authenticated_id
# System-wide rate limit
-defer
- message = Sorry, too busy. Try again later.
- ratelimit = 10 / 1s / $primary_hostname
+defer message = Sorry, too busy. Try again later.
+ ratelimit = 10 / 1s / $primary_hostname
# Restrict incoming rate from each host, with a default
# set using a macro and special cases looked up in a table.
-defer
- message = Sender rate exceeds $sender_rate_limit \
- messages per $sender_rate_period
- ratelimit = ${lookup {$sender_host_address} \
- cdb {DB/ratelimits.cdb} \
- {$value} {RATELIMIT} }
+defer message = Sender rate exceeds $sender_rate_limit \
+ messages per $sender_rate_period
+ ratelimit = ${lookup {$sender_host_address} \
+ cdb {DB/ratelimits.cdb} \
+ {$value} {RATELIMIT} }
.endd
&*Warning*&: If you have a busy server with a lot of &%ratelimit%& tests,
especially with the &%per_rcpt%& option, you may suffer from a performance
RAM disk for Exim's hints directory (usually &_/var/spool/exim/db/_&). However
this means that Exim will lose its hints data after a reboot (including retry
hints, the callout cache, and ratelimit data).
-.wen
.section "Address verification" "SECTaddressverification"
The &%no_details%& option is covered in section &<<SECTsenaddver>>&, which
discusses the reporting of sender address verification failures.
.next
-.new
The &%success_on_redirect%& option causes verification always to succeed
immediately after a successful redirection. By default, if a redirection
generates just one address, that address is also verified. See further
If you are writing your own custom rejection message or log message when
denying access, you can use this variable to include information about the
verification failure.
-.wen
In addition, &$sender_verify_failure$& or &$recipient_verify_failure$& (as
appropriate) contains one of the following words:
.cindex "verifying address" "by callout"
.cindex "callout" "verification"
.cindex "SMTP" "callout verification"
-.new
For non-local addresses, routing verifies the domain, but is unable to do any
checking of the local part. There are situations where some means of verifying
the local part is desirable. One way this can be done is to make an SMTP
lot of resource usage to the cost of verifying an address. However, Exim does
cache the results of callouts, which helps to reduce the cost. Details of
caching are in section &<<SECTcallvercache>>&.
-.wen
Recipient callouts are usually used only between hosts that are controlled by
the same administration. For example, a corporate gateway host could use
of temporary error, is treated as success by the ACL. However, the cache is not
updated in this circumstance.
-.new
.vitem &*fullpostmaster*&
.cindex "callout" "full postmaster check"
This operates like the &%postmaster%& option (see below), but if the check for
&'postmaster@domain'& fails, it tries just &'postmaster'&, without a domain, in
accordance with the specification in RFC 2821. The RFC states that the
unqualified address &'postmaster'& should be accepted.
-.wen
.vitem &*mailfrom&~=&~*&<&'email&~address'&>
.code
deny !verify = recipient/callout=use_postmaster
.endd
-.new
.cindex "&$qualify_domain$&"
It causes a non-empty postmaster address to be used in the MAIL command when
performing the callout for the recipient, and also for a &"random"& check if
that is configured. The local part of the address is &`postmaster`& and the
domain is the contents of &$qualify_domain$&.
-.wen
.vitem &*use_sender*&
This option applies to recipient callouts only. For example:
If more than one RCPT command fails in the same way, the details are given
only for the first of them. However, some administrators do not want to send
out this much information. You can suppress the details by adding
-&"/no_details"& to the ACL statement that requests sender verification. For
+&`/no_details`& to the ACL statement that requests sender verification. For
example:
.code
verify = sender/no_details
mailing list, where the existence of the alias itself is sufficient for
verification to succeed.
-.new
It is possible, however, to change the default behaviour so that all successful
redirections count as successful verifications, however many new addresses are
generated. This is specified by the &%success_on_redirect%& verification
.endd
In this example, verification succeeds if a router generates a new address, and
the callout does not occur, because no address was routed to a remote host.
-.wen
-.new
.section "Client SMTP authorization (CSA)" "SECTverifyCSA"
.cindex "CSA" "verifying"
Client SMTP Authorization is a system that allows a site to advertise
Genuine incoming bounce messages should therefore always be addressed to
recipients that have a valid tag. This scheme is a way of detecting unwanted
bounce messages caused by sender address forgeries (often called &"collateral
-spam"&), because the recipients of such messages will not include valid tags.
+spam"&), because the recipients of such messages do not include valid tags.
There are two expansion items to help with the implementation of the BATV
&"prvs"& (private signature) scheme in an Exim configuration. This scheme signs
-the original envelope sender address by using a simple shared key to add a hash
-of the address and some time-based randomizing information. The &%prvs%&
-expansion item creates a signed address, and the &%prvscheck%& expansion item
-checks one. The syntax of these expansion items is described in section
+the original envelope sender address by using a simple key to add a hash of the
+address and some time-based randomizing information. The &%prvs%& expansion
+item creates a signed address, and the &%prvscheck%& expansion item checks one.
+The syntax of these expansion items is described in section
&<<SECTexpansionitems>>&.
As an example, suppose the secret per-address keys are stored in an MySQL
timeout checks succeed. The &$prvscheck_result$& variable contains the result
of the checks (empty for failure, &"1"& for success).
-Of course, when you accept a prvs-signed address, you have to ensure that the
-routers accept it and deliver it correctly. The easiest way to handle this is
-to use a &(redirect)& router to remove the signature with a configuration along
-these lines:
+There are two more issues you must consider when implementing prvs-signing.
+Firstly, you need to ensure that prvs-signed addresses are not blocked by your
+ACLs. A prvs-signed address contains a slash character, but the default Exim
+configuration contains this statement in the RCPT ACL:
+.code
+deny message = Restricted characters in address
+ domains = +local_domains
+ local_parts = ^[.] : ^.*[@%!/|]
+.endd
+This is a conservative rule that blocks local parts that contain slashes. You
+should remove the slash in the last line.
+
+Secondly, you have to ensure that the routers accept prvs-signed addresses and
+deliver them correctly. The easiest way to handle this is to use a &(redirect)&
+router to remove the signature with a configuration along these lines:
.code
batv_redirect:
driver = redirect
{$value}fail}}}
.endd
If no key can be found for the existing return path, no signing takes place.
-.wen
patient. The remote host is making an SMTP connection back to your host, and
trying a number of common probes to test for open relay vulnerability. The
results of the tests will eventually appear on your terminal.
-
+.ecindex IIDacl
. ////////////////////////////////////////////////////////////////////////////
.chapter "Content scanning at ACL time" "CHAPexiscan"
-.cindex "content scanning" "at ACL time"
+.scindex IIDcosca "content scanning" "at ACL time"
The extension of Exim to include content scanning at ACL time, formerly known
as &"exiscan"&, was originally implemented as a patch by Tom Kistner. The code
was integrated into the main source for Exim release 4.50, and Tom continues to
maintain it. Most of the wording of this chapter is taken from Tom's
specification.
-.new
It is also possible to scan the content of messages at other times. The
&[local_scan()]& function (see chapter &<<CHAPlocalscan>>&) allows for content
scanning after all the ACLs have run. A transport filter can be used to scan
messages at delivery time (see the &%transport_filter%& option, described in
chapter &<<CHAPtransportgeneric>>&).
-.wen
If you want to include the ACL-time content-scanning features when you compile
Exim, you need to arrange for WITH_CONTENT_SCAN to be defined in your
&_Local/Makefile_&. When you do that, the Exim binary is built with:
.ilist
-.new
Two additional ACLs (&%acl_smtp_mime%& and &%acl_not_smtp_mime%&) that are run
for all MIME parts for SMTP and non-SMTP messages, respectively.
-.wen
.next
Additional ACL conditions and modifiers: &%decode%&, &%malware%&,
&%mime_regex%&, &%regex%&, and &%spam%&. These can be used in the ACL that is
You can safely omit this option (the default value is 1).
.vitem &%sophie%&
+.new
.cindex "virus scanners" "Sophos and Sophie"
Sophie is a daemon that uses Sophos' &%libsavi%& library to scan for viruses.
-You can get Sophie at &url(http://www.vanja.com/tools/sophie/). The only
-option for this scanner type is the path to the UNIX socket that Sophie uses
-for client communication. For example:
+You can get Sophie at &url(http://www.clanfield.info/sophie/). The only option
+for this scanner type is the path to the UNIX socket that Sophie uses for
+client communication. For example:
+.wen
.code
av_scanner = sophie:/tmp/sophie
.endd
the option.
.endlist
-.new
When &%av_scanner%& is correctly set, you can use the &%malware%& condition in
the DATA ACL. &*Note*&: You cannot use the &%malware%& condition in the MIME
ACL.
-.wen
The &%av_scanner%& option is expanded each time &%malware%& is called. This
makes it possible to use different scanners. See further below for an example.
The condition succeeds if a virus was found, and fail otherwise. This is the
recommended usage.
.next
-&"false"& or &"0"&, in which case no scanning is done and the condition fails
-immediately.
+.new
+&"false"& or &"0"& or an empty string, in which case no scanning is done and
+the condition fails immediately.
+.wen
.next
A regular expression, in which case the message is scanned for viruses. The
condition succeeds if a virus is found and its name matches the regular
expression. This allows you to take special actions on certain types of virus.
.endlist
+.new
You can append &`/defer_ok`& to the &%malware%& condition to accept messages
-even if there is a problem with the virus scanner.
+even if there is a problem with the virus scanner. Otherwise, such a problem
+causes the ACL to defer.
+.wen
.cindex "&$malware_name$&"
When a virus is found, the condition sets up an expansion variable called
conditions there. When the right-hand side evaluates to &"0"& or &"false"&, no
scanning is done and the condition fails immediately.
-.new
Scanning with SpamAssassin uses a lot of resources. If you scan every message,
large ones may cause significant performance degredation. As most spam messages
are quite small, it is recommended that you do not scan the big ones. For
condition = ${if < {$message_size}{10K}}
spam = nobody
.endd
-.wen
The &%spam%& condition returns true if the threshold specified in the user's
SpamAssassin profile has been matched or exceeded. If you want to use the
it always return &"true"& by appending &`:true`& to the username.
.cindex "spam scanning" "returned variables"
-When the &%spam%& condition is run, it sets up the following expansion
-variables:
+When the &%spam%& condition is run, it sets up a number of expansion
+variables. With the exception of &$spam_score_int$&, these are usable only
+within ACLs; their values are not retained with the message and so cannot be
+used at delivery time.
.vlist
.vitem &$spam_score$&
.vitem &$spam_score_int$&
The spam score of the message, multiplied by ten, as an integer value. For
example &"34"& or &"305"&. This is useful for numeric comparisons in
-conditions. This variable is special; it is saved with the message, and written
-to Exim's spool file. This means that it can be used during the whole life of
-the message on your Exim system, in particular, in routers or transports during
-the later delivery phase.
+conditions. This variable is special; its value is saved with the message, and
+written to Exim's spool file. This means that it can be used during the whole
+life of the message on your Exim system, in particular, in routers or
+transports during the later delivery phase.
.vitem &$spam_bar$&
A string consisting of a number of &"+"& or &"-"& characters, representing the
Here is a longer, commented example of the use of the &%spam%&
condition:
+.new
.code
# put headers in all messages (no matter if spam or not)
-warn message = X-Spam-Score: $spam_score ($spam_bar)
- spam = nobody:true
-warn message = X-Spam-Report: $spam_report
- spam = nobody:true
+warn spam = nobody:true
+ add_header = X-Spam-Score: $spam_score ($spam_bar)
+ add_header = X-Spam-Report: $spam_report
# add second subject line with *SPAM* marker when message
# is over threshold
-warn message = Subject: *SPAM* $h_Subject:
- spam = nobody
+warn spam = nobody
+ add_header = Subject: *SPAM* $h_Subject:
# reject spam at high scores (> 12)
deny message = This message scored $spam_score spam points.
spam = nobody:true
condition = ${if >{$spam_score_int}{120}{1}{0}}
.endd
+.wen
.cindex "content scanning" "MIME parts"
.cindex "MIME content scanning"
.cindex "&%acl_smtp_mime%&"
-.new
+.cindex "&%acl_not_smtp_mime%&"
The &%acl_smtp_mime%& global option specifies an ACL that is called once for
each MIME part of an SMTP message, including multipart types, in the sequence
of their position in the message. Similarly, the &%acl_not_smtp_mime%& option
options may both refer to the same ACL if you want the same processing in both
cases.
-These ACLs are called (possibly many times) just before the &%acl_smtp_data%&
-ACL in the case of an SMTP message, or just before a non-SMTP message is
-accepted. However, a MIME ACL is called only if the message contains a
-&'MIME-Version:'& header line. When a call to a MIME ACL does not yield
-&"accept"&, ACL processing is aborted and the appropriate result code is sent
-to the client. In the case of an SMTP message, the &%acl_smtp_data%& ACL is not
-called when this happens.
+&new("These ACLs are called (possibly many times) just before the
+&%acl_smtp_data%& ACL in the case of an SMTP message, or just before the
+&%acl_not_smtp%& ACL in the case of a non-SMTP message.") However, a MIME ACL
+is called only if the message contains a &'MIME-Version:'& header line. When a
+call to a MIME ACL does not yield &"accept"&, ACL processing is aborted and the
+appropriate result code is sent to the client. In the case of an SMTP message,
+the &%acl_smtp_data%& ACL is not called when this happens.
You cannot use the &%malware%& or &%spam%& conditions in a MIME ACL; these can
only be used in the DATA or non-SMTP ACLs. However, you can use the &%regex%&
condition to match against the raw MIME part. You can also use the
&%mime_regex%& condition to match against the decoded MIME part (see section
&<<SECTscanregex>>&).
-.wen
At the start of a MIME ACL, a number of variables are set from the header
information for the relevant MIME part. These are described below. The contents
demime = exe:doc
control = freeze
.endd
+.ecindex IIDcosca
.chapter "Adding a local scan function to Exim" "CHAPlocalscan" &&&
"Local scan function"
-.cindex "&[local_scan()]& function" "description of"
+.scindex IIDlosca "&[local_scan()]& function" "description of"
.cindex "customizing" "input scan using C function"
.cindex "policy control" "by local scan function"
In these days of email worms, viruses, and ever-increasing spam, some sites
fine in this circumstance. Unless you have made a mistake with the recipient
addresses, you should get a return code of zero.
+
+.vitem &*pid_t&~child_open_exim2(int&~*fd,&~uschar&~*sender,&~uschar&~&&&
+ *sender_authentication)*&
+This function is a more sophisticated version of &'child_open()'&. The command
+that it runs is:
+.display
+&`exim -t -oem -oi -f `&&'sender'&&` -oMas `&&'sender_authentication'&
+.endd
+The third argument may be NULL, in which case the &%-oMas%& option is omitted.
+
+
.vitem &*void&~debug_printf(char&~*,&~...)*&
This is Exim's debugging function, with arguments as for &'(printf()'&. The
output is written to the standard error stream. If no debugging is selected,
if ((debug_selector & D_local_scan) != 0)
debug_printf("xxx", ...);
.endd
+
.vitem &*uschar&~*expand_string(uschar&~*string)*&
This is an interface to Exim's string expansion code. The return value is the
expanded string, or NULL if there was an expansion failure.
the addition of that field to the structure. However, it is easy to add such a
value afterwards. For example:
.code
-receive_add_recipient(US"monitor@mydom.example", -1);
-recipients_list[recipients_count-1].errors_to =
-US"postmaster@mydom.example";
+ receive_add_recipient(US"monitor@mydom.example", -1);
+ recipients_list[recipients_count-1].errors_to =
+ US"postmaster@mydom.example";
.endd
.vitem &*BOOL&~receive_remove_recipient(uschar&~*recipient)*&
There is also a convenience function called &'store_get_perm()'& that gets a
block of memory from the permanent pool while preserving the value of
&%store_pool%&.
-
+.ecindex IIDlosca
. ////////////////////////////////////////////////////////////////////////////
.chapter "System-wide message filtering" "CHAPsystemfilter"
-.cindex "filter" "system filter"
-.cindex "filtering all mail"
-.cindex "system filter"
+.scindex IIDsysfil1 "filter" "system filter"
+.scindex IIDsysfil2 "filtering all mail"
+.scindex IIDsysfil3 "system filter"
The previous chapters (on ACLs and the local scan function) describe checks
that can be applied to messages before they are accepted by a host. There is
also a mechanism for checking messages once they have been received, but before
its intended recipient. The router will not then claim to have dealt with the
address, so it will be passed on to subsequent routers to be delivered in the
normal way.
+.ecindex IIDsysfil1
+.ecindex IIDsysfil2
+.ecindex IIDsysfil3
. ////////////////////////////////////////////////////////////////////////////
.chapter "Message processing" "CHAPmsgproc"
-.cindex "message" "general processing"
+.scindex IIDmesproc "message" "general processing"
Exim performs various transformations on the sender and recipient addresses of
all messages that it handles, and also on the messages' header lines. Some of
these are optional and configurable, while others always take place. All of
.section "Submission mode for non-local messages" "SECTsubmodnon"
.cindex "message" "submission"
.cindex "submission mode"
-.new
Processing that happens automatically for locally-originated messages (unless
&%suppress_local_fixups%& is set) can also be requested for messages that are
received over TCP/IP. The term &"submission mode"& is used to describe this
state. Submisssion mode is set by the modifier
-.wen
.code
control = submission
.endd
.code
control = submission/domain=some.domain
.endd
-.new
The domain may be empty. How this value is used is described in sections
&<<SECTthefrohea>>& and &<<SECTthesenhea>>&. There is also a &%name%& option
that allows you to specify the user's full name for inclusion in a created
specified by submission mode. Although this might be slightly unexpected, it
does mean that you can configure ACL checks to spot that a user is trying to
spoof another's address.
-.wen
.section "Line endings" "SECTlineendings"
.cindex "line endings"
.section "The Auto-Submitted: header line"
-Whenever Exim generates a bounce or a delay warning message, it includes the
-header line:
-.new
+Whenever Exim generates an autoreply, a bounce, or a delay warning message, it
+includes the header line:
.code
Auto-Submitted: auto-replied
.endd
-.wen
.section "The Bcc: header line"
.cindex "&'Bcc:'& header line"
.section "The Date: header line"
.cindex "&'Date:'& header line"
-.new
If a locally-generated or submission-mode message has no &'Date:'& header line,
Exim adds one, using the current date and time, unless the
&%suppress_local_fixups%& control has been specified.
-.wen
.section "The Delivery-date: header line"
.cindex "&'Delivery-date:'& header line"
A non-empty envelope sender takes precedence.
-.new
If a locally-generated incoming message does not contain a &'From:'& header
line, and the &%suppress_local_fixups%& control is not set, Exim adds one
containing the sender's address. The calling user's login name and full name
They are obtained from the password data by calling &[getpwuid()]& (but see the
&%unknown_login%& configuration option). The address is qualified with
&%qualify_domain%&.
-.wen
For compatibility with Sendmail, if an incoming, non-SMTP message has a
&'From:'& header line containing just the unqualified login name of the calling
.cindex "&'Message-ID:'& header line"
.cindex "message" "submission"
.cindex "&%message_id_header_text%&"
-.new
If a locally-generated or submission-mode incoming message does not contain a
&'Message-ID:'& or &'Resent-Message-ID:'& header line, and the
&%suppress_local_fixups%& control is not set, Exim adds a suitable header line
followed by @ and the primary host name. Additional information can be included
in this header line by setting the &%message_id_header_text%& and/or
&%message_id_header_domain%& options.
-.wen
.section "The Received: header line"
-H spool file is written) the earliest time at which delivery could start.
+.section "The References: header line"
+.cindex "&'References:'& header line"
+Messages created by the &(autoreply)& transport include a &'References:'&
+header line. This is constructed according to the rules that are described in
+section 3.64 of RFC 2822 (which states that replies should contain such a
+header line), and section 3.14 of RFC 3834 (which states that automatic
+responses are not different in this respect). However, because some mail
+processing software does not cope well with very long header lines, no more
+than 12 message IDs are copied from the &'References:'& header line in the
+incoming message. If there are more than 12, the first one and then the final
+11 are copied, before adding the message ID of the incoming message.
+
+
.section "The Return-path: header line"
.cindex "&'Return-path:'& header line"
.section "The Sender: header line" "SECTthesenhea"
.cindex "&'Sender:'& header line"
.cindex "message" "submission"
-.new
For a locally-originated message from an untrusted user, Exim may remove an
existing &'Sender:'& header line, and it may add a new one. You can modify
these actions by setting the &%local_sender_retain%& option true, the
be permitted by setting &%local_from_prefix%& and &%local_from_suffix%&
appropriately. If &'From:'& does not contain the correct sender, a &'Sender:'&
line is added to the message.
-.wen
If you set &%local_from_check%& false, this checking does not occur. However,
the removal of an existing &'Sender:'& line still happens, unless you also set
added. Prefixes and suffixes for the local part in &'From:'& can be permitted
by setting &%local_from_prefix%& and &%local_from_suffix%& appropriately.
-.new
.cindex "return path" "created from &'Sender:'&"
&*Note*&: Whenever a &'Sender:'& header line is created, the return path for
the message (the envelope sender address) is changed to be the same address,
except in the case of submission mode when &%sender_retain%& is specified.
-.wen
"SECTheadersaddrem"
.cindex "header lines" "adding; in router or transport"
.cindex "header lines" "removing; in router or transport"
-.new
When a message is delivered, the addition and removal of header lines can be
specified in a system filter, or on any of the routers and transports that
process the message. Section &<<SECTaddremheasys>>& contains details about
modifying headers in a system filter. Header lines can also be added in an ACL
-as a message is received (see section &<<SECTaddheadwarn>>&).
-.wen
+as a message is received (see section &<<SECTaddheadacl>>&).
In contrast to what happens in a system filter, header modifications that are
specified on routers and transports apply only to the particular recipient
transported. Therefore, they do not affect the basic set of header lines, and
they do not affect the values of the variables that refer to header lines.
-.new
&*Note*&: In particular, this means that any expansions in the configuration of
the transport cannot refer to the modified header lines, because such
expansions all occur before the message is actually transported.
-.wen
For both routers and transports, the result of expanding a &%headers_add%&
option must be in the form of one or more RFC 2822 header lines, separated by
deliveries for unreasonable amounts of time, just because one address could not
immediately be routed. Exim therefore does not delay other deliveries when
routing of one or more addresses is deferred.
+.ecindex IIDmesproc
+
. ////////////////////////////////////////////////////////////////////////////
. ////////////////////////////////////////////////////////////////////////////
.chapter "SMTP processing" "CHAPSMTP"
-.cindex "SMTP" "processing details"
-.cindex "LMTP" "processing details"
+.scindex IIDsmtpproc1 "SMTP" "processing details"
+.scindex IIDsmtpproc2 "LMTP" "processing details"
Exim supports a number of different ways of using the SMTP protocol, and its
LMTP variant, which is an interactive protocol for transferring messages into a
closed mail store application. This chapter contains details of how SMTP is
-
-.section "Variable Envelope Return Paths (VERP)"
-.cindex "VERP"
-.cindex "Variable Envelope Return Paths"
-.cindex "envelope sender"
-Variable Envelope Return Paths &-- see
-&*ftp://koobera.math.uic.edu/www/proto/verp.txt*& &-- can be supported in Exim
-by using the &%return_path%& generic transport option to rewrite the return
-path at transport time. For example, the following could be used on an &(smtp)&
-transport:
-.code
-return_path = \
- ${if match {$return_path}{^(.+?)-request@your.dom.example\$}\
- {$1-request=$local_part%$domain@your.dom.example}fail}
-.endd
-This has the effect of rewriting the return path (envelope sender) on all
-outgoing SMTP messages, if the local part of the original return path ends in
-&"-request"&, and the domain is &'your.dom.example'&. The rewriting inserts the
-local part and domain of the recipient into the return path. Suppose, for
-example, that a message whose return path has been set to
-&'somelist-request@your.dom.example'& is sent to
-&'subscriber@other.dom.example'&. In the transport, the return path is
-rewritten as
-.code
-somelist-request=subscriber%other.dom.example@your.dom.example
-.endd
-For this to work, you must arrange for outgoing messages that have &"-request"&
-in their return paths to have just a single recipient. This can be done by
-setting
-.code
-max_rcpt = 1
-.endd
-.cindex "&$local_part$&"
-in the &(smtp)& transport. Otherwise a single copy of a message might be
-addressed to several different recipients in the same domain, in which case
-&$local_part$& is not available (because it is not unique). Of course, if you
-do start sending out messages with this kind of return path, you must also
-configure Exim to accept the bounce messages that come back to those paths.
-Typically this would be done by setting an &%local_part_suffix%& option for a
-suitable router.
-
-The overhead incurred in using VERP depends very much on the size of the
-message, the number of recipient addresses that resolve to the same remote
-host, and the speed of the connection over which the message is being sent. If
-a lot of addresses resolve to the same host and the connection is slow, sending
-a separate copy of the message for each address may take substantially longer
-than sending a single copy with many recipients (for which VERP cannot be
-used).
-
-
-
.section "Incoming SMTP messages over TCP/IP"
.cindex "SMTP" "incoming over TCP/IP"
.cindex "incoming SMTP over TCP/IP"
The return code from Exim is zero only if there were no errors. It is 1 if some
messages were accepted before an error was detected, and 2 if no messages were
accepted.
+.ecindex IIDsmtpproc1
+.ecindex IIDsmtpproc2
+.section "Variable Envelope Return Paths (VERP)" "SECTverp"
+.cindex "VERP"
+.cindex "Variable Envelope Return Paths"
+.cindex "envelope sender"
+Variable Envelope Return Paths &-- see &url(http://cr.yp.to/proto/verp.txt) &--
+are a way of helping mailing list administrators discover which subscription
+address is the cause of a particular delivery failure. The idea is to encode
+the original recipient address in the outgoing envelope sender address, so that
+if the message is forwarded by another host and then subsequently bounces, the
+original recipient can be extracted from the recipient address of the bounce.
+
+.oindex &%errors_to%&
+.oindex &%return_path%&
+Envelope sender addresses can be modified by Exim using two different
+facilities: the &%errors_to%& option on a router (as shown in previous mailing
+list examples), or the &%return_path%& option on a transport. The second of
+these is effective only if the message is successfully delivered to another
+host; it is not used for errors detected on the local host (see the description
+of &%return_path%& in chapter &<<CHAPtransportgeneric>>&). Here is an example
+of the use of &%return_path%& to implement VERP on an &(smtp)& transport:
+.code
+verp_smtp:
+ driver = smtp
+ max_rcpt = 1
+ return_path = \
+ ${if match {$return_path}{^(.+?)-request@your.dom.example\$}\
+ {$1-request=$local_part%$domain@your.dom.example}fail}
+.endd
+This has the effect of rewriting the return path (envelope sender) on outgoing
+SMTP messages, if the local part of the original return path ends in
+&"-request"&, and the domain is &'your.dom.example'&. The rewriting inserts the
+local part and domain of the recipient into the return path. Suppose, for
+example, that a message whose return path has been set to
+&'somelist-request@your.dom.example'& is sent to
+&'subscriber@other.dom.example'&. In the transport, the return path is
+rewritten as
+.code
+somelist-request=subscriber%other.dom.example@your.dom.example
+.endd
+.new
+.cindex "&$local_part$&"
+For this to work, you must tell Exim to send multiple copies of messages that
+have more than one recipient, so that each copy has just one recipient. This is
+achieved by setting &%max_rcpt%& to 1. Without this, a single copy of a message
+might be sent to several different recipients in the same domain, in which case
+&$local_part$& is not available in the transport, because it is not unique.
+
+Unless your host is doing nothing but mailing list deliveries, you should
+probably use a separate transport for the VERP deliveries, so as not to use
+extra resources in making one-per-recipient copies for other deliveries. This
+can easily be done by expanding the &%transport%& option in the router:
+.wen
+.code
+dnslookup:
+ driver = dnslookup
+ domains = ! +local_domains
+ transport = \
+ ${if match {$return_path}{^(.+?)-request@your.dom.example\$}\
+ {verp_smtp}{remote_smtp}}
+ no_more
+.endd
+If you want to change the return path using &%errors_to%& in a router instead
+of using &%return_path%& in the transport, you need to set &%errors_to%& on all
+routers that handle mailing list addresses. This will ensure that all delivery
+errors, including those detected on the local host, are sent to the VERP
+address.
+
+On a host that does no local deliveries and has no manual routing, only the
+&(dnslookup)& router needs to be changed. A special transport is not needed for
+SMTP deliveries. Every mailing list recipient has its own return path value,
+and so Exim must hand them to the transport one at a time. Here is an example
+of a &(dnslookup)& router that implements VERP:
+.code
+verp_dnslookup:
+ driver = dnslookup
+ domains = ! +local_domains
+ transport = remote_smtp
+ errors_to = \
+ ${if match {$return_path}{^(.+?)-request@your.dom.example\$}}
+ {$1-request=$local_part%$domain@your.dom.example}fail}
+ no_more
+.endd
+Before you start sending out messages with VERPed return paths, you must also
+configure Exim to accept the bounce messages that come back to those paths.
+Typically this is done by setting a &%local_part_suffix%& option for a
+router, and using this to route the messages to wherever you want to handle
+them.
+
+The overhead incurred in using VERP depends very much on the size of the
+message, the number of recipient addresses that resolve to the same remote
+host, and the speed of the connection over which the message is being sent. If
+a lot of addresses resolve to the same host and the connection is slow, sending
+a separate copy of the message for each address may take substantially longer
+than sending a single copy with many recipients (for which VERP cannot be
+used).
+
+
+
+
+
+
.section "Virtual domains" "SECTvirtualdomains"
.cindex "virtual domains"
.cindex "domain" "virtual"
. ////////////////////////////////////////////////////////////////////////////
.chapter "Log files" "CHAPlog"
+.scindex IIDloggen "log" "general description"
.cindex "log" "types of"
-.cindex "log" "general description"
Exim writes three different logs, referred to as the main log, the reject log,
and the panic log:
.cindex "authentication" "logging"
.cindex "AUTH" "logging"
-.new
For all messages, the P field specifies the protocol used to receive the
message. This is the value that is stored in &$received_protocol$&. In the case
of incoming SMTP messages, the value indicates whether or not any SMTP
was used. If an authenticated identification was set up by the authenticator's
&%server_set_id%& option, this is logged too, separated by a colon from the
authenticator name.
-.wen
.cindex "size" "of message"
The id field records the existing message id, if present. The size of the
&` received_sender `& sender on <= lines
&`*rejected_header `& header contents on reject log
&`*retry_defer `& &"retry time not reached"&
-&` return_path_on_delivery `& put return path on => and *\ lines
+&` return_path_on_delivery `& put return path on => and ** lines
&` sender_on_delivery `& add sender to => lines
+&`*sender_verify_fail `& sender verification failures
&`*size_reject `& rejection because too big
&`*skip_delivery `& delivery skipped in a queue run
&` smtp_confirmation `& SMTP confirmation on => lines
.ilist
.cindex "&%warn%& statement" "log when skipping"
-.new
&%acl_warn_skipped%&: When an ACL &%warn%& statement is skipped because one of
its conditions cannot be evaluated, a log line to this effect is written if
this log selector is set.
-.wen
.next
.cindex "log" "rewriting"
.cindex "rewriting" "logging"
This is the original sender that was received with the message; it is not
necessarily the same as the outgoing return path.
.next
+.cindex "log" "sender verify failure"
+&%sender_verify_fail%&: If this selector is unset, the separate log line that
+gives details of a sender verification failure is not written. Log lines for
+the rejection of SMTP commands contain just &"sender verify failed"&, so some
+detail is lost.
+.next
.cindex "log" "size rejection"
&%size_reject%&: A log line is written whenever a message is rejected because
it is too big.
connection, and a certificate is supplied by the remote host, the peer DN is
added to the log line, preceded by DN=.
.next
-.new
.cindex "log" "DNS failure in list"
&%unknown_in_list%&: This setting causes a log entry to be written when the
result of a list match is failure because a DNS lookup failed.
-.wen
.endlist
On a heavily loaded system, it may be desirable to disable the use of
per-message logs, in order to reduce disk I/O. This can be done by setting the
&%message_logs%& option false.
-
+.ecindex IIDloggen
. ////////////////////////////////////////////////////////////////////////////
. ////////////////////////////////////////////////////////////////////////////
.chapter "Exim utilities" "CHAPutils"
-.cindex "utilities"
+.scindex IIDutils "utilities"
A number of utility scripts and programs are supplied with Exim and are
described in this chapter. There is also the Exim Monitor, which is covered in
the next chapter. The utilities described here are:
.row "" &<<SECTmailboxmaint>>& &'exim_lock'& "lock a mailbox file"
.endtable
-.new
Another utility that might be of use to sites with many MTAs is Tom Kistner's
&'exilog'&. It provides log visualizations across multiple Exim servers. See
&url(http://duncanthrax.net/exilog/) for details.
-.wen
"SECTextspeinf"
.cindex "&'exigrep'&"
.cindex "log" "extracts; grepping for"
-.new
The &'exigrep'& utility is a Perl script that searches one or more main log
files for entries that match a given pattern. When it finds a match, it
extracts all the log entries for the relevant message, not just those that
match the pattern. Thus, &'exigrep'& can extract complete log entries for a
given message, or all mail for a given user, or for a given host, for example.
The input files can be in Exim log format or syslog format.
-.wen
If a matching log line is not associated with a specific message, it is always
included in &'exigrep'&'s output. The usage is:
.cindex "&'exipick'&"
John Jetmore's &'exipick'& utility is included in the Exim distribution. It
lists messages from the queue according to a variety of criteria. For details,
-run:
+visit &url(http://www.exim.org/eximwiki/ToolExipickManPage) or run:
.code
exipick --help
.endd
you are using log files with datestamps in their names (see section
&<<SECTdatlogfil>>&). Some operating systems have their own standard mechanisms
for log cycling, and these can be used instead of &'exicyclog'& if preferred.
+There are two command line options for &'exicyclog'&:
+.ilist
+&%-k%& <&'count'&> specifies the number of log files to keep, overriding the
+default that is set when Exim is built. The default default is 10.
+.next
+&%-l%& <&'path'&> specifies the log file path, in the same format as Exim's
+&%log_file_path%& option (for example, &`/var/log/exim_%slog`&), again
+overriding the script's default, which is to find the setting from Exim's
+configuration.
+.endlist
Each time &'exicyclog'& is run the file names get &"shuffled down"& by one. If
the main log file name is &_mainlog_& (the default) then when &'exicyclog'& is
run &_mainlog_& becomes &_mainlog.01_&, the previous &_mainlog.01_& becomes
-&_mainlog.02_& and so on, up to a limit which is set in the script, and which
-defaults to 10. Log files whose numbers exceed the limit are discarded. Reject
+&_mainlog.02_& and so on, up to the limit that is set in the script or by the
+&%-k%& option. Log files whose numbers exceed the limit are discarded. Reject
logs are handled similarly.
If the limit is greater than 99, the script uses 3-digit numbers such as
to one that is greater, or &'vice versa'&, you will have to fix the names of
any existing log files.
-
If no &_mainlog_& file exists, the script does nothing. Files that &"drop off"&
the end are deleted. All files with numbers greater than 01 are compressed,
using a compression command which is configured by the COMPRESS_COMMAND
for remote hosts
.next
&'callout'&: the callout cache
-.new
.next
&'ratelimit'&: the data for implementing the ratelimit ACL condition
-.wen
.next
&'misc'&: other hints data
.endlist
.section "exim_tidydb"
.cindex "&'exim_tidydb'&"
-.new
The &'exim_tidydb'& utility program is used to tidy up the contents of a hints
database. If run with no options, it removes all records that are more than 30
days old. The age is calculated from the date and time that the record was last
since the first delivery failure. Information about a host that has been down
for more than 30 days will remain in the database, provided that the record is
updated sufficiently often.
-.wen
The cutoff date can be altered by means of the &%-t%& option, which must be
followed by a time. For example, to remove all records older than a week from
.endd
Note that if a command is supplied, it must be entirely contained within the
second argument &-- hence the quotes.
-
+.ecindex IIDutils
. ////////////////////////////////////////////////////////////////////////////
. ////////////////////////////////////////////////////////////////////////////
.chapter "The Exim monitor" "CHAPeximon"
-.cindex "Exim monitor" "description"
+.scindex IIDeximon "Exim monitor" "description"
.cindex "X-windows"
.cindex "&'eximon'&"
.cindex "Local/eximon.conf"
In any text window that is displayed as result of a menu action, the normal
cut-and-paste facility is available, and searching can be carried out using ^R
and ^S, as described above for the log tail window.
-
+.ecindex IIDeximon
. ////////////////////////////////////////////////////////////////////////////
.chapter "Security considerations" "CHAPsecurity"
-.cindex "security"
+.scindex IIDsecurcon "security" "discussion of"
This chapter discusses a number of issues concerned with security, some of
which are also covered in other parts of this manual.
.section "Use of strcat() and strcpy()"
These are used only in cases where the output buffer is known to be large
enough to hold the result.
+.ecindex IIDsecurcon
. ////////////////////////////////////////////////////////////////////////////
.chapter "Format of spool files" "CHAPspool"
-.cindex "format" "spool files"
-.cindex "spool directory" "format of files"
-.cindex "spool files" "format of"
+.scindex IIDforspo1 "format" "spool files"
+.scindex IIDforspo2 "spool directory" "format of files"
+.scindex IIDforspo3 "spool files" "format of"
.cindex "spool files" "editing"
A message on Exim's queue consists of two files, whose names are the message id
followed by -D and -H, respectively. The data portion of the message is kept in
on your own if you do it. Here are some of the pitfalls:
.ilist
-.new
You must ensure that Exim does not try to deliver the message while you are
fiddling with it. The safest way is to take out a write lock on the -D file,
which is what Exim itself does, using &[fcntl()]&. If you update the file in
&$body_linecount$&, which is stored in the -H file, will be incorrect. At
present, this value is not used by Exim, but there is no guarantee that this
will always be the case.
-.wen
.next
If the message is in MIME format, you must take care not to break it.
.next
.vlist
.vitem "&%-acl%& <&'number'&> <&'length'&>"
-A line of this form is present for every ACL variable that is not empty. The
-number identifies the variable; the &%acl_c%&&*x*& variables are numbered 0&--9
-and the &%acl_m%&&*x*& variables are numbered 10&--19. The length is the length
-of the data string for the variable. The string itself starts at the beginning
-of the next line, and is followed by a newline character. It may contain
-internal newlines.
+This item is obsolete, and is not generated from Exim release 4.61 onwards;
+&%-aclc%& and &%-aclm%& are used instead. However, &%-acl%& is still
+recognized, to provide backward compatibility. In the old format, a line of
+this form is present for every ACL variable that is not empty. The number
+identifies the variable; the &%acl_c%&&*x*& variables are numbered 0&--9 and
+the &%acl_m%&&*x*& variables are numbered 10&--19. The length is the length of
+the data string for the variable. The string itself starts at the beginning of
+the next line, and is followed by a newline character. It may contain internal
+newlines.
+
+.vitem "&%-aclc%& <&'number'&> <&'length'&>"
+A line of this form is present for every ACL connection variable that is not
+empty. The number identifies the variable. The length is the length of the data
+string for the variable. The string itself starts at the beginning of the next
+line, and is followed by a newline character. It may contain internal newlines.
+
+.vitem "&%-aclm%& <&'number'&> <&'length'&>"
+A line of this form is present for every ACL message variable that is not
+empty. The number identifies the variable. The length is the length of the data
+string for the variable. The string itself starts at the beginning of the next
+line, and is followed by a newline character. It may contain internal newlines.
.vitem "&%-active_hostname%& <&'hostname'&>"
This is present if, when the message was received over SMTP, the value of
The asterisked headers indicate that the envelope sender, &'From:'& header, and
&'To:'& header have been rewritten, the last one because routing expanded the
unqualified domain &'foundation'&.
+.ecindex IIDforspo1
+.ecindex IIDforspo2
+.ecindex IIDforspo3