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-bpwere present before any other options. The-bpoption requests a listing of the contents of the mail queue on the standard output.rsmtpโ Behaves as if the option-bSwere present before any other options, for compatibility with Smail. The-bSoption is used for reading in a number of messages in batched SMTP format.rmailโ Behave as if the-iand-oeeoptions were present before any other options, for compatibility with Smail. The namermailis used as an interface by some UUCP systems. The-ioption specifies that a dot on a line by itself does not terminate a non-SMTP message;-oeerequests that errors detected in non-SMTP messages be reported by emailing the sender.runqโ Behave as if the option-qwere present before any other options, for compatibility with Smail. The-qoption causes a single queue runner process to be started. It processes the queue once, then exits.newaliasesโ Behave as if the option-biwere 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-bioption.
โจ 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-bVand 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-bdoption 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-bdexcept 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-beexcept 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-bfexcept 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-oMtoption. 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-bhcinstead. 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-bias "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/sendmailwith-bikeep 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:helpasks 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-tis 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. Theav_scanneroption influences this, so ifav_scanner's value depends on an expansion, that expansion should have defaults which apply to this invocation. ACLs are not invoked โ so ifav_scannerreferences an ACL variable, that variable will never be populated and-bmalwarewill 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 usingqualify_domain, and recipient addresses get qualified usingqualify_recipient(which defaults to the value ofqualify_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
configis given as an argument, the config is output, as it was parsed, any include file resolved, any comment removed. - If
config_fileis given as an argument, the name of the runtime configuration file is output. (configure_fileworks 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
-nflag is given, then for most modes of-bPoperation the name will not be output. - If
log_file_pathorpid_file_pathare 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 calledlog, and the pid file is written directly into the spool directory. - If
-bPis 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, orauthenticatoris 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
environmentis given as an argument, the set of environment variables is output, line by line. Using the-nflag suppresses the value of the variables. - If invoked by an admin user, then
macro,macro_listandmacrosare 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-bpis 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 thequeue_list_requires_adminoption 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, unlessqueue_list_requires_adminis 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-bprand-bpa.-bpriโ this option is a combination of-bprand-bpi.-bpruโ this option is a combination of-bprand-bpu.-bpuโ operates like-bpbut 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 theone_timeoption 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, oruntrusted_set_senderis set, the senders in the SMTPMAILcommands 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:-btcan 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-foption to set an appropriate sender when running-bttests. 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-Noption provides a possible way of doing such tests. ๐
-bVโ this option makes Exim write the current version number, compilation number, and compilation date of theeximbinary 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 averifycondition in an ACL. If you want to test an entire ACL, possibly including callouts, see the-bhand-bhcoptions. โจ
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-bdoption. 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 theCONFIGURE_FILEcompile-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 ifDISABLE_D_OPTIONis defined inLocal/Makefile, then-Dis 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 interpretationauthโ authenticatorsdeliverโ general delivery logicdnsโ DNS lookups (see alsoresolver)dnsblโ DNS black list (aka RBL) codeexecโ arguments forexecv()callsexpandโ detailed debugging for string expansionsfilterโ filter handlinghints_lookupโ hints data lookupshost_lookupโ all types of name-to-IP address handlingidentโ ident lookupinterfaceโ lists of local interfaceslistsโ matching things in listsloadโ system load checkslocal_scanโ can be used bylocal_scan()lookupโ general lookup code and all lookupsmacroโ macro definition and expansionmemoryโ memory handlingnoutf8โ modifier: avoid UTF-8 line-drawingpidโ modifier: add pid to debug output linesprocess_infoโ setting info for the process logqueue_runโ queue runsreceiveโ general message reception logicregexโ regular expressionsresolverโ turn on the DNS resolver's debugging outputretryโ retry handlingrewriteโ address rewritingrouteโ address routingstartโ on startup, information about the buildtimestampโ modifier: add timestamp to debug output linestlsโ TLS logictransportโ transportsuidโ changes of uid/gid and looking up uid/gidverifyโ address verification logicallโ almost all of the above (see below), and also-v
The all option excludes memory, 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 is16kB.-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-dpoption 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, followingR=, as a cross-reference. iykyk-exโ so there are a bunch of Sendmail options starting with-oethat various programs seem to call without the leadingoin the option. For example, thevacationprogram uses-eq. Exim treats all options of the form-exas synonymous with the corresponding-oexoptions. 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-Fand 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, butuntrusted_set_sendercan 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 countingReceived: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-iprocessing option (https://docs.oracle.com/cd/E19457-01/801-6680-1M/801-6680-1M.pdf, p. 1M-529), and therefore also a-oicommand line option, which both are used by itsmailxcommand.-L<tag> โ Equivalent to settingsyslog_processnamein the config file and settinglog_file_pathtosyslog. 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 ofqueue_domains,queue_smtp_domains, andhold_domainsare 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-MCoption. 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-MCoption. 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-doption 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-MCoption. 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-MCoption. 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-MCoption. 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-MCoption. 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-MCoption. 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-MCoption 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-MCoption, 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-MCoption, 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-MCtoption, 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-MCoption, 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-Moption, 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,-Mccan be useful when testing, in order to run a delivery that respects retry times and other options such ashold_domainsthat are overridden when-Mis 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-qwith 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 theauto_thawconfiguration 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_sizeand the header variables. The$recipientsvariable 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-omthat's accepted by Sendmail (their docs live athttps://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-bPit 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-bito specify an alternative alias filename. Exim handles-bidifferently; 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 to1.-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
Nrequests aNOTIFYparameter on SMTPRCPTcommands. The equals may be followed by eithernever, or a comma-separated list with any combination ofsuccess,failureanddelay. TheNOTIFYis applied to all recipients of the message. - Code letter
Rrequests aRETparameter on the SMTPMAILcommand. The equals must be followed by eitherfullorhdrs. - Code letter
Vrequests anENVIDparameter on the SMTPMAILcommand. The equals should be followed by an "envelope identifier" value for the message.
- Code letter
-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 asqueue_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/-odiand-odq. However, like-odband-odi, this option has no effect ifqueue_only_overrideis 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-oexoption โ unless Exim is called asrmail. ๐-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 asrmail. Peep-titoo. ๐ธ-oitrueโ treated as synonymous with-oi. same vibe, different name.-oMahost address โ okay so a whole bunch of options starting with-oMset 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-bvtesting 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. โจ
-oMaaname โ see-oMaabove for the general ~vibes~ about the-oMoptions. This one sets the value of$sender_host_authenticated(the authenticator name). You can use it with-bhand-bsto set up an authenticated SMTP session without actually using theSMTP AUTHcommand. iconic.-oMaistring โ again, see-oMaabove for the general-oMnotes.-oMaisets 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. ๐-oMasaddress โ see-oMaabove for the general-oMnotes. 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-bhis used, when there's no default. And for both-bhand-bs, an authenticated sender specified on aMAILcommand overrides this value. ๐-oMiinterface address โ yep, see-oMaabove for the general-oMnotes.-oMisets 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. ๐ฆ-oMmmessage reference โ see-oMaabove for the general-oMnotes.-oMmsets 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. ๐
-oMrprotocol name โ see-oMaabove for the general-oMnotes.-oMrsets the received protocol value stored in$received_protocol. However, it does not apply (and gets ignored) when-bhor-bsis 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. โญ-oMshost name โ see-oMaabove for the general-oMnotes.-oMssets 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. ๐-oMtident string โ see-oMaabove for the general-oMnotes.-oMtsets the sender ident value in$sender_ident. The default setting for local callers is the login id of the calling process โ except when-bhis 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. ๐-oPpath โ this option is only useful in conjunction with-bdor-qwith a time value. It specifies the file to which the process id of the daemon gets written. When-oXis used with-bd, or when-qwith 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 aSIGTEM, possibly combined with-oP <path>. It causes the pid file to be removed. (iykyk ๐ซถ)-ortime โ 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 thereceive_timeoutoption.-ostime โ 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 thesmtp_receive_timeoutoption; it defaults to 5 minutes. โณ-ovโ has exactly the same effect as-v. twin energy.-oXnumber or string โ only relevant when the-bd(start listening daemon) option is also given. It controls which ports and interfaces the daemon uses. When-oXis used to start a daemon, no pid file is written unless-oPis 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-oXand no-oPoption 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 theperl_at_startoption, 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 theperl_at_startoption, 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 calledprod_requires_adminwhich can be set false to relax this restriction (and also the same requirement for the-M,-R, and-Soptions). ๐
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-qoption 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-qqrequests 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 theiflag is present, the queue runner runs delivery processes only for those messages that haven't previously been tried. (istands for "initial delivery".) Super helpful if you're putting messages in the queue using-odqand you want a queue runner just to process the new messages. ๐-q[q][i]f...โ If onefflag is present, a delivery attempt is forced for each non-frozen message, whereas withoutfonly those non-frozen addresses that have passed their retry times are tried.-q[q][i]ff...โ Ifffis present, a delivery attempt is forced for every message, whether frozen or not. ๐-q[q][i][f[f]]lโ Thel(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 theGflag 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-qoption 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-qoption causes Exim to run as a daemon, starting a queue runner process at intervals specified by the given time value. This form of the-qoption is commonly combined with the-bdoption, 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 isf,ff,r,rf, orrff, 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-Rexcept that it checks the string against each message's sender instead of against the recipients. If-Ris also set, both conditions must be met for a message to be selected. If either of the options hasforffin 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-toption causes the recipients of the message to be obtained from theTo:,Cc:, andBcc:header lines in the message instead of from the command arguments. The addresses are extracted before any rewriting takes place and theBcc: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 ofResent-header lines, for when a message gets resent multiple times. The RFC also says they should go at the front of the message, separated byReceived:lines. But honestly? It's not at all clear how-tis 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 thetls_on_connect_portsoption. 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 yourlog_selectorsetting 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-xwhen 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
- arch rolling: exim 4.100.1-1 ยท GPL-2.0-only
- epel 9: exim 4.100.1-1.el9 ยท GPLv2+
- fedora 43: exim 4.100.1-1.fc43 ยท GPL-2.0-or-later
- fedora 44: exim 4.100.1-1.fc44 ยท GPL-2.0-or-later
- nixos 26.05: exim 4.100.1
- nixpkgs unstable: exim 4.100.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms