Go to the first, previous, next, last section, table of contents.


5. The Exim 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 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.

5.1 Setting options by program name

If Exim is called under the name mailq, it behaves as if the option -bp were present before any other options. This is for compatibility with some systems that contain a command of that name in one of the standard libraries, symbolically linked to `/usr/lib/sendmail' or `/usr/sbin/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.

5.2 Trusted and admin users

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_UID and EXIM_GID in `Local/Makefile' or set by the exim_user and exim_group options. These do not necessarily have to use the name `exim'.

5.3 Command line options

The command options are described in alphabetical order below.

--

This is a pseudo-option whose only purpose is to terminate the options and therefore to cause subsequent command line items to be treated as arguments rather than options, even if they begin with hyphens.

-B<type>

This is a Sendmail option for selecting 7 or 8 bit processing. Exim is entirely 8-bit clean; it ignores this option.

-bd

Run Exim as a daemon, awaiting incoming SMTP connections. This option can be used only by an admin user. If either of the -d or -dm options are set, the daemon does not disconnect from the controlling terminal. By default, Exim listens for incoming connections on all the host's interfaces, but it can be restricted to specific interfaces by setting the local_interfaces option in the configuration file. The standard SMTP port is used, but this can be varied by means of the daemon_smtp_port configuration option or the -oX command line option. Most commonly, the -bd option is combined with the -q<time> option, to cause periodic queue runs to happen as well.

The process id of a daemon that is both listening on the standard SMTP port and periodically starting queue runners is written to a file called `exim-daemon.pid' in Exim's spool directory. If a non-standard port is used, the file name is `exim-daemon.<port-number>.pid'. If a daemon is run with only one of -bd or -q<time>, that option is added on to the end of the file name, allowing sites that run two separate daemons to distinguish them.

It is possible to change the directory in which these pid files are written by changing the setting of PID_FILE_PATH in `Local/Makefile'. The files are written while Exim is still running as root. Further details are given in the comments in `src/EDITME'.

The SIGHUP signal can be used to cause the daemon to re-exec itself. This should be done whenever Exim's configuration file is changed, or a new version of Exim is installed. It is not necessary to do this when other files (for example, alias files) are changed.

-be

Run Exim in expansion testing mode. Exim discards its root privilege, to prevent ordinary users from using this mode to read otherwise inaccessable files. If no arguments are given, it runs interactively, prompting for lines of data. 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.

-bF <filename>

This option is the same as -bf except that it assumes that the filter being tested is a system filter. The additional commands that are available only in system filters are recognized.

-bf <filename>

Run Exim in 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 a system filter file is being tested, -bF should be used instead of -bf. If the test file does not begin with the special line

# Exim filter

then it is taken to be a normal `.forward' file, and is tested for validity under that interpretation. The result of this command, 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 interface 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. These are:

-bfd             <domain>               default is the qualify domain
-bfl             <local_part>           default is the logged in user
-bfp             <local_part_prefix>    default is null
-bfs             <local_part_suffix>    default is null

The local part should always be set to the incoming address with any prefix or suffix stripped, because that is how it appears when a message is actually being delivered.

-bh <IP address>

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 full stop. For example:

exim -bh 10.9.8.7.1234
exim -bh fe80::a00: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 for testing configuration options for blocking hosts and/or senders and for checking on relaying control. 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 if this is important.

-bi

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 -bi 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.

-bm

Accept an incoming, locally-generated message on the current input, and deliver it to the addresses given as the command arguments (except when -t is also given -- see below). Each argument can be a comma-separated list of RFC 822 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.

The format of the message must be as defined in RFC 822, 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.

-bp

List 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.book>
          red.king@looking-glass.fict.book
          <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. If the message is a delivery error message, 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.

-bpa

This option operates like -bp, but in addition it shows delivered addresses that were generated from the original top level address(es) in each message by alias or forwarding operations. These addresses are flagged with `+D' instead of just `D'.

-bpc

This option counts the number of messages on the queue, and writes the total to the standard output. It is restricted to admin users, unless queue_list_requires_admin is set false.

-bpr

This option operates like -bp, but the output is not sorted into chronological order of message arrival. This can speed it up when there are lots of messages on the queue, and is particularly useful if the output is going to be post-processed in a way that doesn't need the sorting.

-bpra

This option is a combination of -bpr and -bpa.

-bpru

This option is a combination of -bpr and -bpu.

-bpu

This option operates like -bp but shows only undelivered top-level addresses for each message displayed. Addresses generated by aliasing or forwarding are not shown, unless the message was deferred after processing by a director with the one_time option set.

-bP

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 local_domains

However, any configuration setting that was preceded by the word `hide' is not shown in full, except to an admin user. For other users, output such as

mysql_servers = <value not displayable>

is used. If configure_file is given as an argument, the name of the run time configuration file is output. 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 pid files are written directly into the spool directory.

If one of the words director, 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 director_list, router_list, transport_list, or authenticator_list, and a complete list of all drivers with their option settings can be obtained by using directors, routers, transports, or authenticators.

-brt

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
Retry rule: *.comp.mus  F,2h,15m; FG,4d,30m;

See chapter 33 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'.

-brw

This option is for testing address rewriting rules, and it must be followed by a single argument, consisting of either a local part without a domain, or a complete address with a fully qualified domain. Exim outputs how this address would be rewritten for each possible place it might appear. See chapter 34 for further details.

-bS

This option is used for batched SMTP input, where messages have been received from some external source by an alternative transport mechanism. It causes Exim to accept one or more messages by reading SMTP on the standard input, but to generate no responses. If any error is encountered reports are written to the standard output and error streams, and Exim gives up immediately.

If the caller is trusted, or untrusted_set_sender is set, the senders in the MAIL commands are believed; otherwise the sender is always the caller of Exim. Unqualified senders and receivers are not rejected (there seems little point) but instead just get qualified. Sender addresses are verified if sender_verify is set, unless sender_verify_batch is unset (which is the default). Receiver verification and administrative rejection is not done, even if configured. HELO and EHLO act as RSET; VRFY, EXPN, ETRN, HELP, and DEBUG act as NOOP; QUIT quits. 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 48.9.

-bs

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. Some user agents use this interface as a way of passing locally-generated messages to the MTA. The option can also be used to run Exim from inetd, as an alternative to using a listening daemon, in which case the standard input is the connected socket. Exim distinguishes between the two cases by attempting to read the IP address of the peer connected to the standard input. If it is not a socket, the call to getpeername() fails, and Exim assumes it is dealing with a local message.

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.

-bt

Run in address testing mode, in which each argument is taken as an address to be tested. The results are written to the standard output. If no arguments are given, Exim runs in an interactive manner, prompting with a right angle bracket for addresses to be tested. Each address is handled as if it were the recipient address of a message and passed to the appropriate directors or routers (compare the -bv option); the result is written to the standard output. 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 directors or 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) directors and 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.

-bV

Write the current version number, compilation number, and compilation date of the exim binary to the standard output.

-bv

Verify the addresses that are given as the arguments to the command, and write the results to the standard output. If no arguments are given, Exim runs in an interactive manner, prompting with a right angle bracket for addresses to be tested. Verification differs from address testing (the -bt option) in that directors and routers that have no_verify set are skipped, and if the address is accepted by a director or router that has fail_verify set, verification fails. This is the same logic that is used when verifying addresses of incoming messages (see chapter 45). The address is verified as a recipient if -bv is used; to verify as for a sender address, -bvs should be used.

If the -v (or -d) 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 aliases or forwarding, all the generated addresses are also considered. Otherwise, generating an address by forwarding, or more than one address by aliasing, 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 directors or 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.

-bvs

This option acts like -bv, but verifies the address as a sender rather than a recipient address. This affects any rewriting and qualification that might happen.

-C <filename>

Read the run time configuration from the given file instead of from the default file specified by the CONFIGURE_FILE compile-time setting. When this option is used by an unprivileged caller and the file name given is different from the compiled-in name, Exim gives up its root privilege immediately, and runs with the real and effective uid and gid set to those of the caller, to avoid any security exposure. It does not do this if the caller is root or the Exim user defined by EXIM_UID in `Local/Makefile'. The 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's an exotic configuration that does not require privilege. No check is made on the owner or group of the file specified by this option.

-D<macro>=<value>

This option can be used to override macro definitions in the configuration file (see section 7.2). However, like -C, if it is used by an unprivileged caller, it causes Exim to give up its root privilege. This option may be repeated up to 10 times on a command line.

-d<number>

Set a debug level, causing debugging information to be written to the standard error file. White space between -d and the number is optional. If no number is given, 1 is assumed, and the higher the number, the more output is produced. A value of zero turns debugging output off and is the default. A value of 9 gives the maximum amount of general information, 10 gives in addition details of the interpretation of filter files, and 11 or higher also turns on the debugging option for DNS lookups.

For non-admin users, the number is ignored, and a debug level of 1 is always used. This restriction exists because debugging output may show database queries that contain password information, and also the details of users' filter files should be protected.

-df

If this option is set and STDERR_FILE was defined when Exim was built, debugging information is written to the file defined by that variable instead of to the standard error file. This option provides a way of obtaining debugging information when Exim is run from inetd.

-dm

This option causes information about memory allocation and freeing operations to be written to the standard error file.

-dropcr

At least one MUA (dtmail) that calls an MTA via the command line is broken in that it terminates each line with CRLF, instead of just LF, which is the usual Unix convention, and although this bug has been admitted, it apparently won't get fixed. There is also some UUCP software which leaves CR at the ends of lines in messages. As a slight pander to these programs, the -dropcr option causes Exim to drop all CR characters in an incoming non-SMTP message.

-E

This option specifies that an incoming message is a locally-generated delivery failure report. It is used internally by Exim when handling delivery failures and is not intended for external use. Its only effect is to stop Exim generating certain messages to the mailmaster, as otherwise message cascades could occur in some situations. As part of the same option, a message id may follow the characters -E. If it does, the log entry for the receipt of the new message contains the id, following `R=', as a cross-reference.

-ex

There are a number of Sendmail options starting with -oe which seem to be called by various programs without the leading o in the option. For example, the vacation program uses -eq. Exim treats all options of the form -ex as synonymous with the corresponding -oex options.

-F <string>

Set the sender's full name for use when a locally-generated message is being accepted. In the absence of this option, the user's gecos entry from the password file is used. As users are generally permitted to alter their gecos entries, no security considerations are involved. White space between -F and the <string> is optional.

-f <address>

Set the address of the envelope sender of a locally-generated message (also known as the return path). This option can normally be used only by root or the Exim user or by one of the configured trusted users, but if untrusted_set_sender is set, its use is not restricted. However, even when untrusted_set_sender is not set, anyone may use it when testing a filter file with -bf or when testing or verifying addresses using the -bt or -bv options. There is also no restriction of the use of the special setting -f <> to send a message with an empty sender; such a message can never provoke a bounce. In other cases, the sender of a local message is set up as the user who ran the exim command, and -f is ignored,

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. 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 '.

-h <number>

This option is accepted for compatibility with Sendmail, but at present has no effect. (In Sendmail it overrides the `hop count' obtained by counting Received: headers.)

-i

This option, which has the same effect as -oi, specifies that a dot on a line by itself should not terminate an incoming, non-SMTP message. I can find no documentation for this option in Solaris 2.4 Sendmail, but the mailx command in Solaris 2.4 uses it.

-M <message id> <message id>

Exim runs 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_remote_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).

-Mar <message id> <address> <address>

The first argument must be a message id, and the remaining ones must be email addresses. Exim adds the addresses to the list of recipients of the message (`ar' for `add recipients'). However, if the message is active (in the middle of a delivery attempt), its status is not altered. This option can be used only by an admin user.

-MC <transport> <hostname> <sequence number> <message id>

This option is not intended for use by external callers. It is used internally by Exim to invoke another instance of itself to deliver a waiting message using an existing SMTP channel, which is passed as the standard input. Details are given in chapter 48. This must be the final option, and the caller must be root or the Exim user in order to use it.

-MCA

This option is not intended for use by external callers. It is used internally by Exim in conjunction with -MC option. It signifies that the connection to the remote host has been authenticated.

-MCQ <process id> <pipe fd>

This option is not intended for use by external callers. It is used internally by Exim in conjunction with -MC option when the original delivery was started by a queue runner. It passes on the process id of the queue runner, together with the file descriptor number of an open pipe. Closure of the pipe signals the final completion of the sequence of processes that are passing messages through the same SMTP channel.

-MCS

This option is not intended for use by external callers. It is used internally by Exim in conjunction with -MC option, and passes on the fact that the SMTP SIZE option should be used on messages delivered down the existing channel.

-MCT

This option is not intended for use by external callers. It is used internally by Exim in conjunction with -MC option, and passes on the fact that the host to which Exim is connected supports TLS encryption.

-Mc <message id> <message id>

Exim runs a delivery attempt on each message in turn, but unlike the -M option, it does check for retry hints, and respects any that are found. This option is not very useful to external callers. It is provided mainly for internal use by Exim when it needs to re-invoke itself in order to regain root privilege for a delivery (see chapter 55). However, -Mc can be useful when testing, in order to run a delivery that respects retry times and other options such as hold_domains that are overridden when -M is used. Such a delivery does not count as a queue run. If you want to run a specific delivery as if in a queue run, you should use -q with a message id argument. A distinction between queue run deliveries and other deliveries is made in one or two places.

-Meb <message id>

This runs, under /bin/sh, the command defined in the shell variable VISUAL or, if that is not defined, EDITOR or, if that is not defined, the command vi, on a copy of the spool file containing the body of message (`eb' for `edit body'). If the editor exits normally, the result of editing replaces the spool file. The message is locked during this process, so no delivery attempts can occur. Note that the first line of the spool file is its own name; care should be taken not to disturb this. The thinking behind providing this feature is that an administrator who has had to mess around with the addresses to get a message delivered might want to add some comment at the start of the message text. This option can be used only by an admin user.

-Mes <message id> <address>

There must be exactly two arguments. The first argument must be a message id, and the second one an email address. Exim changes the sender address in the message to the given address, which must be a fully qualified address or `<>' (`es' for `edit sender'). However, if the message is active (in the middle of a delivery attempt), its status is not altered. This option can be used only by an admin user.

-Mf <message id> <message id>

Each listed message is marked `frozen'. This prevents any delivery attempts taking place until the message is `thawed', either manually or as a result of the auto_thaw configuration option. However, if any of the messages are active (in the middle of a delivery attempt), their status is not altered. This option can be used only by an admin user.

-Mg <message id> <message id>

Exim gives up trying to deliver the listed messages, including any that are frozen. A delivery error message is sent, containing the text `cancelled by administrator'. However, if any of the messages are active, their status is not altered. This option can be used only by an admin user.

-Mmad <message id> <message id>

Exim marks all the recipient addresses in the messages as already delivered (`mad' for `mark all delivered'). However, if any message is active (in the middle of a delivery attempt), its status is not altered. This option can be used only by an admin user.

-Mmd <message id> <address> <address>

The first argument must be a message id, and the remaining ones must be email addresses. Exim marks the given addresses as already delivered (`md' for `mark delivered'). However, if the message is active (in the middle of a delivery attempt), its status is not altered. This option can be used only by an admin user.

-Mrm <message id> <message id>

Each message is completely removed from Exim's queue, and forgotten. However, if any of the messages are active, their status is not altered. This option can be used only by an admin user or by the user who originally caused the message to be placed on the queue.

-Mt <message id> <message id>

Each of the listed messages that was `frozen' is now `thawed', so that delivery attempts can resume. However, if any of the messages are active, their status is not altered. This option can be used only by an admin user.

-Mvb <message id>

The contents of the message body (-D) spool file are written to the standard output. This option can be used only by an admin user.

-Mvh <message id>

The contents of the message headers (-H) spool file are written to the standard output. This option can be used only by an admin user.

-Mvl <message id>

The contents of the message log spool file are written to the standard output. This option can be used only by an admin user.

-m

This is apparently a synonym for -om that is accepted by Sendmail, so Exim treats it that way too.

-N

This is a debugging option that inhibits delivery of a message at the transport level. It implies at least -d1. 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 or directing 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.

-n

This option is interpreted by Sendmail to mean `no aliasing'. It is ignored by Exim.

-oA <file name>

This option is used by Sendmail in conjunction with -bi to specify an alternative alias file name. Exim handles -bi differently; see the description above.

-oB <n>

This is a debugging option which limits the maximum number of multiple SMTP deliveries down one channel to <n>, overriding the value set in the smtp transport. If <n> is omitted, the limit is set to 1 (no batching).

-odb

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 another delivery process for each message received. Exim does not wait for such processes to complete (it can take some time to perform SMTP deliveries). This is the default action if none of the -od options are present.

-odf

This option (compatible with Smail) requests `foreground' (synchronous) delivery when Exim has accepted a locally-generated message. (For the daemon it is exactly the same as -odb.) For a single message received on the standard input, if the protection regime permits it (see chapter 55), Exim converts the reception process into a delivery process. In other cases, it creates a new delivery process, and then waits for it to complete before proceeding.

-odi

This option is synonymous with -odf. It is provided for compatibility with Sendmail.

-odq

This option applies to all modes in which Exim accepts incoming messages, including the listening daemon. It specifies that the accepting process should not automatically start a delivery attempt for each message received. Messages are placed on the queue, and remain there until a subsequent queue-running process encounters them. The queue_only configuration option has the same effect.

-odqr

This option applies to all modes in which Exim accepts incoming messages, including the listening daemon. It causes Exim to process local addresses when a message is received, but not even to try routing remote addresses. Contrast with -odqs below, which does the routing, but not the delivery. The remote addresses will be picked up by the next queue runner. The queue_remote_domains configuration option has the same effect for specific domains.

-odqs

This option is a hybrid between -odb and -odq. A delivery process is started for each incoming message, the addresses are all processed, and local deliveries are done in the normal way. However, if any SMTP deliveries are required, they are not done at this time. Such messages remain on the queue until a subsequent queue-running process encounters them. Because routing was done, Exim knows which messages are waiting for which hosts, and so a number of messages for the same host will get sent in a single SMTP connection. The queue_smtp_domains configuration option has the same effect for specific domains. See also the -qq option.

-oee

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 the message is successfully sent, Exim exits with a return code of zero. If not, the return code is 2 if the error was that the message had no recipients, and 1 otherwise. This is the default -oex option if Exim is called as rmail.

-oem

This is the same as -oee, except that Exim always exits with a non-zero return code, whether or not the error message was successfully sent. This is the default -oex option, unless Exim is called as rmail.

-oep

If an error is detected while a non-SMTP message is being received, the error is reported by writing a message to the standard error file (stderr).

-oeq

This option is supported for compatibility with Sendmail, but has the same effect as -oep.

-oew

This option is supported for compatibility with Sendmail, but has the same effect as -oem.

-oi

This option, which has the same effect as -i, specifies that a dot on a line by itself should not terminate an incoming, non-SMTP message. This is the default if Exim is called as rmail.

-oitrue

This option is treated as synonymous with -oi.

-oMa <host address>

This option sets the sender host address value, and can be used only by a trusted caller, except in conjunction with the -bh, -bf, -bF, -bt, or -bv testing options. The host address may include a port number at the end, after full stop. For example

exim -bs -oMa 10.9.8.7.1234

A real incoming connection overrides the address set by -oMa. The value is used in log entries and can appear in Received: headers. The option is intended for use when handing to Exim messages received by other means, either via the command line or by using the -bs option. If -oMt is set then -oMa should normally be set as well.

-oMas <address>

This option sets the authenticated sender value, and can be used only by a trusted caller. It overrides the sender address that is created from the caller's login for messages from local sources. However, it may be overridden in turn by a message that is received over an authenticated SMTP connection. See chapter 35 for more discussion of authenticated senders.

-oMai <string>

This option sets the authenticated id value, and can be used only by a trusted caller. It overrides the default value (the caller's login id) for messages from local sources. However, it may be overridden in turn by a successful authentication on an SMTP connection. See chapter 35 for more discussion of authenticated ids.

-oMi <interface address>

This option sets the IP interface address value, and can be used only by a trusted caller, except in conjunction with the -bh, -bf, -bF, -bt, or -bv testing options. A real incoming connection overrides the address set by -oMi. The option is intended for use when handing to Exim messages received by other means, either via the command line or by using the -bs option.

-oMr <protocol name>

This option sets the received protocol value, and can be used only by a trusted caller, except in conjunction with the -bh, -bf, -bF, -bt, or -bv testing options. The value is used in log entries and can appear in Received: headers. The option is intended for use when handing to Exim messages received by other means. It applies only to non-SMTP and batched SMTP input.

-oMs <host name>

This option sets the sender host name value, and can be used only by a trusted caller, except in conjunction with the -bh, -bf, -bF, -bt, or -bv testing options. The value is used in log entries and can appear in Received: headers. The option is intended for use when handing to Exim messages received by other means.

-oMt <ident string>

This option sets the sender ident value, and can be used only by a trusted caller, except in conjunction with the -bh, -bf, -bF, -bt, or -bv testing options. The value is used in log entries and can appear in Received: headers. The default setting for local callers is the login id of the calling process. This can be overridden by supplying an empty argument. The option is intended for use when handing to Exim messages received by other means.

-om

In Sendmail, this option means `me too', indicating that the sender of a message should receive a copy of the message if the sender appears in an alias expansion. Exim always does this, so the option does nothing.

-oo

This option is ignored. In Sendmail it specifies `old style headers', whatever that means.

-or <time>

This option sets a timeout value for incoming non-SMTP messages. If it is not set, Exim will wait forever for the standard input. The value can also be set using the accept_timeout configuration variable. The format used for specifying times is described in section 7.7.

-ov

This option has exactly the same effect as -v.

-oX <number>

This option is relevant only when the -bd option is also given. It overrides any setting of the daemon_smtp_port option, and specifies an alternative TCP/IP port number for the listening daemon. When used, the process number of the daemon is written to a file whose name is exim-daemon.<number>.pid in Exim's spool directory or the directory specified by PID_FILE_PATH in `Local/Makefile'.

-pd

This option applies when an embedded Perl interpreter is linked with Exim (see chapter 10). It overrides the setting of the perl_at_start option, forcing the starting of the interpreter to be delayed until it is needed.

-ps

This option applies when an embedded Perl interpreter is linked with Exim (see chapter 10). It overrides the setting of the perl_at_start option, forcing the starting of the interpreter to occur as soon as Exim is started.

-q

If the -q option is not followed by a time value, it requests a single queue run operation. 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 -M, -R, and -S options).

Exim starts up a delivery process for each (inactive) message on the queue in turn, and waits for it to finish before starting the next one. 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 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.

When scanning the queue (either randomly or in order), 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.

-q <time>

This version of the -q option (which again can be run only by an admin user) 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 7.7). 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

/opt/exim/bin/exim -bd -q30m

Such a daemon listens for incoming SMTP calls, and also fires up a queue-runner process every 30 minutes. The process id of such a daemon is written to a file called exim-daemon.pid in Exim's spool directory, unless the -oX option has been used, in which case the file is called exim-daemon.<port-number>.pid. The location of the pid file can be changed by defining PID_FILE_PATH in `Local/Makefile'. If a daemon is started without -bd then the -q option used to start it is added to the pid file name.

-qf

This option operates like -q, and may appear with or without a following time. The difference is that a delivery attempt is forced for each non-frozen message, whereas with -q only those non-frozen addresses that have passed their retry times are tried.

-qff

This option operates like -qf and may appear with or without a following time. The difference is that any frozen messages are automatically thawed, and delivery is attempted for them.

-qfl

This option operates like -ql, and may appear with or without a following time. The difference is that a delivery attempt is forced for the local addresses in each non-frozen message, whereas with -ql only those non-frozen local addresses that have passed their retry times are tried.

-qffl

This option operates like -qfl and may appear with or without a following time. The difference is that any frozen messages are automatically thawed, and delivery is attempted for any local addresses in them.

-ql

This option operates like -q, and may appear with or without a following time. The difference is that only local addresses (those with domains that match local_domains) are considered for delivery. Note that -ql cannot detect apparently remote addresses that actually turn out to be local when their domains get fully qualified.

-qq

If any command line option starting with -q is specified with an additional q (for example, -qqf) then all the resulting queue runs are done in two stages. In the first stage, the queue is scanned as if the queue_smtp_domains option matched every domain. This causes remote addresses to be routed, but no transportation to be done. The 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, and normal directing, routing, and delivery takes place. Messages which 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.

-qR<flags> <string>

This option is synonymous with -R. It is provided for Sendmail compatibility.

-qS<flags> <string>

This option is synonymous with -S.

-R<flags> <string>

The <flags> 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 <flags>. White space is required if <flags> 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 address containing the given string, which is checked in a case-independent way. If the <flags> start with `r', <string> is interpreted as a regular expression; otherwise it is a literal string. If the <flags> contain `ff' then frozen messages are included; otherwise they are omitted.

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 <flags> contain `f' or `ff' then the delivery forcing applies to all selected messages, not just the first.

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 permitted (see the smtp_etrn_hosts option), its default effect is to run Exim with the -R option, but it can be configured to run an arbitrary command instead.

-r

This is a documented (for Sendmail) obsolete alternative name for -f.

-S<flags> <string>

This option acts like -R except that it checks the string against each message's sender instead of against the recipients. If -R is also set, both conditions must be met for a message to be selected. If either of the options has `f' or `ff' in its flags, the associated action is taken.

-t

When Exim is receiving a locally-generated, non-SMTP message on the current input, the -t option causes the recipients of the message to be obtained from the To:, Cc:, and Bcc: headers in the message instead of from the command arguments. The addresses are extracted before any rewriting takes place.

If there are in fact 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 2.6, IRIX 6.5, HP-UX 11). However, some versions of Sendmail add argument addresses to those obtained from the headers, and a 1994 Sendmail book documents it that way. Exim can be made to behave in this way by setting the option extract_addresses_remove_arguments false.

If a Bcc: header is present, it is removed from the message unless there is no To: or Cc: header, in which case a Bcc: header with no data is created, in accordance with RFC 822.

-U

Sendmail uses this option for `initial message submission', and its documentation states that in future releases, it may complain about syntactically invalid messages rather than fixing them when this flag is not set. Exim ignores this option.

-v

This option has exactly the same effect as -d1; it causes Exim to be `verbose' and produce some output describing what it is doing on the standard error file. In particular, if an SMTP connection is made, the SMTP dialogue is shown.

-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'). It sets -x when calling the MTA from its mail command. Exim ignores this option.


Go to the first, previous, next, last section, table of contents.