EXIM(8)

๐Ÿ’– exim(8) โ€” System Manager's Manual ๐Ÿ’–


โœจ NAME โœจ

exim โ€” a Mail Transfer Agent, and bestie she is serving.


โœจ SYNOPSIS โœจ

exim [options] arguments ...
mailq [options] arguments ...
rsmtp [options] arguments ...
rmail [options] arguments ...
runq [options] arguments ...
newaliases [options] arguments ...

โœจ DESCRIPTION โœจ

Okay so Exim is a mail transfer agent (MTA) developed at the University of Cambridge. It is a large program with very many facilities. For a full specification, see the reference manual. This man page contains only a description of the command line options. It has been automatically generated from the reference manual source, hopefully without too much mangling.

Like other MTAs, Exim replaces Sendmail, and is normally called by user agents (MUAs) using the path /usr/sbin/sendmail when they submit messages for delivery (some operating systems use /usr/lib/sendmail). This path is normally set up as a symbolic link to the Exim binary. It may also be used by boot scripts to start the Exim daemon. Many of Exim's command line options are compatible with Sendmail so that it can act as a drop-in replacement.


โœจ DEFAULT ACTION โœจ

If no options are present that require a specific action (such as starting the daemon or a queue runner, testing an address, receiving a message in a specific format, or listing the queue), and there are no arguments on the command line, Exim outputs a brief message about itself and exits.

However, if there is at least one command line argument, -bm (accept a local message on the standard input, with the arguments specifying the recipients) is assumed. Thus, for example, if Exim is installed in /usr/sbin, you can send a message from the command line like this:

  /usr/sbin/exim -i <recipient-address(es)>
  <message content, including all the header lines>
  CTRL-D

The -i option prevents a line containing just a dot from terminating the message. Only an end-of-file (generated by typing CTRL+D if the input is from a terminal) does so.


โœจ SETTING OPTIONS BY PROGRAM NAME โœจ

If an Exim binary is called using one of the names listed in this section (typically via a symbolic link), certain options are assumed.

  • mailq โ€” Behave 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.
  • rsmtp โ€” 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.
  • rmail โ€” Behave 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. The -i option specifies that a dot on a line by itself does not terminate a non-SMTP message; -oee requests that errors detected in non-SMTP messages be reported by emailing the sender.
  • runq โ€” Behave 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. It processes the queue once, then exits.
  • newaliases โ€” Behave 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 specified command if called with the -bi option.

โœจ OPTIONS โœจ

  • -- -- โ€” 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.
  • --help โ€” This option causes Exim to output a few sentences stating what it is. The same output is generated if the Exim binary is called with no options and no arguments.
  • --version โ€” This option is an alias for -bV and causes version information to be displayed.
  • -Ac, -Am โ€” These options are used by Sendmail for selecting configuration files and are ignored by Exim.
  • -atrn <host> โ€” This option requests an ODMR customer connection.
  • -B <type> โ€” This is a Sendmail option for selecting 7 or 8 bit processing. Exim is 8-bit clean; it ignores this option.
  • -bd โ€” 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.

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

Either a SIGTERM or a SIGINT signal should be used to cause the daemon to cleanly shut down. Subprocesses handling receiving or delivering messages, or for scanning the queue, will not be affected by the termination of the daemon process.

  • -bdf โ€” This option has the same effect as -bd except that it never disconnects from the controlling terminal, even when no debugging is specified.
  • -be โ€” 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. Otherwise, it processes each argument in turn.

If Exim was built with USE_READLINE=yes in Local/Makefile, it tries to load the libreadline library dynamically whenever the -be option is 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 runtime 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 $message_exim_id) are set, because no message is being processed (but see -bem and -Mset).

Note: If you use this mechanism to test lookups, and you change the data files or databases you are using, you must exit and restart Exim before trying the same lookup again. Otherwise, because each Exim process caches the results of lookups, you will just get the same result as before.

Macro processing is done on lines before string-expansion: new macros can be defined and macros will be expanded. Because macros in the config file are often used for secrets, those are only available to admin users.

The word "set" at the start of a line, followed by a single space, is recognised specially as defining a value for a variable. If the sequence ",t" is inserted before the space, the value is marked as tainted. The syntax is otherwise the same as the ACL modifier "set =".

  • -bem <filename> โ€” This option operates like -be except that it must be followed by the name of a file. For example:
exim -bem /tmp/testmessage

The file is read as a message (as if receiving a locally-submitted non-SMTP message) before any of the test expansions are done. Thus, message-specific variables such as $message_size and $header_from: are available. However, no Received: header is added to the message. If the -t option is set, recipients are read from the headers in the normal way, and are shown in the $recipients variable. Note that recipients cannot be given on the command line, because further arguments are taken as strings to expand (just like -be).

  • -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> โ€” 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

That little trick is chef's kiss when your system filter is out there adding header lines or setting filter variables that your user filter then goes and reads. ๐Ÿ’…

Oh and pookie, heads up: if your test filter file doesn't start with one of these special magic lines โ€”

  # Exim filter
  # Sieve filter

โ€” then Exim is just gonna assume it's a plain old .forward file and validity-check it as such. No cap.

So what do you get back? If Exim runs with -bf and nothing blows up, you get a whole list of the actions Exim would try to take if it were actually handed the message for real. Iconic. The nitty gritty on filter testing lives in the separate document called Exim's interfaces to mail filtering โ€” go read it, bestie.

Also, when you're testing a filter file, the envelope sender can be set with the -f option, or by a "From " line at the very start of your test message. And the various parameters that would normally come off the envelope recipient address of the message? You set those with extra command line options โ€” literally the next four options, keep reading. โœจ


โœจ OPTIONS โœจ

  • -bfd <domain> โ€” sets the domain of the recipient address when you're testing a filter file with -bf. Default? That's $qualify_domain. ๐ŸŒธ
  • -bfl <local part> โ€” sets the local part of the recipient address while testing a filter file with -bf. Default is the username of the process that called Exim. Pro tip from your girl: give the local part with any prefix or suffix stripped off, because that's exactly how it shows up to the filter when a message is genuinely being delivered. Periodt.
  • -bfp <prefix> โ€” sets the prefix of the local part of the recipient address when a filter file is being tested via -bf. Default is an empty prefix. ๐ŸŽ€
  • -bfs <suffix> โ€” sets the suffix of the local part of the recipient address when a filter file is being tested via -bf. Default is an empty suffix. ๐ŸŽ€
  • -bh <IP address> โ€” this one runs a fake SMTP session as if it were coming from the IP address you give, using standard input and standard output. And yes, the IP address can have a port number tacked on the end, after a full stop. Like so:
  exim -bh 10.9.8.7.1234
  exim -bh fe80::a00:20ff:fe86:a061.5678

If you hand it an IPv6 address, it gets converted into canonical form. So for that second example up there, the value of $sender_host_address after canonical conversion is fe80:0000:0000:0a00:20ff:fe86:a061.5678. ๐Ÿ‘‘

Commentary about what's going on gets written to the standard error file โ€” including lines starting with "LOG" for anything that would have been logged. The whole point of this facility is testing configuration options for incoming messages, to make sure they actually implement the policy you want. For example, you can test your relay controls with -bh. So useful, fr fr.

Warning 1: You can test config features that rely on ident (RFC 1413) information by using the -oMt option. But โ€” and this is the catch โ€” Exim cannot actually perform an ident callout when testing with -bh, because there's no incoming SMTP connection. ๐Ÿ’€
Warning 2: Address verification callouts are also skipped when testing with -bh. If you want those callouts to actually happen, use -bhc instead. Bestie, don't get caught out.

Messages you supply during the testing session are discarded, and nothing gets written to any of the real log files. There may be pauses while DNS (and other) lookups happen, and obviously those can time out. If that matters to you, -oMi can specify a specific IP interface and port, and -oMaa and -oMai can set parameters as if the SMTP session were authenticated.

Oh, and the exim_checkaccess utility is basically a "packaged" version of -bh whose output just tells you whether a given recipient address from a given host is acceptable or not. Convenient. ๐ŸŒˆ

Features like authentication and encryption โ€” where the client input isn't plain text โ€” can't easily be tested with -bh. For those, go grab a specialized SMTP test program such as swaks. ๐Ÿฆ‹

  • -bhc <IP address> โ€” operates exactly the same way as -bh, except that address verification callouts are performed if required. That includes consulting and updating the callout cache database. ๐Ÿ”ฅ
  • -bi โ€” so Sendmail reads -bi as "rebuild my alias file." Exim doesn't have the concept of a single alias file, so it literally cannot mimic that behaviour. But calls to /usr/lib/sendmail with -bi keep showing up in various scripts like NIS make files, so the option has to be recognized. ๐Ÿ’…

When -bi shows up, 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. And listen: 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 that's what you need. And if bi_command isn't set? Calling Exim with -bi is a total no-op. ๐Ÿ™ˆ

  • -bI:help โ€” okay so there's a whole family of options starting with -bI: for querying Exim for information. Many of them produce output meant for machine consumption. This one is not. -bI:help asks Exim for a synopsis of the supported options beginning -bI:. And heads up: using any of these options makes Exim exit right after producing the requested output. โœจ
  • -bI:dscp โ€” if Exim was built with DSCP support, this option makes it emit an alphabetically sorted list of all recognised DSCP names. ๐Ÿ“‹
  • -bI:modules โ€” this one makes Exim emit a list of the dynamic-load modules that are installed on the system. ๐Ÿงš
  • -bI:sieve โ€” if Exim was built with Sieve support, this makes it emit an alphabetically sorted list of all supported Sieve protocol extensions on stdout, one per line. It's anticipated to be useful for ManageSieve (RFC 5804) implementations, providing that protocol's SIEVE capability response line. And since the precise list can depend on compile-time build options โ€” which this option adapts to โ€” this is the only way to guarantee a correct response. Periodt. ๐Ÿ‘‘
  • -bm โ€” this runs an Exim receiving process that accepts an incoming, locally-generated message on the standard 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's assumed if no other conflicting option is present. ๐Ÿ’–

If any addresses in the message are unqualified (aka they have no domain), they get qualified using the values of the qualify_domain or qualify_recipient options, as appropriate. And the -bnq option (down below) gives you a way to suppress that for special cases.

Policy checks on the contents of local messages can be enforced by means of the non-SMTP ACL. ๐Ÿ”’

The return code is zero if the message is successfully accepted. Otherwise, the action is controlled by the -oex 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 these 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 โ€” iconic behaviour, honestly. 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. Also important: the caller of Exim must be a trusted user for the sender of a message to be set in this way. ๐ŸŒธ

  • -bmalware <filename> โ€” this debugging option makes Exim scan the given file or directory (depends on which scanner interface you're using) through the malware scanning framework. The av_scanner option influences this, so if av_scanner's value depends on an expansion, that expansion should have defaults which apply to this invocation. ACLs are not invoked โ€” so if av_scanner references an ACL variable, that variable will never be populated and -bmalware will fail. ๐Ÿ’€

Exim will have changed working directory before resolving the filename, so using fully qualified pathnames is advisable. Also, Exim will be running as the Exim user when it tries to open the file, not as the invoking user. And this option requires admin privileges. ๐Ÿ‘‘

Real talk: -bmalware will not be extended to be more generally useful โ€” there are better tools for file-scanning out there. This option exists purely to help administrators verify their Exim and AV scanner configuration. That's it, that's the whole vibe.

  • -bnq โ€” by default, Exim automatically qualifies unqualified addresses (the ones without domains) that appear in messages submitted locally โ€” meaning not over TCP/IP. This qualification applies both to addresses in envelopes and addresses in header lines. Sender addresses get qualified using qualify_domain, and recipient addresses get qualified using qualify_recipient (which defaults to the value of qualify_domain). ๐ŸŽ€

Sometimes qualification is just... not the vibe. Say you're using -bS (batch SMTP) to re-submit messages that originally came from remote hosts after content scanning โ€” bestie, you probably do NOT want to be qualifying unqualified addresses in header lines. (And ngl, those lines only even show up if you haven't enabled a header syntax check in the appropriate ACL, so iykyk.)

The -bnq option suppresses ALL qualification of unqualified addresses in messages that originate on the local host. But heads up: when you use it, unqualified addresses in the envelope provoke errors (which means message rejection ๐Ÿ˜ญ), and unqualified addresses in header lines are left alone. Leave them be. Let them live.

  • -bP โ€” okay so if you run this with no arguments, it causes the values of ALL of Exim's main configuration options to be written to the standard output. Iconic. But if you want specific ones, just give their names as arguments, like:
exim -bP qualify_domain hold_domains

HOWEVER โ€” and this is the tea โ€” any option setting that's preceded by the word "hide" in the configuration file is not shown in full, except to an admin user. For other users, the output comes out like this:

mysql_servers = <value not displayable>
  • If config is given as an argument, the config is output, as it was parsed, any include file resolved, any comment removed.
  • If config_file is given as an argument, the name of the runtime configuration file is output. (configure_file works too, for backward compatibility.) If a list of configuration files was supplied, the value output here is the name of the file that was actually used.
  • If the -n flag is given, then for most modes of -bP operation the name will not be 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 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. Like:
exim -bP transport local_delivery

The generic driver options are output first, followed by the driver's private options. And if you want a list of the names of drivers of a particular type, use 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. ๐Ÿซถ

  • If environment is given as an argument, the set of environment variables is output, line by line. Using the -n flag suppresses the value of the variables.
  • If invoked by an admin user, then macro, macro_list and macros are available, similarly to the drivers. Because macros are sometimes used for storing passwords, this option is restricted. ๐Ÿ”’ The output format is one item per line. For the "-bP macro <name>" form, if no such macro is found the exit status will be nonzero.
  • -bp โ€” this one requests a listing of the contents of the mail queue on the standard output. If -bp 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. BUT the queue_list_requires_admin option can be set false to allow any user to see the queue. โœจ

Each message in 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 in 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.

  • -bpa โ€” 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 โ€” counts the number of messages in the queue, and writes the total to the standard output. It's restricted to admin users, unless queue_list_requires_admin is set false.
  • -bpi โ€” operates like -bp, but only outputs message ids (one per line). Minimalist queen. ๐Ÿ‘‘
  • -bpr โ€” 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 in the queue, and it's 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.
  • -bpri โ€” this option is a combination of -bpr and -bpi.
  • -bpru โ€” this option is a combination of -bpr and -bpu.
  • -bpu โ€” 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 router with the one_time option set.
  • -brt โ€” this one 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;

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. If the second argument contains a dot, it is interpreted as an optional second domain name; if no retry rule is found for the first argument, the second is tried. This ties in with Exim's behaviour when looking for retry rules for remote hosts โ€” if no rule is found that matches the host, one that matches the mail domain is sought. Finally, an argument that is the name of a specific delivery error, as used in setting up retry rules, can be given. For example:

exim -brt haydn.comp.mus.example quota_3d
Retry rule: *@haydn.comp.mus.example quota_3d  F,1h,15m
  • -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. ๐Ÿช„
  • -bS โ€” 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. 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, ATRN, 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. ๐Ÿ’€

  • -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. SMTP policy controls, as defined in ACLs 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 straight from the SMTP MAIL commands. โœจ Otherwise the content of those commands is ignored and the sender gets set up as the calling user. And unqualified addresses? They get automatically qualified using qualify_domain and qualify_recipient, as appropriate โ€” unless you used the -bnq option, bestie. ๐Ÿ’…

Also, -bs is what you use to run Exim from inetd, as an alternative to using a listening daemon. ๐Ÿซถ Exim can tell the two cases apart by checking whether standard input is a TCP/IP socket. When Exim is called from inetd, the source of the mail is assumed to be remote, and all those comments above about senders and qualification don't apply. In that situation, Exim behaves in exactly the same way it does when receiving a message via the listening daemon. No cap.

  • -bt โ€” this runs Exim in address testing mode, where each argument is taken as a recipient address to be tested for deliverability. Results go to standard output. ๐Ÿ’– If a test fails and the caller is not an admin user, no details of the failure are output, because those details might contain sensitive info like usernames and passwords for database lookups. ๐Ÿ™ˆ

If you give it no arguments, 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 here, because it's 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's passed to the routers and the result is written to standard output. However, any router that has no_address_test set gets 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's 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. โœจ

Note: when actually delivering a message, Exim removes duplicate recipient addresses after routing is complete, so that only one delivery takes place. This does not happen when testing with -bt; the full results of routing are always shown. ๐Ÿ‘‘
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've 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. ๐Ÿ’€
  • -bV โ€” this option makes Exim write the current version number, compilation number, and compilation date of the exim binary to standard output. It also lists the DBM library being used, the optional modules (like specific lookup types), the drivers included in the binary, and the name of the runtime configuration file in use. ๐Ÿฆ‹

As part of doing all that, -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. So you cannot rely on -bV alone to discover (for example) all the typos in the configuration โ€” some realistic testing is needed, bestie. The -bh and -N options provide more dynamic testing facilities. ๐Ÿซถ

  • -bv โ€” this runs Exim in address verification mode, where each argument is taken as a recipient address to be verified by the routers. (This does not involve any verification callouts.) ๐Ÿ’… During normal operation, verification happens mostly as a consequence of processing a verify condition in an ACL. If you want to test an entire ACL, possibly including callouts, see the -bh and -bhc options. โœจ

If verification fails, and the caller is not an admin user, no details of the failure are output, because they 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. Without -v, generating more than one address by redirection causes verification to end successfully, without considering the generated addresses. However, if just one address is generated, processing continues, and the generated address must verify successfully for the overall verification to succeed. ๐ŸŽ€

When -v is set, 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. Verification may succeed for some and fail for others. โญ

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. ๐Ÿซถ

  • -bvs โ€” this acts like -bv, but verifies the address as a sender rather than a recipient address. This affects any rewriting and qualification that might happen. ๐Ÿฆ‹
  • -bw โ€” this runs Exim as a daemon, awaiting incoming SMTP connections, similarly to the -bd option. All port specifications on the command-line and in the configuration file are ignored. Queue-running may not be specified. ๐Ÿ˜ค

In this mode, Exim expects to be passed a socket as fd 0 (stdin) which is listening for connections. This permits the system to start up and have inetd (or equivalent) listen on the SMTP ports, starting an Exim daemon for each port only when the first connection is received. ๐Ÿ‘‘

If the option is given as -bw<time> then the time is a timeout, after which the daemon will exit, which should cause inetd to listen once more. โœจ

  • -C <filelist> โ€” this option causes Exim to find the runtime 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 filename, but it can be a colon-separated list of names. In that 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, 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 a TRUSTED_CONFIG_LIST file is defined in Local/Makefile, that file contains a list of full pathnames, one per line, for configuration files which are trusted. Root privilege is retained for any configuration file so listed, as long as the caller is the Exim user (or the user specified in the CONFIGURE_OWNER option, if any), and as long as the configuration file is not writeable by inappropriate users or groups. ๐Ÿซถ

Leaving TRUSTED_CONFIG_LIST unset precludes 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-executes 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 in 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 filename 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 filename can be used with -C. ๐ŸŒˆ

okay so back to -C for one more sec because there's actual safety tea here ๐Ÿต

ALT_CONFIG_PREFIX can be used to confine alternative configuration files to a directory that only root has access to. Why do we care? Because it stops someone who has broken into the Exim account from running a privileged Exim with an arbitrary configuration file. absolutely not, bestie ๐Ÿ’€

And real talk: the -C facility is genuinely useful for making sure your config files are syntactically correct, but it cannot be used for test deliveries โ€” unless the caller is privileged, or unless it's an exotic configuration that doesn't require privilege. Also ngl, no check is made on the owner or group of the files specified by this option. just so you know โœจ

  • -D<macro>=<value> โ€” overrides macro definitions from the configuration file. But heads up: just like -C, if an unprivileged caller uses it, it makes Exim give up its root privilege. And if DISABLE_D_OPTION is defined in Local/Makefile, then -D is completely disabled, and using it causes an immediate error exit. ๐Ÿ’€

If WHITELIST_D_MACROS is defined in Local/Makefile, it should be a colon-separated list of macros that are considered safe. And if -D only supplies macros from that list, and the values are acceptable, then Exim will not give up root privilege when the caller is root, the Exim run-time user, or the CONFIGURE_OWNER, if set. Fair warning: this is a transition mechanism and it's expected to be removed in the future. ๐Ÿ™ˆ Acceptable values for the macros satisfy the regexp:

^[A-Za-z0-9_/.-]*$

The entire option (including the 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. Only macro names up to 22 letters long can be set. 22. that's the limit. periodt

  • -d<debug options> โ€” makes debugging information get written to the standard error stream. It's restricted to admin users, because debugging output may show database queries that contain password information โ€” and also, the details of users' filter files should be protected. If a non-admin user uses -d, Exim writes an error message to the standard error stream and exits with a non-zero return code. no admin, no debug, sorry ๐Ÿšซ

When -d is used, -v is assumed. If -d is given on its own, a lot of standard debugging data gets output. You can reduce that, or increase it to include some more rarely needed info, by directly following -d with a string made up of names preceded by plus or minus characters. Those 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 interpretation
  • auth โ€” authenticators
  • deliver โ€” general delivery logic
  • dns โ€” DNS lookups (see also resolver)
  • dnsbl โ€” DNS black list (aka RBL) code
  • exec โ€” arguments for execv() calls
  • expand โ€” detailed debugging for string expansions
  • filter โ€” filter handling
  • hints_lookup โ€” hints data lookups
  • host_lookup โ€” all types of name-to-IP address handling
  • ident โ€” ident lookup
  • interface โ€” lists of local interfaces
  • lists โ€” matching things in lists
  • load โ€” system load checks
  • local_scan โ€” can be used by local_scan()
  • lookup โ€” general lookup code and all lookups
  • macro โ€” macro definition and expansion
  • memory โ€” memory handling
  • noutf8 โ€” modifier: avoid UTF-8 line-drawing
  • pid โ€” modifier: add pid to debug output lines
  • process_info โ€” setting info for the process log
  • queue_run โ€” queue runs
  • receive โ€” general message reception logic
  • regex โ€” regular expressions
  • resolver โ€” turn on the DNS resolver's debugging output
  • retry โ€” retry handling
  • rewrite โ€” address rewriting
  • route โ€” address routing
  • start โ€” on startup, information about the build
  • timestamp โ€” modifier: add timestamp to debug output lines
  • tls โ€” TLS logic
  • transport โ€” transports
  • uid โ€” changes of uid/gid and looking up uid/gid
  • verify โ€” address verification logic
  • all โ€” almost all of the above (see below), and also -v

The all option excludes memory, macro and regex when used as +all, but includes them 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. balance โœจ

The resolver option produces output only if the DNS resolver was compiled with DEBUG enabled. That's not the case in some operating systems. Also, unfortunately, debugging output from the DNS resolver is written to stdout rather than stderr. slightly chaotic but okay ๐Ÿ™ˆ

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 you're trying to track down delays in processing. ๐Ÿ•

The noutf8 selector disables the use of UTF-8 line-drawing characters to group related information. When disabled, ascii-art is used instead. Using the +all option does not set this modifier.

If the debug_print option is set in any driver, it produces output whenever any debugging is selected, or if -v is used.

  • -dd<debug options> โ€” behaves exactly like -d, except when it's used on a command that starts a daemon process. In that case, debugging is turned off for the subprocesses that the daemon creates. So it's the move when you want to monitor the behaviour of the daemon without creating as much output as full debugging does. less noise, same vibe check ๐ŸŽ€
  • -dp<size> โ€” sets up a debug pretrigger buffer with the given size (in bytes). The default is 16kB.
  • -dt=<value> โ€” sets additional reasons for debug to trigger, on top of ACL-initiated triggers. A value with bit 0 set will trigger on a write to the panic log. If a pretrigger buffer had been set up (cf. the -dp option above), the debug trail leading up to this write will be available. ๐Ÿ”ฅ
  • -dS โ€” enables debug during the startup of Exim, before the completion of processing the configuration file(s).
  • -E โ€” specifies that an incoming message is a locally-generated delivery failure report. This one 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 postmaster, because 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. iykyk
  • -ex โ€” so there are a bunch of Sendmail options starting with -oe that various programs seem to call 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. generous of her honestly ๐Ÿ’…
  • -F <string> โ€” sets the sender's full name for use when a locally-generated message is being accepted. If this option isn't there, the user's gecos entry from the password data is used. And since 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> โ€” sets the address of the envelope sender of a locally-generated message (also known as the return path). Normally this option can only be used 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's 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, like 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, like, automatically unlock anonymous mail mode ๐Ÿ’€. Exim is still out here checking that the From: header actually refers to the local user, and if it doesn't? It just adds a Sender: header instead. You can override that though, by setting no_local_from_check.

White space between -f and the <address> is optional โ€” meaning you can hand them over as two separate arguments or smoosh them into one combined argument, whichever vibe you're feeling ๐Ÿซถ. Also, the sender of a locally-generated message can be set (when it's permitted, obvi) by sticking an initial "From " line in the message itself โ€” see the -bm description above โ€” but if -f is also there, -f wins. It overrides "From ". Periodt.

  • -G โ€” This one is equivalent to an ACL applying:
control = suppress_local_fixups

for every single message received. Heads up bestie: Sendmail will complain about bad formatting like this, whereas Exim silently just... does not fix it up. This may change in future, so don't get too attached. And because this touches audit information, the caller must be a trusted user to use it. No exceptions, no cap ๐Ÿ”ฅ

  • -h <number> โ€” Accepted purely for compatibility with Sendmail, and it does absolutely nothing here. (In Sendmail it overrides the "hop count" you get by counting Received: headers. Cute, but not our problem.)
  • -i โ€” Same energy as -oi, this one specifies that a dot on a line by itself should not terminate an incoming, non-SMTP message. Solaris 2.4 (SunOS 5.4) Sendmail has a similar -i processing option (https://docs.oracle.com/cd/E19457-01/801-6680-1M/801-6680-1M.pdf, p. 1M-529), and therefore also a -oi command line option, which both are used by its mailx command.
  • -L <tag> โ€” Equivalent to setting syslog_processname in the config file and setting log_file_path to syslog. Restricted to administrators only ๐Ÿ‘‘. The thing is, the configuration file has to be read and parsed first to determine access rights before this gets set and takes effect, so early configuration file errors will not honour this flag. Oh and the tag should not be longer than 32 characters.
  • -M <message id> <message id> ... โ€” Asks Exim to run a delivery attempt on each message, one by one. If any of them are frozen, they get automatically thawed before the attempt. The settings of queue_domains, queue_smtp_domains, and hold_domains are all ignored here.

Retry hints for any of the addresses get overridden too โ€” Exim tries to deliver even if the normal retry time hasn't been reached yet. This option requires the caller to be an admin user. However, there's an option called prod_requires_admin that can be set false to relax this restriction (and also the same requirement for the -q, -R, and -S options).

The deliveries happen synchronously, meaning 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 wanna see what's happening, add the -v option as well, or go inspect Exim's main log. iykyk ๐Ÿ’…

  • -Mar <message id> <address> <address> ... โ€” Asks Exim to add the addresses to the list of recipients of the message ("ar" for "add recipients", obsessed with the abbreviation game โœจ). The first argument must be a message id, and the remaining ones must be email addresses. But if the message is active (aka in the middle of a delivery attempt), it is not altered. This option can be used only by an admin user.
  • -MC <transport> <hostname> <host IP> <host port> <sequence number> <message id> โ€” Not intended for use by external callers. It's used internally by Exim to invoke another instance of itself to deliver a waiting message using an existing SMTP connection, which is passed as the standard input. This must be the final option, and the caller must be root or the Exim user in order to use it.
  • -MCA โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -MC option. It signifies that the connection to the remote host has been authenticated.
  • -MCD โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -MC option. It signifies that the remote host supports the ESMTP DSN extension.
  • -MCd โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -d option to pass on an information string on the purpose of the process.
  • -MCG <queue name> โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -MC option. It signifies that an alternate queue is used, named by the following argument.
  • -MCK โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -MC option. It signifies that a remote host supports the ESMTP CHUNKING extension.
  • -MCL โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -MC option. It signifies that the server to which Exim is connected advertised limits on numbers of mails, recipients or recipient domains. The limits are given by the following three arguments.
  • -MCP โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -MC option. It signifies that the server to which Exim is connected supports pipelining.
  • -MCp โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -MC option. It signifies that the connection t a remote server is via a SOCKS proxy, using addresses and ports given by the following four arguments.
  • -MCQ <process id> <pipe fd> โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -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 connection.
  • -MCq <recipient address> <size> โ€” Not intended for use by external callers. Used internally by Exim to implement quota checking for local users.
  • -MCS โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -MC option, and passes on the fact that the ESMTP SIZE option should be used on messages delivered down the existing connection.
  • -MCT โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -MC option, and passes on the fact that the host to which Exim is connected supports TLS encryption. ๐Ÿ”ฅ
  • -MCr <SNI>
  • -MCs <SNI> โ€” These options are not intended for use by external callers. It is used internally by Exim in conjunction with the -MCt option, and passes on the fact that a TLS Server Name Indication was sent as part of the channel establishment. The argument gives the SNI string. The "r" variant indicates a DANE-verified connection.
  • -MCt <IP address> <port> <cipher> โ€” Not intended for use by external callers. Used internally by Exim in conjunction with the -MC option, and passes on the fact that the connection is being proxied by a parent process for handling TLS encryption. The arguments give the local address and port being proxied, and the TLS cipher.
  • -Mc <message id> <message id> ... โ€” Asks Exim to run 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. Not very useful to external callers honestly โ€” it's provided mainly for internal use by Exim when it needs to re-invoke itself in order to regain root privilege for a delivery. That said, -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 instead. A distinction between queue run deliveries and other deliveries is made in one or two places.
  • -Mes <message id> <address> โ€” Asks Exim to change the sender address in the message to the given address, which must be a fully qualified address or "<>" ("es" for "edit sender"). There must be exactly two arguments. The first argument must be a message id, and the second one an email address. But 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> ... โ€” Asks Exim to mark each listed message as "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. But 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> ... โ€” this is the "okay we're so done here" button ๐Ÿ’€ You're asking Exim to give up trying to deliver the listed messages, frozen ones included. BUT โ€” and this is the tea โ€” if any of those messages are active, their status is not altered. No touching a message that's mid-delivery, bestie ๐Ÿ™ˆ. For non-bounce messages, a delivery error message is sent to the sender. Bounce messages are just discarded. Admin user only. ๐Ÿ‘‘
  • -MG <queue name> <message id> <message id> ... โ€” moving house!! ๐Ÿ โœจ This one says: take each listed message and move it from wherever it's currently chilling to the given named queue. The destination queue name argument is required โ€” but it can be an empty string, which defines the default queue. And heads up: if the messages aren't currently sitting in the default queue, you'll need a -qG<name> option to define the source queue. iykyk ๐ŸŽ€
  • -Mmad <message id> <message id> ... โ€” "mad" stands for mark all delivered ๐Ÿ’… This asks Exim to mark all the recipient addresses in the messages as already delivered. But โ€” if any message is active (in the middle of a delivery attempt), its status is not altered. Admin user only, fr fr.
  • -Mmd <message id> <address> <address> ... โ€” "md" = mark delivered โœจ This one marks the given addresses as already delivered. First argument must be a message id, and everything after it must be email addresses. These get matched to recipient addresses in the message in a case-sensitive manner (so yes, capitalization matters, no cap ๐Ÿงข). If the message is active (mid-delivery attempt), its status is not altered. Admin user only.
  • -Mrm <message id> <message id> ... โ€” bye bye forever ๐Ÿซก This requests that Exim remove the given messages from the queue. No bounce messages are sent โ€” each message is simply forgotten. 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 in the queue.
  • -Mset <message id> โ€” this one is useful only in conjunction with -be (that is, when testing string expansions) ๐Ÿงช Exim loads the given message from its spool before doing the test expansions, which sets message-specific variables such as $message_size and the header variables. The $recipients variable is made available too. This feature exists to make it easier to test expansions that make use of these variables. However, this option can be used only by an admin user. See also -bem ๐Ÿ‘€
  • -Mt <message id> <message id> ... โ€” THAWING TIME โ„๏ธโžก๏ธ๐Ÿ”ฅ This asks Exim to "thaw" any of the listed messages that are "frozen", so that delivery attempts can resume. If any of the messages are active, their status is not altered. Admin user only.
  • -Mvb <message id> โ€” dumps the contents of the message body (-D) spool file to the standard output ๐Ÿซถ Admin user only.
  • -Mvc <message id> โ€” writes a copy of the complete message (header lines plus body) to the standard output in RFC 2822 format ๐Ÿ“ฌ Admin user only.
  • -Mvh <message id> โ€” writes the contents of the message headers (-H) spool file to the standard output ๐ŸŒธ Admin user only.
  • -Mvl <message id> โ€” writes the contents of the message log spool file to the standard output ๐Ÿ“œ Admin user only.
  • -m โ€” this is a synonym for -om that's accepted by Sendmail (their docs live at https://docs.oracle.com/cd/E19457-01/801-6680-1M/801-6680-1M.pdf, p. 1M-258), so Exim treats it that way too ๐Ÿค
  • -N โ€” debugging mode activated, and it's lowkey chaotic ๐Ÿ˜ญ This option 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, and 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 ๐Ÿ‘‘

  • -n โ€” Sendmail reads this as "no aliasing". For normal modes of operation, it is ignored by Exim ๐Ÿ˜ด When combined with -bP it makes the output more terse (it suppresses option names, environment values and config pretty printing).
  • -O <data> โ€” interpreted by Sendmail to mean set option. It is ignored by Exim ๐Ÿ™…โ€โ™€๏ธ
  • -oA <file name> โ€” used by Sendmail in conjunction with -bi to specify an alternative alias filename. Exim handles -bi differently; see the description above ๐Ÿ‘†
  • -oB <n> โ€” a debugging option that limits the maximum number of messages that can be delivered down one SMTP connection, overriding the value set in any smtp transport ๐Ÿ”ฅ If <n> is omitted, the limit is set to 1.
  • -oDSN <option> โ€” DSN extensions (RFC 3461) will be used, if possible, on commandline-sourced messages sent when one or more of these options are used โœจ The option value must start with a code letter and an equals sign. Here's the breakdown, bestie:
    • Code letter N requests a NOTIFY parameter on SMTP RCPT commands. The equals may be followed by either never, or a comma-separated list with any combination of success, failure and delay. The NOTIFY is applied to all recipients of the message.
    • Code letter R requests a RET parameter on the SMTP MAIL command. The equals must be followed by either full or hdrs.
    • Code letter V requests an ENVID parameter on the SMTP MAIL command. The equals should be followed by an "envelope identifier" value for the message.
  • -odb โ€” applies to all modes in which Exim accepts incoming messages, including the listening daemon ๐Ÿ‘‚ It requests "background" delivery of such messages, which means 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 ๐Ÿ’€

  • -odf โ€” 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 in the queue for later delivery, and the original reception process exits ๐Ÿšช

  • -odi โ€” synonymous with -odf. It's provided for compatibility with Sendmail ๐Ÿค
  • -odq โ€” 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 process for each message received. Messages are placed in the queue and remain there until a subsequent queue runner process encounters them ๐Ÿ“ฅ There are several configuration options (such as queue_only) that can be used to queue incoming messages under certain conditions. This option overrides all of them and also -odqs. It always forces queueing. Periodt ๐Ÿ’…
  • -odqs โ€” the hybrid queen ๐Ÿ‘‘ a mix 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 in 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 ๐Ÿ‘€

  • -oee โ€” bestie, if an error gets detected while a non-SMTP message is being received (think: a malformed address, the audacity ๐Ÿ’€), that error gets reported to the sender in a mail message.

And here's the tea: provided that error message actually gets sent successfully, the Exim receiving process exits with a return code of zero. If it doesn't send? The return code is 2 when the problem is that the original message has no recipients, or 1 for any other error. This is the default -oex option when Exim is called as rmail. ๐Ÿ’…

  • -oem โ€” literally the same as -oee, except Exim always exits with a non-zero return code, whether or not that error message made it out. This is the default -oex option โ€” unless Exim is called as rmail. ๐Ÿ‘‘
  • -oep โ€” if an error pops up while a non-SMTP message is being received, the error gets reported by writing a message to the standard error file (stderr). The return code is 1 for all errors. no cap.
  • -oeq โ€” supported for compatibility with Sendmail, but bestie it does the exact same thing as -oep.
  • -oew โ€” also supported for Sendmail compatibility, and it does the exact same thing as -oem.
  • -oi โ€” this one has the same effect as -i: it says a dot on a line by itself should not terminate an incoming, non-SMTP message. Otherwise, a single dot does terminate โ€” though Exim does no special processing for other lines that start with a dot. This option is set by default if Exim is called as rmail. Peep -ti too. ๐ŸŒธ
  • -oitrue โ€” treated as synonymous with -oi. same vibe, different name.
  • -oMa host address โ€” okay so a whole bunch of options starting with -oM set values associated with remote hosts on locally-submitted messages (that means messages not received over TCP/IP). Any caller can use these in conjunction with the -bh, -be, -bf, -bF, -bt, or -bv testing options. In other circumstances? They're ignored unless the caller is trusted. ๐Ÿ”’

The -oMa option sets the sender host address. It can include a port number at the end, after a full stop (period). Like:

exim -bs -oMa 10.9.8.7.1234

An alternative syntax is to wrap the IP address in square brackets, then a colon, then the port number:

exim -bs -oMa [10.9.8.7]:1234

The IP address goes into the $sender_host_address variable, and the port (if there is one) goes into $sender_host_port. And if both -oMa and -bh are on the command line? The sender host IP address comes from whichever one is last. โœจ

  • -oMaa name โ€” see -oMa above for the general ~vibes~ about the -oM options. This one sets the value of $sender_host_authenticated (the authenticator name). You can use it with -bh and -bs to set up an authenticated SMTP session without actually using the SMTP AUTH command. iconic.
  • -oMai string โ€” again, see -oMa above for the general -oM notes. -oMai sets the value of $authenticated_id (the id that was authenticated). This overrides the default value โ€” which is the caller's login id, except with -bh, where there is no default โ€” for messages from local sources. ๐Ÿ’œ
  • -oMas address โ€” see -oMa above for the general -oM notes. This sets the authenticated sender value in $authenticated_sender. It overrides the sender address created from the caller's login id for messages from local sources โ€” except when -bh is used, when there's no default. And for both -bh and -bs, an authenticated sender specified on a MAIL command overrides this value. ๐ŸŽ€
  • -oMi interface address โ€” yep, see -oMa above for the general -oM notes. -oMi sets the IP interface address value. A port number may be included, using the same syntax as -oMa. The interface address lands in $received_ip_address, and the port number (if present) lands in $received_port. ๐Ÿฆ‹
  • -oMm message reference โ€” see -oMa above for the general -oM notes. -oMm sets the message reference, e.g. message-id, and it's logged during delivery. Super useful when you need some kind of audit trail to tie messages together. The format of the message reference is checked, and it will abort if the format is invalid. Also โ€” this option will only be accepted if exim is running in trusted mode, not as any regular user. ๐Ÿšจ

The best example of a message reference is when Exim sends a bounce message. The message reference is the message-id of the original message that Exim is sending the bounce for. ๐Ÿ’…

  • -oMr protocol name โ€” see -oMa above for the general -oM notes. -oMr sets the received protocol value stored in $received_protocol. However, it does not apply (and gets ignored) when -bh or -bs is used. For -bh, the protocol is forced to one of the standard SMTP protocol names. For -bs, the protocol is always "local-" followed by one of those same names. For -bS (batched SMTP) though, the protocol can be set by -oMr. Repeated use of this option is not supported. โญ
  • -oMs host name โ€” see -oMa above for the general -oM notes. -oMs sets the sender host name in $sender_host_name. When this option is present, Exim does not attempt to look up a host name from an IP address; it just uses the name it's given. ๐ŸŒˆ
  • -oMt ident string โ€” see -oMa above for the general -oM notes. -oMt sets the sender ident value in $sender_ident. The default setting for local callers is the login id of the calling process โ€” except when -bh is used, when there's no default. ๐Ÿ’–
  • -om โ€” in Sendmail this means "me too", indicating 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 literally nothing. ๐Ÿ™ˆ
  • -oo โ€” this option is ignored. In Sendmail it specifies "old style headers", whatever that means. ๐Ÿ’€
  • -oP path โ€” this option is only useful in conjunction with -bd or -q with a time value. It specifies the file to which the process id of the daemon gets written. When -oX is used with -bd, or when -q with a time is used without -bd, this is the only way to make Exim write a pid file โ€” because in those cases, the normal pid file is not used. ๐Ÿ‘‘
  • -oPX โ€” this option is not intended for general use. The daemon uses it when terminating due to a SIGTEM, possibly combined with -oP <path>. It causes the pid file to be removed. (iykyk ๐Ÿซถ)
  • -or time โ€” sets a timeout value for incoming non-SMTP messages. If it's not set, Exim will wait forever for the standard input ๐Ÿ˜ญ. The value can also be set by the receive_timeout option.
  • -os time โ€” sets a timeout value for incoming SMTP messages. The timeout applies to each SMTP command and block of data. The value can also be set by the smtp_receive_timeout option; it defaults to 5 minutes. โณ
  • -ov โ€” has exactly the same effect as -v. twin energy.
  • -oX number or string โ€” only relevant when the -bd (start listening daemon) option is also given. It controls which ports and interfaces the daemon uses. When -oX is used to start a daemon, no pid file is written unless -oP is also present to specify a pid filename. ๐ŸŽ€
  • -oY โ€” this controls the creation of an inter-process communications endpoint by the Exim daemon. It's only relevant when the -bd (start listening daemon) option is also given. Normally the daemon creates this socket โ€” unless a -oX and no -oP option is also present. If this option is given, then the socket will not be created. This is required if the system is running multiple daemons, in which case you should use it on all of them. The features supported by the socket will not be available in such cases. ๐Ÿ’€

The socket is currently used for:

  • fast ramp-up of queue runner processes
  • caching compiled regexes
  • obtaining a current queue size
  • -pd โ€” applies when an embedded Perl interpreter is linked with Exim. It overrides the setting of the perl_at_start option, forcing the starting of the interpreter to be delayed until it is needed. ๐ŸŒ
  • -ps โ€” applies when an embedded Perl interpreter is linked with Exim. It overrides the setting of the perl_at_start option, forcing the starting of the interpreter to occur as soon as Exim is started. โšก
  • -p<rval>:<sval> โ€” 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 that Exim already has two private options, -pd and -ps, that refer to embedded Perl. So it is therefore impossible to set a protocol value of d or s using this option โ€” but that doesn't really seem like a real limitation. Repeated use of this option is not supported. ๐ŸŒธ

  • -q โ€” this option is normally restricted to admin users. However, there's 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). ๐Ÿ”“

If other commandline options don't specify an action, 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 haven't been reached yet. 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 those little babies to finish before it moves on. ๐Ÿ’…

When all the queued messages have been considered, the original queue runner process terminates. In other words โ€” one single pass over the waiting mail, one message at a time. If you want that to happen again and again on a loop, use -q with a time value (scroll down bestie, it's right there). ๐Ÿ”

Exim processes the waiting messages in an unpredictable order. It isn't very random, but it's likely to be different each time, which is honestly all that matters. The vibe is: if one particular message screws up a remote MTA, other messages to that same MTA still have a chance of getting through if they get tried first. ๐ŸŽฒ

It is possible to force the messages to be processed in lexical message id order โ€” which is basically the order they arrived in โ€” by setting the queue_run_order option. But ngl, this is not recommended for normal use. ๐Ÿ™ˆ


  • -q<qflags> โ€” Perform a queue run. The -q option may be followed by one or more flag letters that change its behaviour. They're all optional, but if more than one is present, they must appear in the correct order. Each flag gets its own item below, no skimming. ๐Ÿ‘‘
  • -qq... โ€” 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. โœจ

Performance will be best if the queue_run_order option is unset or "random"). If that is so and the queue_fast_ramp option is true and a daemon-notifier socket is available, then in the first phase of the run, once a threshold number of messages are routed for a given host, a delivery process is forked in parallel with the rest of the scan. ๐Ÿš€

The hints database that remembers which messages are waiting for specific hosts is updated, as if delivery to those hosts had been deferred.

After the first queue scan complete, a second, normal queue scan is done, 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.

Two-phase queue runs should be used on systems which, even intermittently, have a large queue (such as mailing-list operators, iykyk). They may also be useful for hosts that are connected to the Internet intermittently. ๐ŸŒˆ

  • -q[q]i... โ€” If the i flag is present, the queue runner runs delivery processes only for those messages that haven't previously been tried. (i stands for "initial delivery".) Super helpful if you're putting messages in the queue using -odq and you want a queue runner just to process the new messages. ๐Ÿ“
  • -q[q][i]f... โ€” If one f flag is present, a delivery attempt is forced for each non-frozen message, whereas without f only those non-frozen addresses that have passed their retry times are tried.
  • -q[q][i]ff... โ€” If ff is present, a delivery attempt is forced for every message, whether frozen or not. ๐Ÿ‘€
  • -q[q][i][f[f]]l โ€” The l (that's the letter "ell", bestie, don't get it twisted) flag specifies that only local deliveries are to be done. If a message requires any remote deliveries, it remains in the queue for later delivery.
  • -q[q][i][f[f]][l][G<name>[/<time>]]] โ€” If the G flag and a name is present, the queue runner operates on the queue with the given name rather than the default queue. The name should not contain a / character. For a periodic queue run (see below) append to the name a slash and a time value.

If other commandline options specify an action, a -qG<name> option will specify a queue to operate on. For example:

exim -bp -qGquarantine
mailq -qGquarantine
exim -qGoffpeak -Rf @special.domain.example
  • -q<qflags> <start id> <end id> โ€” 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. ๐Ÿ”

  • -q<qflags><time> โ€” 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. 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. โฐ

It is possible to set up runners for multiple named queues within one daemon, For example:

exim -qGhipri/2m -q10m -qqGmailinglist/1h

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.

  • -qR<rsflags> <string> โ€” This option is synonymous with -R. It is provided for Sendmail compatibility. ๐Ÿซถ
  • -qS<rsflags> <string> โ€” This option is synonymous with -S.
  • -R<rsflags> <string> โ€” 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.

If you want to do periodic queue runs for messages with specific recipients, you can combine -R with -q and a time value. For example:

exim -q25m -R @special.domain.example

This example does a queue run for messages with recipients in the given domain every 25 minutes. Any additional flags that are specified with -q are applied to each queue run.

Once a message is selected for delivery by this mechanism, 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, 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. Yeah, it's giving legacy energy. ๐Ÿ’€
  • -S<rsflags> <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.
  • -Tqt <times> โ€” This is an option that is exclusively for use by the Exim testing suite. It is not recognized when Exim is run normally. It allows for the setting up of explicit "queue times" so that various warning/retry features can be tested. ๐Ÿงช
  • -t โ€” 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 and the Bcc: header line, if present, is then removed. โœ‚๏ธ

okay bestie, we're still deep in -t and it is a whole saga, stay with me ๐Ÿ’…

If the command comes with any arguments, those arguments are the addresses you're saying do NOT deliver to. Basically they get subtracted from the recipient list Exim pulled out of the headers. This matches Smail 3, and it matches what several versions of Sendmail actually do, as documented in man pages on a bunch of operating systems (think Solaris 8, IRIX 6.5, HP-UX 11). But โ€” plot twist โ€” some versions of Sendmail add the argument addresses to the header ones instead, and the O'Reilly Sendmail book documents it that way. If you want Exim on that wavelength, set the option extract_addresses_remove_arguments to false and it'll add instead of subtract. ๐Ÿซถ

Now, if your message has any Resent- header lines in it, Exim pulls recipients from all the Resent-To:, Resent-Cc:, and Resent-Bcc: lines instead of from To:, Cc:, and Bcc:. That's a compatibility thing with Sendmail and other MTAs. (Fun little history note: before release 4.20, Exim would straight up throw an error if you used -t together with Resent- header lines. ๐Ÿ˜ญ)

RFC 2822 talks about different sets of Resent- header lines, for when a message gets resent multiple times. The RFC also says they should go at the front of the message, separated by Received: lines. But honestly? It's not at all clear how -t is even supposed to behave when there are multiple sets, or even what exactly counts as a "set". ๐Ÿ’€

In real life, MUAs just... don't follow the RFC, bestie. Resent- lines get tacked on at the end of the header, and if a message gets resent more than once, it's super common for the original set of Resent- headers to be renamed to X-Resent- when a new set shows up. Which, honestly? slay. It removes any possible ambiguity. โœจ


  • -ti โ€” this is exactly equivalent to -t -i, no notes. It's here purely for compatibility with Sendmail. ๐Ÿ’–
  • -tls-on-connect โ€” only exists when Exim was compiled with TLS support. It forces all incoming SMTP connections to behave as if the incoming port were listed in the tls_on_connect_ports option. No cap. ๐Ÿ”ฅ
  • -U โ€” Sendmail uses this for "initial message submission", and its docs say that in future releases it may complain about syntactically invalid messages rather than quietly fixing them when this flag isn't set. Exim? Exim ignores this option entirely. ๐Ÿ™ˆ
  • -v โ€” makes Exim write info to the standard error stream telling you what it's doing. Specifically, it shows the log lines for receiving and delivering a message, and if an SMTP connection happens, you get the whole SMTP dialogue. Heads up though: some of the log lines shown may not actually get written to the log if your log_selector setting discards them. Any relevant selectors get shown alongside each log line โ€” and if none are shown, that logging is unconditional. ๐Ÿ‘‘
  • -x โ€” this is an AIX thing, used for a private purpose ("mail from a local mail program has National Language Support extended characters in the body of the mail item"). AIX sets -x when calling the MTA from its mail command. Exim ignores this option too. ๐Ÿ’€
  • -X <logfile> โ€” Sendmail interprets this to send debug information to the named file. Exim ignores it. that's the whole bit. ๐ŸŽ€
  • -z <log-line> โ€” writes its argument straight into Exim's logfile. Use of this is restricted to administrators, and the intent is for operational notes. Under most shells you'll want quotes so a multi-word item stays a single argument. ๐Ÿ“

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

The full Exim specification, the Exim book, and the Exim wiki. go read 'em, they're iconic, iykyk ๐Ÿ“šโœจ


and that's a wrap on the whole page, bestie!! ๐ŸŽ‰ this one's filed under EXIM(8) โ€” that's your source/version tag โ€” and it's dated, so if your copy's timestamp is looking dusty, you know where to check. mwah, go send some mail ๐Ÿ’Œ๐Ÿ’…

๐Ÿ“ฆ where this page comes from