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 some additional options, some of which are compatible with Smail 3. Certain combinations of options do not make sense, and provoke an error if used. The form of the arguments depends on which options are set.
If Exim is called under the name mailq, it behaves as if the option -bp were present before any other options. The -bp option requests a listing of the contents of the mail queue on the standard output. This feature is for compatibility with some systems that contain a command of that name in one of the standard libraries, symbolically linked to /usr/sbin/sendmail or /usr/lib/sendmail.
If Exim is called under the name rsmtp it behaves as if the option -bS were present before any other options, for compatibility with Smail. The -bS option is used for reading in a number of messages in batched SMTP format.
If Exim is called under the name rmail it behaves as if the -i and -oee options were present before any other options, for compatibility with Smail. The name rmail is used as an interface by some UUCP systems.
If Exim is called under the name runq it behaves as if the option -q were present before any other options, for compatibility with Smail. The -q option causes a single queue runner process to be started.
If Exim is called under the name newaliases it behaves as if the option -bi were present before any other options, for compatibility with Sendmail. This option is used for rebuilding Sendmail’s alias file. Exim does not have the concept of a single alias file, but can be configured to run a given command if called with the -bi option.
Some Exim options are available only to trusted users and others are available only to admin users. In the description below, the phrases “Exim user” and “Exim group” mean the user and group defined by EXIM_USER and EXIM_GROUP in Local/Makefile or set by the exim_user and exim_group options. These do not necessarily have to use the name “exim”.
The trusted users are root, the Exim user, any user listed in the trusted_users configuration option, and any user whose current group or any supplementary group is one of those listed in the trusted_groups configuration option. Note that the Exim group is not automatically trusted.
Trusted users are always permitted to use the -f option or a leading “From ” line to specify the envelope sender of a message that is passed to Exim through the local interface (see the -bm and -f options below). See the untrusted_set_sender option for a way of permitting non-trusted users to set envelope senders.
For a trusted user, there is never any check on the contents of the From: header line, and a Sender: line is never added. Furthermore, any existing Sender: line in incoming local (non-TCP/IP) messages is not removed.
Trusted users may also specify a host name, host address, interface address, protocol name, ident value, and authentication data when submitting a message locally. Thus, they are able to insert messages into Exim’s queue locally that have the characteristics of messages received from a remote host. Untrusted users may in some circumstances use -f, but can never set the other values that are available to trusted users.
The admin users are root, the Exim user, and any user that is a member of the Exim group or of any group listed in the admin_groups configuration option. The current group does not have to be one of these groups.
Admin users are permitted to list the queue, and to carry out certain operations on messages, for example, to force delivery failures. It is also necessary to be an admin user in order to see the full information provided by the Exim monitor, and full debugging output.
By default, the use of the -M, -q, -R, and -S options to cause Exim to attempt delivery of messages on its queue is restricted to admin users. However, this restriction can be relaxed by setting the prod_requires_admin option false (that is, specifying no_prod_requires_admin).
Similarly, the use of the -bp option to list all the messages in the queue is restricted to admin users unless queue_list_requires_admin is set false.
Warning: If you configure your system so that admin users are able to edit Exim’s configuration file, you are giving those users an easy way of getting root. There is further discussion of this issue at the start of chapter 6.
The command options are described in alphabetical order below.
This option runs Exim as a daemon, awaiting incoming SMTP connections. Usually the -bd option is combined with the -q<time> option, to specify that the daemon should also initiate periodic queue runs.
The -bd option can be used only by an admin user. If either of the -d (debugging) or -v (verifying) options are set, the daemon does not disconnect from the controlling terminal. When running this way, it can be stopped by pressing ctrl-C.
By default, Exim listens for incoming connections to the standard SMTP port on all the host’s running interfaces. However, it is possible to listen on other ports, on multiple ports, and only on specific interfaces. Chapter 13 contains a description of the options that control this.
When a listening daemon is started without the use of -oX (that is, without overriding the normal configuration), it writes its process id to a file called exim-daemon.pid in Exim’s spool directory. This location can be overridden by setting PID_FILE_PATH in Local/Makefile. The file is written while Exim is still running as root.
When -oX is used on the command line to start a listening daemon, the process id is not written to the normal pid file path. However, -oP can be used to specify a path on the command line if a pid file is required.
The SIGHUP signal can be used to cause the daemon to re-exec itself. This should be done whenever Exim’s configuration file, or any file that is incorporated into it by means of the .include facility, is changed, and also whenever a new version of Exim is installed. It is not necessary to do this when other files that are referenced from the configuration (for example, alias files) are changed, because these are reread each time they are used.
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.
If Exim was built with USE_READLINE=yes in Local/Makefile, it tries to load the libreadline library dynamically whenever the -be option is used without command line arguments. If successful, it uses the readline() function, which provides extensive line-editing facilities, for reading the test data. A line history is supported.
Long expansion expressions can be split over several lines by using backslash continuations. As in Exim’s run time configuration, white space at the start of continuation lines is ignored. Each argument or data line is passed through the string expansion mechanism, and the result is output. Variable values from the configuration file (for example, $qualify_domain) are available, but no message-specific values (such as $domain) are set, because no message is being processed.
This option runs Exim in user filter testing mode; the file is the filter file to be tested, and a test message must be supplied on the standard input. If there are no message-dependent tests in the filter, an empty file can be supplied.
If you want to test a system filter file, use -bF instead of -bf. You can use both -bF and -bf on the same command, in order to test a system filter and a user filter in the same run. For example:
exim -bF /system/filter -bf /user/filter </test/message
This is helpful when the system filter adds header lines or sets filter variables that are used by the user filter.
If the test filter file does not begin with one of the special lines
# Exim filter # Sieve filter
it is taken to be a normal .forward file, and is tested for validity under that interpretation. See sections 22.4 to 22.6 for a description of the possible contents of non-filter redirection lists.
The result of an Exim command that uses -bf, provided no errors are detected, is a list of the actions that Exim would try to take if presented with the message for real. More details of filter testing are given in the separate document entitled Exim’s interfaces to mail filtering.
When testing a filter file, the envelope sender can be set by the -f option, or by a “From ” line at the start of the test message. Various parameters that would normally be taken from the envelope recipient address of the message can be set by means of additional command line options (see the next four options).
This option runs a fake SMTP session as if from the given IP address, using the standard input and output. The IP address may include a port number at the end, after a full stop. For example:
exim -bh 10.9.8.7.1234 exim -bh fe80::a00:20ff:fe86:a061.5678
When an IPv6 address is given, it is converted into canonical form. In the case
of the second example above, the value of $sender_host_address after
conversion to the canonical form is fe80:0000:0000:0a00:20ff:fe86:a061.5678
.
Comments as to what is going on are written to the standard error file. These include lines beginning with “LOG” for anything that would have been logged. This facility is provided for testing configuration options for incoming messages, to make sure they implement the required policy. For example, you can test your relay controls using -bh.
Warning 1: 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.
Warning 2: Address verification callouts (see section 39.32) are also skipped when testing using -bh. If you want these callouts to occur, use -bhc instead.
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.
The exim_checkaccess utility is a “packaged” version of -bh whose output just states whether a given recipient address from a given host is acceptable or not. See section 49.8.
Sendmail interprets the -bi option as a request to rebuild its alias file. Exim does not have the concept of a single alias file, and so it cannot mimic this behaviour. However, calls to /usr/lib/sendmail with the -bi option tend to appear in various scripts such as NIS make files, so the option must be recognized.
If -bi is encountered, the command specified by the bi_command configuration option is run, under the uid and gid of the caller of Exim. If the -oA option is used, its value is passed to the command as an argument. The command set by bi_command may not contain arguments. The command can use the exim_dbmbuild utility, or some other means, to rebuild alias files if this is required. If the bi_command option is not set, calling Exim with -bi is a no-op.
This option runs an Exim receiving process that accepts an incoming, locally-generated message on the current input. The recipients are given as the command arguments (except when -t is also present – see below). Each argument can be a comma-separated list of RFC 2822 addresses. This is the default option for selecting the overall action of an Exim call; it is assumed if no other conflicting option is present.
If any addresses in the message are unqualified (have no domain), they are qualified by the values of the qualify_domain or qualify_recipient options, as appropriate. The -bnq option (see below) provides a way of suppressing this for special cases.
Policy checks on the contents of local messages can be enforced by means of the non-SMTP ACL. See chapter 39 for details.
The return code is zero if the message is successfully accepted. Otherwise, the action is controlled by the -oe’x' option setting – see below.
The format of the message must be as defined in RFC 2822, except that, for compatibility with Sendmail and Smail, a line in one of the forms
From sender Fri Jan 5 12:55 GMT 1997 From sender Fri, 5 Jan 97 12:55:01
(with the weekday optional, and possibly with additional text after the date) is permitted to appear at the start of the message. There appears to be no authoritative specification of the format of this line. Exim recognizes it by matching against the regular expression defined by the uucp_from_pattern option, which can be changed if necessary.
The specified sender is treated as if it were given as the argument to the -f option, but if a -f option is also present, its argument is used in preference to the address taken from the message. The caller of Exim must be a trusted user for the sender of a message to be set in this way.
By default, Exim automatically qualifies unqualified addresses (those without domains) that appear in messages that are submitted locally (that is, not over TCP/IP). This qualification applies both to addresses in envelopes, and addresses in header lines. Sender addresses are qualified using qualify_domain, and recipient addresses using qualify_recipient (which defaults to the value of qualify_domain).
Sometimes, qualification is not wanted. For example, if -bS (batch SMTP) is being used to re-submit messages that originally came from remote hosts after content scanning, you probably do not want to qualify unqualified addresses in header lines. (Such lines will be present only if you have not enabled a header syntax check in the appropriate ACL.)
The -bnq option suppresses all qualification of unqualified addresses in messages that originate on the local host. When this is used, unqualified addresses in the envelope provoke errors (causing message rejection) and unqualified addresses in header lines are left alone.
If this option is given with no arguments, it causes the values of all Exim’s main configuration options to be written to the standard output. The values of one or more specific options can be requested by giving their names as arguments, for example:
exim -bP qualify_domain hold_domains
However, any option setting that is preceded by the word “hide” in the configuration file is not shown in full, except to an admin user. For other users, the output is as in this example:
mysql_servers = <value not displayable>
If configure_file is given as an argument, the name of the run time configuration file is output. If a list of configuration files was supplied, the value that is output here is the name of the file that was actually used.
If log_file_path or pid_file_path are given, the names of the directories where log files and daemon pid files are written are output, respectively. If these values are unset, log files are written in a sub-directory of the spool directory called log, and the pid file is written directly into the spool directory.
If -bP is followed by a name preceded by +
, for example,
exim -bP +local_domains
it searches for a matching named list of any type (domain, host, address, or local part) and outputs what it finds.
If one of the words router, transport, or authenticator is given, followed by the name of an appropriate driver instance, the option settings for that driver are output. For example:
exim -bP transport local_delivery
The generic driver options are output first, followed by the driver’s private options. A list of the names of drivers of a particular type can be obtained by using one of the words router_list, transport_list, or authenticator_list, and a complete list of all drivers with their option settings can be obtained by using routers, transports, or authenticators.
This option requests a listing of the contents of the mail queue on the standard output. If the -bp option is followed by a list of message ids, just those messages are listed. By default, this option can be used only by an admin user. However, the queue_list_requires_admin option can be set false to allow any user to see the queue.
Each message on the queue is displayed as in the following example:
25m 2.9K 0t5C6f-0000c8-00 <alice@wonderland.fict.example> red.king@looking-glass.fict.example <other addresses>
The first line contains the length of time the message has been on the queue (in this case 25 minutes), the size of the message (2.9K), the unique local identifier for the message, and the message sender, as contained in the envelope. For bounce messages, the sender address is empty, and appears as “<>”. If the message was submitted locally by an untrusted user who overrode the default sender address, the user’s login name is shown in parentheses before the sender address.
If the message is frozen (attempts to deliver it are suspended) then the text “*** frozen ***” is displayed at the end of this line.
The recipients of the message (taken from the envelope, not the headers) are displayed on subsequent lines. Those addresses to which the message has already been delivered are marked with the letter D. If an original address gets expanded into several addresses via an alias or forward file, the original is displayed with a D only when deliveries for all of its child addresses are complete.
This option is for testing retry rules, and it must be followed by up to three arguments. It causes Exim to look for a retry rule that matches the values and to write it to the standard output. For example:
exim -brt bach.comp.mus.example Retry rule: *.comp.mus.example F,2h,15m; F,4d,30m;
See chapter 32 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”.
This option is used for batched SMTP input, which is an alternative interface for non-interactive local message submission. A number of messages can be submitted in a single run. However, despite its name, this is not really SMTP input. Exim reads each message’s envelope from SMTP commands on the standard input, but generates no responses. If the caller is trusted, or untrusted_set_sender is set, the senders in the SMTP MAIL commands are believed; otherwise the sender is always the caller of Exim.
The message itself is read from the standard input, in SMTP format (leading dots doubled), terminated by a line containing just a single dot. An error is provoked if the terminating dot is missing. A further message may then follow.
As for other local message submissions, the contents of incoming batch SMTP messages can be checked using the non-SMTP ACL (see chapter 39). Unqualified addresses are automatically qualified using qualify_domain and qualify_recipient, as appropriate, unless the -bnq option is used.
Some other SMTP commands are recognized in the input. HELO and EHLO act as RSET; VRFY, EXPN, ETRN, and HELP act as NOOP; QUIT quits, ignoring the rest of the standard input.
If any error is encountered, reports are written to the standard output and error streams, and Exim gives up immediately. The return code is 0 if no error was detected; it is 1 if one or more messages were accepted before the error was detected; otherwise it is 2.
More details of input using batched SMTP are given in section 44.12.
This option causes Exim to accept one or more messages by reading SMTP commands on the standard input, and producing SMTP replies on the standard output. SMTP policy controls, as defined in ACLs (see chapter 39) are applied. Some user agents use this interface as a way of passing locally-generated messages to the MTA.
In this usage, if the caller of Exim is trusted, or untrusted_set_sender is set, the senders of messages are taken from the SMTP MAIL commands. Otherwise the content of these commands is ignored and the sender is set up as the calling user. Unqualified addresses are automatically qualified using qualify_domain and qualify_recipient, as appropriate, unless the -bnq option is used.
The -bs option is also used to run Exim from inetd, as an alternative to using a listening daemon. Exim can distinguish the two cases by checking whether the standard input is a TCP/IP socket. When Exim is called from inetd, the source of the mail is assumed to be remote, and the comments above concerning senders and qualification do not apply. In this situation, Exim behaves in exactly the same way as it does when receiving a message via the listening daemon.
This option runs Exim in address testing mode, in which each argument is taken as an address to be tested for deliverability. The results are written to the standard output. If a test fails, and the caller is not an admin user, no details of the failure are output, because these might contain sensitive information such as usernames and passwords for database lookups.
If no arguments are given, Exim runs in an interactive manner, prompting with a right angle bracket for addresses to be tested.
Unlike the -be test option, you cannot arrange for Exim to use the readline() function, because it is running as root and there are security issues.
Each address is handled as if it were the recipient address of a message (compare the -bv option). It is passed to the routers and the result is written to the standard output. However, any router that has no_address_test set is bypassed. This can make -bt easier to use for genuine routing tests if your first router passes everything to a scanner program.
The return code is 2 if any address failed outright; it is 1 if no address failed outright but at least one could not be resolved for some reason. Return code 0 is given only when all addresses succeed.
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, you can use the -f option to set an appropriate sender when running -bt tests. Without it, the sender is assumed to be the calling user at the default qualifying domain. However, if you have set up (for example) routers whose behaviour depends on the contents of an incoming message, you cannot test those conditions using -bt. The -N option provides a possible way of doing such tests.
This option causes Exim to write the current version number, compilation number, and compilation date of the exim binary to the standard output. It also lists the DBM library this is being used, the optional modules (such as specific lookup types), the drivers that are included in the binary, and the name of the run time configuration file that is in use.
As part of its operation, -bV causes Exim to read and syntax check its configuration file. However, this is a static check only. It cannot check values that are to be expanded. For example, although a misspelt ACL verb is detected, an error in the verb’s arguments is not. You cannot rely on -bV alone to discover (for example) all the typos in the configuration; some realistic testing is needed. The -bh and -N options provide more dynamic testing facilities.
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 39). If you want to test an entire ACL, see the -bh option.
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 usernames and passwords for database lookups.
If no arguments are given, Exim runs in an interactive manner, prompting with a right angle bracket for addresses to be verified.
Unlike the -be test option, you cannot arrange for Exim to use the readline() function, because it is running as exim and there are security issues.
Verification differs from address testing (the -bt option) in that routers that have no_verify set are skipped, and if the address is accepted by a router that has fail_verify set, verification fails. The address is verified as a recipient if -bv is used; to test verification for a sender address, -bvs should be used.
If the -v option is not set, the output consists of a single line for each address, stating whether it was verified or not, and giving a reason in the latter case. Otherwise, more details are given of how the address has been handled, and in the case of address redirection, all the generated addresses are also considered. Without -v, generating more than one address by redirection causes verification to end sucessfully.
The return code is 2 if any address failed outright; it is 1 if no address failed outright but at least one could not be resolved for some reason. Return code 0 is given only when all addresses succeed.
If any of the routers in the configuration makes any tests on the sender address of a message, you should use the -f option to set an appropriate sender when running -bv tests. Without it, the sender is assumed to be the calling user at the default qualifying domain.
This option causes Exim to find the run time configuration file from the given list instead of from the list specified by the CONFIGURE_FILE compile-time setting. Usually, the list will consist of just a single file name, but it can be a colon-separated list of names. In this case, the first file that exists is used. Failure to open an existing file stops Exim from proceeding any further along the list, and an error is generated.
When this option is used by a caller other than root or the Exim user, and the list is different from the compiled-in list, Exim gives up its root privilege immediately, and runs with the real and effective uid and gid set to those of the caller. However, if ALT_CONFIG_ROOT_ONLY is defined in Local/Makefile, root privilege is retained for -C only if the caller of Exim is root.
That is, the Exim user is no longer privileged in this regard. This build-time option is not set by default in the Exim source distribution tarbundle. However, if you are using a “packaged” version of Exim (source or binary), the packagers might have enabled it.
Setting ALT_CONFIG_ROOT_ONLY locks out the possibility of testing a configuration using -C right through message reception and delivery, even if the caller is root. The reception works, but by that time, Exim is running as the Exim user, so when it re-execs to regain privilege for the delivery, the use of -C causes privilege to be lost. However, root can test reception and delivery using two separate commands (one to put a message on the queue, using -odq, and another to do the delivery, using -M).
If ALT_CONFIG_PREFIX is defined in Local/Makefile, it specifies a
prefix string with which any file named in a -C command line option
must start. In addition, the file name must not contain the sequence /../
.
However, if the value of the -C option is identical to the value of
CONFIGURE_FILE in Local/Makefile, Exim ignores -C and proceeds as
usual. There is no default setting for ALT_CONFIG_PREFIX; when it is
unset, any file name can be used with -C.
ALT_CONFIG_PREFIX can be used to confine alternative configuration files to a directory to which only root has access. This prevents someone who has broken into the Exim account from running a privileged Exim with an arbitrary configuration file.
The -C facility is useful for ensuring that configuration files are syntactically correct, but cannot be used for test deliveries, unless the caller is privileged, or unless it is an exotic configuration that does not require privilege. No check is made on the owner or group of the files specified by this option.
This option can be used to override macro definitions in the configuration file (see section 6.4). However, like -C, if it is used by an unprivileged caller, it causes Exim to give up its root privilege. If DISABLE_D_OPTION is defined in Local/Makefile, the use of -D is completely disabled, and its use causes an immediate error exit.
The entire option (including equals sign if present) must all be within one command line item. -D can be used to set the value of a macro to the empty string, in which case the equals sign is optional. These two commands are synonymous:
exim -DABC ... exim -DABC= ...
To include spaces in a macro definition item, quotes must be used. If you use quotes, spaces are permitted around the macro name and the equals sign. For example:
exim '-D ABC = something' ...
-D may be repeated up to 10 times on a command line.
This option causes debugging information to be written to the standard error stream. It is restricted to admin users because debugging output may show database queries that contain password information. Also, the details of users’ filter files should be protected. When -d is used, -v is assumed. If -d is given on its own, a lot of standard debugging data is output. This can be reduced, or increased to include some more rarely needed information, by directly following -d with a string made up of names preceded by plus or minus characters. These add or remove sets of debugging data, respectively. For example, -d+filter adds filter debugging, whereas -d-all+filter selects only filter debugging. Note that no spaces are allowed in the debug setting. The available debugging categories are:
acl
ACL interpretationauth
authenticatorsdeliver
general delivery logicdns
DNS lookups (see also resolver)dnsbl
DNS black list (aka RBL) codeexec
arguments for execv()
callsexpand
detailed debugging for string expansionsfilter
filter handlinghints_lookup
hints data lookupshost_lookup
all types of name-to-IP address handlingident
ident lookupinterface
lists of local interfaceslists
matching things in listsload
system load checkslocal_scan
can be used by local_scan()
(see chapter 41)lookup
general lookup code and all lookupsmemory
memory handlingpid
add pid to debug output linesprocess_info
setting info for the process logqueue_run
queue runsreceive
general message reception logicresolver
turn on the DNS resolver’s debugging outputretry
retry handlingrewrite
address rewritingroute
address routingtimestamp
add timestamp to debug output linestls
TLS logictransport
transportsuid
changes of uid/gid and looking up uid/gidverify
address verification logicall
almost all of the above (see below), and also -v
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.
The
resolver
option produces output only if the DNS resolver was compiled
with DEBUG enabled. This is not the case in some operating systems. Also,
unfortunately, debugging output from the DNS resolver is written to stdout
rather than stderr.
The default (-d with no argument) omits expand
, filter
,
interface
, load
, memory
, pid
, resolver
, and timestamp
.
However, the pid
selector is forced when debugging is turned on for a
daemon, which then passes it on to any re-executed Exims. Exim also
automatically adds the pid to debug lines when several remote deliveries are
run in parallel.
The timestamp
selector causes the current time to be inserted at the start
of all debug output lines. This can be useful when trying to track down delays
in processing.
If the debug_print option is set in any driver, it produces output whenever any debugging is selected, or if -v is used.
This option sets the address of the envelope sender of a locally-generated message (also known as the return path). The option can normally be used only by a trusted user, but untrusted_set_sender can be set to allow untrusted users to use it.
Processes running as root or the Exim user are always trusted. Other trusted users are defined by the trusted_users or trusted_groups options. In the absence of -f, or if the caller is not trusted, the sender of a local message is set to the caller’s login name at the default qualify domain.
There is one exception to the restriction on the use of -f: an empty sender can be specified by any user, trusted or not, to create a message that can never provoke a bounce. An empty sender can be specified either as an empty string, or as a pair of angle brackets with nothing between them, as in these examples of shell commands:
exim -f '<>' user@domain exim -f "" user@domain
In addition, the use of -f is not restricted when testing a filter file with -bf or when testing or verifying addresses using the -bt or -bv options.
Allowing untrusted users to change the sender address does not of itself make it possible to send anonymous mail. Exim still checks that the From: header refers to the local user, and if it does not, it adds a Sender: header, though this can be overridden by setting no_local_from_check.
White space between -f and the <address> is optional (that is, they can be given as two arguments or one combined argument). The sender of a locally-generated message can also be set (when permitted) by an initial “From ” line in the message – see the description of -bm above – but if -f is also present, it overrides “From”.
This option requests Exim to run a delivery attempt on each message in turn. If any of the messages are frozen, they are automatically thawed before the delivery attempt. The settings of queue_domains, queue_smtp_domains, and hold_domains are ignored.
Retry hints for any of the addresses are overridden – Exim tries to deliver even if the normal retry time has not yet been reached. This option requires the caller to be an admin user. However, there is an option called prod_requires_admin which can be set false to relax this restriction (and also the same requirement for the -q, -R, and -S options).
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.
This is a debugging option that inhibits delivery of a message at the transport level. It implies -v. Exim goes through many of the motions of delivery – it just doesn’t actually transport the message, but instead behaves as if it had successfully done so. However, it does not make any updates to the retry database, and the log entries for deliveries are flagged with “*>” rather than “=>”.
Because -N discards any message to which it applies, only root or the Exim user are allowed to use it with -bd, -q, -R or -M. In other words, an ordinary user can use it only when supplying an incoming message to which it will apply. Although transportation never fails when -N is set, an address may be deferred because of a configuration problem on a transport, or a routing problem. Once -N has been used for a delivery attempt, it sticks to the message, and applies to any subsequent delivery attempts that may happen for that message.
set option
. It is ignored by
Exim.
This option applies to all modes in which Exim accepts incoming messages, including the listening daemon. It requests “background” delivery of such messages, which means that the accepting process automatically starts a delivery process for each message received, but does not wait for the delivery processes to finish.
When all the messages have been received, the reception process exits, leaving the delivery processes to finish in their own time. The standard output and error streams are closed at the start of each delivery process. This is the default action if none of the -od options are present.
If one of the queueing options in the configuration file (queue_only or queue_only_file, for example) is in effect, -odb overrides it if queue_only_override is set true, which is the default setting. If queue_only_override is set false, -odb has no effect.
This option requests “foreground” (synchronous) delivery when Exim has accepted a locally-generated message. (For the daemon it is exactly the same as -odb.) A delivery process is automatically started to deliver the message, and Exim waits for it to complete before proceeding.
The original Exim reception process does not finish until the delivery process for the final message has ended. The standard error stream is left open during deliveries.
However, like -odb, this option has no effect if queue_only_override is false and one of the queueing options in the configuration file is in effect.
If there is a temporary delivery error during foreground delivery, the message is left on the queue for later delivery, and the original reception process exits. See chapter 47 for a way of setting up a restricted configuration that never queues messages.
This option is a hybrid between -odb/-odi and -odq. However, like -odb and -odi, this option has no effect if queue_only_override is false and one of the queueing options in the configuration file is in effect.
When -odqs does operate, a delivery process is started for each incoming message, in the background by default, but in the foreground if -odi is also present. The recipient addresses are routed, and local deliveries are done in the normal way. However, if any SMTP deliveries are required, they are not done at this time, so the message remains on the queue until a subsequent queue runner process encounters it. Because routing was done, Exim knows which messages are waiting for which hosts, and so a number of messages for the same host can be sent in a single SMTP connection. The queue_smtp_domains configuration option has the same effect for specific domains. See also the -qq option.
If an error is detected while a non-SMTP message is being received (for example, a malformed address), the error is reported to the sender in a mail message.
Provided this error message is successfully sent, the Exim receiving process exits with a return code of zero. If not, the return code is 2 if the problem is that the original message has no recipients, or 1 any other error. This is the default -oe’x' option if Exim is called as rmail.
A number of options starting with -oM can be used to set values associated with remote hosts on locally-submitted messages (that is, messages not received over TCP/IP). These options can be used by any caller in conjunction with the -bh, -be, -bf, -bF, -bt, or -bv testing options. In other circumstances, they are ignored unless the caller is trusted.
The -oMa option sets the sender host address. This may include a port number at the end, after a full stop (period). For example:
exim -bs -oMa 10.9.8.7.1234
An alternative syntax is to enclose the IP address in square brackets, followed by a colon and the port number:
exim -bs -oMa [10.9.8.7]:1234
The IP address is placed in the $sender_host_address variable, and the port, if present, in $sender_host_port.
For compatibility with Sendmail, this option is equivalent to
-oMr <rval> -oMs <sval>
It sets the incoming protocol and host name (for trusted callers). The
host name and its colon can be omitted when only the protocol is to be set.
Note the Exim already has two private options, -pd and -ps, that refer to
embedded Perl. It is therefore impossible to set a protocol value of p
or
s
using this option (but that does not seem a real limitation).
This option is normally restricted to admin users. However, there is a configuration option called prod_requires_admin which can be set false to relax this restriction (and also the same requirement for the -M, -R, and -S options).
The -q option starts one queue runner process. This scans the queue of waiting messages, and runs a delivery process for each one in turn. It waits for each delivery process to finish before starting the next one. A delivery process may not actually do any deliveries if the retry times for the addresses have not been reached. Use -qf (see below) if you want to override this.
If the delivery process spawns other processes to deliver other messages down passed SMTP connections, the queue runner waits for these to finish before proceeding.
When all the queued messages have been considered, the original queue runner process terminates. In other words, a single pass is made over the waiting mail, one message at a time. Use -q with a time (see below) if you want this to be repeated periodically.
Exim processes the waiting messages in an unpredictable order. It isn’t very random, but it is likely to be different each time, which is all that matters. If one particular message screws up a remote MTA, other messages to the same MTA have a chance of getting through if they get tried first.
It is possible to cause the messages to be processed in lexical message id order, which is essentially the order in which they arrived, by setting the queue_run_in_order option, but this is not recommended for normal use.
An option starting with -qq requests a two-stage queue run. In the first stage, the queue is scanned as if the queue_smtp_domains option matched every domain. Addresses are routed, local deliveries happen, but no remote transports are run.
The hints database that remembers which messages are waiting for specific hosts is updated, as if delivery to those hosts had been deferred. After this is complete, a second, normal queue scan happens, with routing and delivery taking place as normal. Messages that are routed to the same host should mostly be delivered down a single SMTP connection because of the hints that were set up during the first queue scan. This option may be useful for hosts that are connected to the Internet intermittently.
When scanning the queue, Exim can be made to skip over messages whose ids are lexically less than a given value by following the -q option with a starting message id. For example:
exim -q 0t5C6f-0000c8-00
Messages that arrived earlier than 0t5C6f-0000c8-00
are not inspected. If a
second message id is given, messages whose ids are lexically greater than it
are also skipped. If the same id is given twice, for example,
exim -q 0t5C6f-0000c8-00 0t5C6f-0000c8-00
just one delivery process is started, for that message. This differs from -M in that retry data is respected, and it also differs from -Mc in that it counts as a delivery from a queue run. Note that the selection mechanism does not affect the order in which the messages are scanned. There are also other ways of selecting specific sets of messages for delivery in a queue run – see -R and -S.
When a time value is present, the -q option causes Exim to run as a daemon, starting a queue runner process at intervals specified by the given time value (whose format is described in section 6.15). This form of the -q option is commonly combined with the -bd option, in which case a single daemon process handles both functions. A common way of starting up a combined daemon at system boot time is to use a command such as
/usr/exim/bin/exim -bd -q30m
Such a daemon listens for incoming SMTP calls, and also starts a queue runner process every 30 minutes.
When a daemon is started by -q with a time value, but without -bd, no pid file is written unless one is explicitly requested by the -oP option.
The <rsflags> may be empty, in which case the white space before the string is optional, unless the string is f, ff, r, rf, or rff, which are the possible values for <rsflags>. White space is required if <rsflags> is not empty.
This option is similar to -q with no time value, that is, it causes Exim to perform a single queue run, except that, when scanning the messages on the queue, Exim processes only those that have at least one undelivered recipient address containing the given string, which is checked in a case-independent way. If the <rsflags> start with r, <string> is interpreted as a regular expression; otherwise it is a literal string.
Once a message is selected, all its addresses are processed. For the first selected message, Exim overrides any retry information and forces a delivery attempt for each undelivered address. This means that if delivery of any address in the first message is successful, any existing retry information is deleted, and so delivery attempts for that address in subsequently selected messages (which are processed without forcing) will run. However, if delivery of any address does not succeed, the retry information is updated, and in subsequently selected messages, the failing address will be skipped.
If the <rsflags> contain f or ff, the delivery forcing applies to all selected messages, not just the first; frozen messages are included when ff is present.
The -R option makes it straightforward to initiate delivery of all messages to a given domain after a host has been down for some time. When the SMTP command ETRN is accepted by its ACL (see chapter 39), its default effect is to run Exim with the -R option, but it can be configured to run an arbitrary command instead.
When Exim is receiving a locally-generated, non-SMTP message on its standard input, the -t option causes the recipients of the message to be obtained 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.
If the command has any arguments, they specify addresses to which the message is not to be delivered. That is, the argument addresses are removed from the recipients list obtained from the headers. This is compatible with Smail 3 and in accordance with the documented behaviour of several versions of Sendmail, as described in man pages on a number of operating systems (e.g. Solaris 8, IRIX 6.5, HP-UX 11). However, some versions of Sendmail add argument addresses to those obtained from the headers, and the O’Reilly Sendmail book documents it that way. Exim can be made to add argument addresses instead of subtracting them by setting the option extract_addresses_remove_arguments false.
If a Bcc: header line is present, it is removed from the message unless there is no To: or Cc:, in which case a Bcc: line with no data is created. This is necessary for conformity with the original RFC 822 standard; the requirement has been removed in RFC 2822, but that is still very new.
If there are any Resent- header lines in the message, Exim extracts recipients from all Resent-To:, Resent-Cc:, and Resent-Bcc: header lines instead of from To:, Cc:, and Bcc:. This is for compatibility with Sendmail and other MTAs. (Prior to release 4.20, Exim gave an error if -t was used in conjunction with Resent- header lines.)
RFC 2822 talks about different sets of Resent- header lines (for when a message is resent several times). The RFC also specifies that they should be added at the front of the message, and separated by Received: lines. It is not at all clear how -t should operate in the present of multiple sets, nor indeed exactly what constitutes a “set”. In practice, it seems that MUAs do not follow the RFC. The Resent- lines are often added at the end of the header, and if a message is resent more than 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.