EXIM(8)
EXIM(8) β okay bestie, this is the EXIM(8) page from the System Manager's Manual, and we're doing the command-line options tour because the full spec lives in the reference manual. π
π NAME π
exim β a Mail Transfer Agent. Slay.
β¨ SYNOPSIS β¨
exim [options] arguments ...
mailq [options] arguments ...
rsmtp [options] arguments ...
rmail [options] arguments ...
runq [options] arguments ...
newaliases [options] arguments ...
π¦ DESCRIPTION π¦
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. Periodt.
π 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. Iconic behavior, honestly.
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. Gatekeeping, but for flags.--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β a Sendmail option used for selecting configuration files; Exim ignores it.-Amβ another Sendmail option used for selecting configuration files; Exim ignores this one too.-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
-bdoption 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 pressingctrl-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 calledexim-daemon.pidin Exim's spool directory. This location can be overridden by settingPID_FILE_PATHinLocal/Makefile. The file is written while Exim is still running as root. - When
-oXis used on the command line to start a listening daemon, the process id is not written to the normal pid file path. However,-oPcan be used to specify a path on the command line if a pid file is required. - The
SIGHUPsignal 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.includefacility, 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
SIGTERMor aSIGINTsignal 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.
- The
-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=yesinLocal/Makefile, it tries to load thelibreadlinelibrary dynamically whenever the-beoption is used without command line arguments. If successful, it uses thereadline()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-bemand-Mset).
- If Exim was built with
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
This is helpful when the system filter adds header lines or sets filter variables that are used by the user filter.
If the test filter file doesn't start with one of the special lines
# Exim filter
# Sieve filter
then it's taken to be a normal .forward file, and it gets tested for validity under that interpretation. No cap π
The result of an Exim command that uses -bf, assuming nothing errors out, is a list of the actions Exim would try to take if you actually handed it the message for real. More deets on filter testing live in the separate document called Exim's interfaces to mail filtering.
When you're testing a filter file, the envelope sender can be set with the -f option, or by a "From " line at the start of the test message. And a bunch of parameters that would normally come from the envelope recipient address of the message can be set with extra command line options β that's the next four options, bestie, keep scrolling π«Ά
-bfd <domain>β sets the domain of the recipient address when a filter file is being tested via-bf. Default? The value of$qualify_domain. β¨-bfl <local part>β sets the local part of the recipient address when a filter file is being tested via-bf. Default is the username of the process that calls Exim. And listen β specify the local part with any prefix or suffix stripped, because that's literally how it shows up to the filter when a message is actually being delivered. iykyk πΈ-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>β runs a fake SMTP session as if from the given IP address, using standard input and output. The IP address can include a port number at the end, after a full stop. Like:
exim -bh 10.9.8.7.1234
exim -bh fe80::a00:20ff:fe86:a061.5678
When you give an IPv6 address, it gets converted into canonical form. In the second example above, the value of $sender_host_address after conversion to canonical form is fe80:0000:0000:0a00:20ff:fe86:a061.5678. Iconic π
Comments about what's going on get written to the standard error file β including lines starting with LOG for anything that would've been logged. This facility exists so you can test configuration options for incoming messages and make sure they implement the policy you want. For example, you can test your relay controls using -bh. π
Warning 1: you can test features of the config that rely on ident (RFC 1413) info by using the-oMtoption. BUT Exim literally cannot 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 happen, use-bhcinstead.
Messages supplied during the testing session are discarded, and nothing is written to any of the real log files. There may be pauses while DNS (and other) lookups are happening, and of course those can time out. π The -oMi option can specify a specific IP interface and port if that matters to you, and -oMaa and -oMai can set parameters as if the SMTP session were authenticated.
The exim_checkaccess utility is basically a "packaged" version of -bh whose output just says whether a given recipient address from a given host is acceptable or not. Lowkey convenient.
Features like authentication and encryption β where the client input isn't plain text β can't easily be tested with -bh. Instead, use a specialized SMTP test program such as swaks [https://www.jetmore.org/john/code/swaks/]. π₯
-bhc <IP address>β operates the same way as-bh, except that address verification callouts are performed if required. That includes consulting and updating the callout cache database. β¨-biβ Sendmail interprets the-bioption as a request to rebuild its alias file. Exim does not have the concept of a single alias file, so it cannot mimic this behaviour. BUT β calls to/usr/lib/sendmailwith the-bioption tend to show up in all kinds of scripts, like NIS make files, so the option has to be recognized. π
If -bi is encountered, the command specified by the bi_command configuration option is run, under the uid and gid of the caller of Exim. If the -oA option is used, its value is passed to the command as an argument. The command set by bi_command may not contain arguments. The command can use the exim_dbmbuild utility, or some other means, to rebuild alias files if that's what you need. If the bi_command option isn't set, calling Exim with -bi is a no-op. π«Ά
-bI:helpβ so we're providing various options starting-bI:for querying Exim for information. The output of many of these is intended for machine consumption. This one is not. The-bI:helpoption asks Exim for a synopsis of supported options beginning-bI:. Use of any of these options causes Exim to exit after producing the requested output. π-bI:dscpβ this option causes Exim to emit an alphabetically sorted list of all recognised DSCP names. Slay, sorted. π-bI:sieveβ this option causes Exim to emit an alphabetically sorted list of all supported Sieve protocol extensions on stdout, one per line. This is anticipated to be useful for ManageSieve (RFC 5804) implementations, in providing that protocol's SIEVE capability response line. Since the precise list may depend on compile-time build options β which this option adapts to β this is the only way to guarantee a correct response. No notes. π-bmβ this option runs an Exim receiving process that accepts an incoming, locally-generated message on 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. It's giving main character energy β
If any addresses in the message are unqualified (no domain), they get qualified by the values of the qualify_domain or qualify_recipient options, as appropriate. The -bnq option (see below) gives you a way to suppress this 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 the forms
From sender Fri Jan 5 12:55 GMT 1997
From sender Fri, 5 Jan 97 12:55:01
(with the weekday optional, and possibly with additional text after the date) is permitted to appear at the start of the message. There appears to be no authoritative specification of the format of this line. Exim recognizes it by matching against the regular expression defined by the uucp_from_pattern option, which can be changed if necessary. π legacy vibes
The specified sender is treated as if it were given as the argument to the -f option, but if a -f option is also present, its argument is used in preference to the address taken from the message. The caller of Exim must be a trusted user for the sender of a message to be set in this way. π₯
-bmalware <filename>β this debugging option causes Exim to scan the given file or directory (depending on the used scanner interface), using the malware scanning framework. The option ofav_scannerinfluences this option, so ifav_scanner's value depends on an expansion, then the expansion should have defaults that 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. Exim will be running as the Exim user when it tries to open the file, rather than as the invoking user. This option requires admin privileges. π
The -bmalware option will not be extended to be more generally useful β there are better tools for file-scanning. This option exists to help administrators verify their Exim and AV scanner configuration. Periodt.
-bnqβ by default, Exim automatically qualifies unqualified addresses (those without domains) that appear in messages submitted locally (that is, 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 usingqualify_recipient(which defaults to the value ofqualify_domain). πΈ
Sometimes you don't want qualification. For example, if -bS (batch SMTP) is being used to re-submit messages that originally came from remote hosts after content scanning, you probably don't want to qualify unqualified addresses in header lines. (Such lines will be present only if you haven't enabled a header syntax check in the appropriate ACL.) Bestie, read that twice. π«Ά
-bnqβ this one suppresses all qualification of unqualified addresses in messages that originate on the local host. Fr, no auto-filling in of domains. Heads up tho: when you use this, unqualified addresses in the envelope provoke errors (which means message rejection π) and unqualified addresses in header lines are left alone, just vibing as-is.-bPβ the "show me your config" option, and it's giving main character energy. With no arguments at all, it writes the values of all of Exim's main configuration options to the standard output. Obsessed.
Wanna see specific ones? Just pass their names as arguments, like:
exim -bP qualify_domain hold_domains
Now, 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 everyone else, the output looks 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. Sparkling clean β¨
If config_file is given as an argument, the name of the runtime configuration file is output. (configure_file works too, for backward compatibility, bestie β legacy icon.) 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. Scavenger hunt vibes π
If one of the words router, transport, or authenticator is given, followed by the name of an appropriate driver instance, the option settings for that driver are output. For example:
exim -bP transport local_delivery
The generic driver options are output first, followed by the driver's private options. A list of the names of drivers of a particular type can be obtained by using one of the words router_list, transport_list, or authenticator_list, and a complete list of all drivers with their option settings can be obtained by using routers, transports, or authenticators. Full roster, no notes π
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β 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. However, thequeue_list_requires_adminoption can be set false to allow any user to see the queue.
Each message in the queue is displayed like this:
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. Ice cold π§
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. Mother hen behaviour, honestly π£
-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+Dinstead of justD. Extra receipts, love that for you β¨-bpcβ counts the number of messages in the queue, and writes the total to the standard output. It is 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 is particularly useful if the output is going to be post-processed in a way that doesn't need the sorting. Chaos mode, but make it efficient π₯-bpraβ a combination of-bprand-bpa.-bpriβ a combination of-bprand-bpi.-bpruβ 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β 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β 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. Glow-up simulator fr π-bSβ 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, 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. Know the codes, bestie π«Ά
-bsβ 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 from the SMTP MAIL commands. Otherwise the content of these commands is ignored and the sender is set up as the calling user. Unqualified addresses are automatically qualified using qualify_domain and qualify_recipient, as appropriate, unless the -bnq option is used.
The -bs option is also how you 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 that stuff from earlier about senders and qualification? β¨ doesn't apply β¨. In this situation, Exim behaves exactly the same way it does when receiving a message via the listening daemon. π
-btβ runs Exim in address testing mode, where each argument is taken as a recipient address and 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 no arguments are given, Exim runs interactively and prompts 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 is running as root and there are security issues. π¨
Each address is handled as if it were the recipient address of a message (compare the -bv option). It gets passed to the routers and the result is written to standard output. However, any router that has no_address_test set is bypassed. That can make -bt easier to use for genuine routing tests if your first router passes everything to a scanner program. π΅οΈββοΈ
The return code is 2 if any address failed outright; it is 1 if no address failed outright but at least one could not be resolved for some reason. Return code 0 is given only when all addresses succeed. β
Note: when actually delivering a message, Exim removes duplicate recipient addresses after routing is complete, so only one delivery takes place. That 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 have 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β causes Exim to write the current version number, compilation number, and compilation date of theeximbinary to standard output. It also lists the DBM library that is being used, the optional modules (such as specific lookup types), the drivers that are included in the binary, and the name of the runtime configuration file that is in use. π§Ύβ¨
As part of its operation, -bV causes Exim to read and syntax check its configuration file. But bestie, this is a static check only β it cannot check values that are to be expanded. For example, although a misspelt ACL verb is detected, an error in the verb's arguments is not. You cannot rely on -bV alone to discover (for example) all the typos in the configuration; some realistic testing is needed. The -bh and -N options provide more dynamic testing facilities. π§ͺ
-bvβ 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 these might contain sensitive information such as usernames and passwords for database lookups. π
If no arguments are given, Exim runs interactively and prompts 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β 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β 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>β 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 this case, the first file that exists is used. Failure to open an existing file stops Exim from proceeding any further along the list, and an error is generated. π
When this option is used by a caller other than root, 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. π‘οΈ
ALT_CONFIG_PREFIX can be used to confine alternative configuration files to a directory to which only root has access. This prevents someone who has broken into the Exim account from running a privileged Exim with an arbitrary configuration file. πͺπ
The -C facility is useful for ensuring that configuration files are syntactically correct, but cannot be used for test deliveries, unless the caller is privileged, or unless it is an exotic configuration that does not require privilege. No check is made on the owner or group of the files specified by this option. π«
-D<macro>=<value>β okay so this one lets you override macro definitions straight from the config file. But heads up: just like-C, if an unprivileged caller uses it, Exim literally gives up its root privilege. And ifDISABLE_D_OPTIONis defined inLocal/Makefile, the whole-Dthing is completely disabled β using it is an instant error exit, no cap.
Now, if WHITELIST_D_MACROS is defined in Local/Makefile, it should be a colon-separated list of macros that are considered safe. If -D only supplies macros from this list and the values are acceptable, then Exim will not give up root privilege β but only when the caller is root, the Exim run-time user, or the CONFIGURE_OWNER, if set. This is a transition mechanism bestie, it's expected to be removed in the future, so don't get too attached. Acceptable values for the macros satisfy the regexp:
^[A-Za-z0-9_/.-]*$
The entire option (equals sign included, if present) has to be within one command line item. And listen β -D can set a macro's value to the empty string, in which case the equals sign is optional. These two commands are literally synonymous:
exim -DABC ...
exim -DABC= ...
Wanna include spaces in a macro definition item? Quotes are mandatory. And if you do use quotes, spaces are permitted around the macro name and the equals sign. Example:
exim '-D ABC = something' ...
-D may be repeated up to 10 times on a command line. And only macro names up to 22 letters long can be set. That's the limit, bestie. π
-d<debug options>β this makes debugging info get written to the standard error stream. It's restricted to admin users because the debugging output may show database queries that contain password information β and also, the details of users' filter files should be protected. So 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. Bye. π
When -d is used, -v is assumed. If -d is given on its own, a whole lot of standard debugging data is 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. Plus adds sets of debugging data, minus removes them. 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 lookupsmemoryβ 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 logicresolverβ turn on the DNS resolver's debugging outputretryβ retry handlingrewriteβ address rewritingrouteβ address routingtimestampβ 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 when used as +all, but includes it for -all. The reason? +all is what people tend to use when generating debug output for the Exim maintainers. And if +memory is included, an awful lot of output that is very rarely of interest gets generated, so now it has to be explicitly requested. However, -all does turn everything off. Different vibes entirely. π
The resolver option produces output only if the DNS resolver was compiled with DEBUG enabled β and that's not the case in some operating systems. Also, unfortunately, debugging output from the DNS resolver is written to stdout rather than stderr. Annoying, ik. π
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. Super useful when you're trying to track down delays in processing β obsessed, actually. β±οΈ
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 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 wanna monitor the behaviour of the daemon without drowning in as much output as full debugging produces. Chef's kiss. π-dropcrβ this is an obsolete option that's now a no-op. It used to affect the way Exim handled CR and LF characters in incoming messages. Rip bozo, it's giving legacy. π―οΈ-Eβ this option specifies that an incoming message is a locally-generated delivery failure report. It's 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.-exβ so there are a number of Sendmail options starting with-oethat seem to be called by various programs without the leadingoin the option. For example, thevacationprogram uses-eq. Exim treats all options of the form-exas synonymous with the corresponding-oexoptions. Same energy, different spelling. β¨-F <string>β sets the sender's full name for use when a locally-generated message is being accepted. If you don't pass this option, the user's gecos entry from the password data is used instead. 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). The option can normally be used only 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 is one exception to the restriction on the use of -f: an empty sender can be specified by any user, trusted or not, to create a message that can never provoke a bounce. An empty sender can be specified either as an empty string, or as a pair of angle brackets with nothing between them, as in these examples of shell commands:
exim -f '<>' user@domain
exim -f "" user@domain
In addition, the use of -f is not restricted when testing a filter file with -bf or when testing or verifying addresses using the -bt or -bv options.
And no, allowing untrusted users to change the sender address does not of itself make it possible to send anonymous mail. Exim still checks that the From: header refers to the local user, and if it doesn't, it adds a Sender: header β though this can be overridden by setting no_local_from_check.
White space between -f and the <address> is optional (meaning they can be given as two arguments or one combined argument). The sender of a locally-generated message can also be set (when permitted) by an initial "From " line in the message β see the description of -bm above β but if -f is also present, it overrides "From ". Periodt.
-Gβ this option is equivalent to an ACL applying:
control = suppress_local_fixups
for every message received. Note that Sendmail will complain about such bad formatting, where Exim silently just does not fix it up. This may change in future. As this affects audit information, the caller must be a trusted user to use this option. π
-h <number>β accepted for compatibility with Sendmail, but has no effect. (In Sendmail it overrides the"hop count"obtained by countingReceived:headers.) It's literally just there so nothing breaks. π-iβ okay so this one does the exact same thing as-oi: it says a dot sitting all alone on a line should not terminate an incoming, non-SMTP message. Periodt, no dot-ending the mail. Fun lore: 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 a-oicommand line option, which both are used by itsmailxcommand. Slay for consistency π-L <tag>β this is equivalent to settingsyslog_processnamein the config file and settinglog_file_pathtosyslog. Its use is restricted to administrators. Bestie, heads up: the configuration file has to be read and parsed, to determine access rights, before this is set and takes effect, so early configuration file errors will not honour this flag π. Also, the tag should not be longer than 32 characters.-M <message id> <message id> ...β this asks Exim to run a delivery attempt on each message in turn. If any of the messages are frozen, they are automatically thawed before the delivery attempt. The settings ofqueue_domains,queue_smtp_domains, andhold_domainsare ignored. π
Retry hints for any of the addresses are overridden β Exim tries to deliver even if the normal retry time has not yet been reached. This option requires the caller to be an admin user. However, there is an option called prod_requires_admin which can be set false to relax this restriction (and also the same requirement for the -q, -R, and -S options).
The deliveries happen synchronously, that is, the original Exim process does not terminate until all the delivery attempts have finished. No output is produced unless there is a serious error. If you want to see what is happening, use the -v option as well, or inspect Exim's main log. π
-Mar <message id> <address> <address> ...β this asks Exim to add the addresses to the list of recipients of the message (arfor "add recipients"). The first argument must be a message id, and the remaining ones must be email addresses. However, if the message is active (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> <sequence number> <message id>β not intended for use by external callers, bestie, this is internal business π. 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 to 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. 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. Thervariant 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> ...β this 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. Lowkey not very useful to external callers β 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. However,-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. A distinction between queue run deliveries and other deliveries is made in one or two places. π¦-Mes <message id> <address>β this asks Exim to change the sender address in the message to the given address, which must be a fully qualified address or"<>"(esfor "edit sender"). There must be exactly two arguments. The first argument must be a message id, and the second one an email address. However, if the message is active (in the middle of a delivery attempt), its status is not altered. This option can be used only by an admin user. β¨-Mf <message id> <message id> ...β this 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. However, if any of the messages are active (in the middle of a delivery attempt), their status is not altered. This option can be used only by an admin user. π§-Mg <message id> <message id> ...β this asks Exim to give up trying to deliver the listed messages, including any that are frozen. However, if any of the messages are active, their status is not altered. For non-bounce messages, a delivery error message is sent to the sender. Bounce messages are just discarded. This option can be used only by an admin user. π-MG <queue name> <message id> <message id> ...β this asks that each listed message be moved from its current queue to the given named queue. The destination queue name argument is required, but can be an empty string to define the default queue. If the messages are not currently located in the default queue, a-qG<name>option will be required to define the source queue. π-Mmad <message id> <message id> ...β this asks Exim to mark all the recipient addresses in the messages as already delivered (madfor "mark all delivered"). However, if any message is active (in the middle of a delivery attempt), its status is not altered. This option can be used only by an admin user.-Mmd <message id> <address> <address> ...β this asks Exim to mark the given addresses as already delivered (mdfor "mark delivered"). The first argument must be a message id, and the remaining ones must be email addresses. These are matched to recipient addresses in the message in a case-sensitive manner. If the message is active (in the middle of a delivery attempt), its status is not altered. This option can be used only by an admin user. π-Mrm <message id> <message id> ...β bestie, this one is the yeet button π. It asks Exim to remove the given messages from the queue, and no bounce messages get sent β each message is justβ¦ forgotten. Poof. Gone. But if any of those messages are currently active, their status is not altered (so don't think you can snatch a message mid-delivery). Only an admin user, or the user who originally caused the message to be placed in the queue, can use this one. π₯-Mset <message id>β this one is only useful alongside-be(i.e. when you're testing string expansions). Exim loads the given message from its spool before doing the test expansions, which sets message-specific variables like$message_sizeand the header variables. The$recipientsvariable is made available too. It exists purely to make testing expansions that use these variables easier π. Downside? Only an admin user can use it. See also-bem.-Mt <message id> <message id> ...β the un-freeze button π§β‘οΈπ₯. This asks Exim to "thaw" any of the listed messages that are "frozen", so delivery attempts can resume. Same catch as before though: if any of the messages are active, their status is not altered. Admin users only.-Mvb <message id>β dumps the contents of the message body (-D) spool file to standard output. Admin user only, no cap.-Mvc <message id>β writes a copy of the complete message (header lines plus body) to standard output in RFC 2822 format β¨. Admin user only.-Mvh <message id>β writes the contents of the message headers (-H) spool file to standard output. Admin user only.-Mvl <message id>β writes the contents of the message log spool file to standard output. Admin user only.-mβ literally just a synonym for-omthat Sendmail accepts (seehttps://docs.oracle.com/cd/E19457-01/801-6680-1M/801-6680-1M.pdfp. 1M-258), so Exim treats it that way too. Copying the homework but making it iconic π .-Nβ a debugging option that stops delivery of a message at the transport level, and it implies-v. Exim goes through so many of the motions of delivery β it just doesn't actually transport the message, and instead behaves as if it had successfully done so π«Ά. Except: it makes no updates to the retry database, and the log entries for deliveries are flagged with*>rather than=>.
Okay so because -N discards any message it applies to, 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. And even though transportation never fails when -N is set, an address may still 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. Permanent commitment, honestly π.
-nβ Sendmail reads this as "no aliasing". For normal modes of operation, Exim just ignores it π. But when combined with-bPit makes the output more terse (it suppresses option names, environment values and config pretty printing).-O <data>β Sendmail reads this as "set option". Exim ignores it. That's it. That's the whole vibe.-oA <file name>β Sendmail uses this together with-bito specify an alternative alias filename. Exim handles-bidifferently, so go read the description above β.-oB <n>β a debugging option that caps 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.-odbβ applies to all modes in which Exim accepts incoming messages, including the listening daemon. It requests "background" delivery of those messages, meaning the accepting process automatically starts a delivery process for each message received, but doesn't 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.
And 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 at all. Rude but valid.
-odfβ requests "foreground" (synchronous) delivery when Exim has accepted a locally-generated message. For the daemon it's 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's 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 there 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 get placed in the queue and stay there until a subsequent queue runner process encounters them. There are several configuration options (likequeue_only) that can queue incoming messages under certain conditions β this option overrides all of them, and also overrides-odqs. It always forces queueing. No exceptions, periodt π.-odqsβ the hybrid child of-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. But 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, so a bunch 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β if an error is detected while a non-SMTP message is being received (say, a malformed address), the error is reported to the sender in a mail message βοΈ.
Provided this error message is successfully sent, the Exim receiving process exits with a return code of zero. If not, the return code is 2 if the problem is that the original message has no recipients, or 1 for any other error. This is the default -oex option if Exim is called as rmail.
-oemβ same as-oee, except Exim always exits with a non-zero return code, whether or not the error message was successfully sent π€. This is the default-oexoption, unless Exim is called asrmail.-oepβ if an error is detected while a non-SMTP message is being received, the error is reported by writing a message to the standard error file (stderr). The return code is1for all errors.-oeqβ supported for compatibility with Sendmail, but has the same effect as-oep. Twin energy.-oewβ supported for compatibility with Sendmail, but has the same effect as-oem. Also twin energy.-oiβ same effect as-i: it specifies that 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. See also-ti.-oitrueβ treated as synonymous with-oiπΈ.-oMa <host address>β okay so a whole little family of options starting with-oMcan set values associated with remote hosts on locally-submitted messages (that is, messages not received over TCP/IP). These can be used by any caller 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. This may include a port number at the end, after a full stop (period). For example:
exim -bs -oMa 10.9.8.7.1234
An alternative syntax is to enclose the IP address in square brackets, followed by a colon and the port number:
exim -bs -oMa [10.9.8.7]:1234
The IP address goes into the $sender_host_address variable, and the port, if present, into $sender_host_port. And if both -oMa and -bh are present on the command line, the sender host IP address is taken from whichever one is last π§ (last one wins, iykyk).
-oMaa <name>β okay so this is one of the-oMgirlies (peep-oMaabove for the whole general-remarks spiel π ).-oMaasets the value of$sender_host_authenticatedβ that's the authenticator name, bestie. And the cute part? You can use it with-bhand-bsto set up a fully authenticated SMTP session without actually running the SMTP AUTH command. Iconic workaround behavior, honestly. β¨-oMai <string>β another-oMvariant (again,-oMaabove for the general notes π«Ά).-oMaisets the value of$authenticated_idβ the id that got authenticated. It overrides the default value, which is the caller's login id, except with-bh, where there's no default at all. This one's for messages from local sources. π-oMas <address>β yep,-oMagain (general remarks live up at-oMa, go look π).-oMassets the authenticated sender value in$authenticated_sender. It overrides the sender address that gets created from the caller's login id for messages from local sources β except when-bhis used, where there is no default. And for both-bhand-bs, an authenticated sender specified on aMAILcommand overrides this value. so that one wins, periodt. π-oMi <interface address>β-oMenergy once more (see-oMaabove πΈ).-oMisets the IP interface address value. A port number may be included, using the same syntax as for-oMa. The interface address lands in$received_ip_address, and the port number, if there is one, lands in$received_port. clean split, no crumbs. β¨-oMm <message reference>β-oMclub again, general remarks at-oMa(iykyk π).-oMmsets the message reference, e.g. a message-id, and it gets 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 will abort if the format is invalid. Important: the option is only accepted ifeximis running in trusted mode β not as any regular user. no cap. π₯
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 bouncing. so the receipts stay linked π
-oMr <protocol name>β-oMgirlies, general remarks at-oMaπ.-oMrsets the received protocol value that's stored in$received_protocol. BUT it does not apply (and is just 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. And heads up: repeated use of this option is not supported. π-oMs <host name>β-oMsection,-oMaabove, you know the drill π¦.-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. trust, no DNS drama. β-oMt <ident string>β one more-oM(general remarks:-oMaπ ).-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, where there's no default. π
-omβ in Sendmail this option means "me too", as in the sender of a message should get a copy if the sender shows up in an alias expansion. Exim always does this, so the option does nothing. literally nothing. π-ooβ this option is ignored. In Sendmail it specifies "old style headers", whatever that means. we don't know her, bestie π«Ά-oP <path>β 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 of causing Exim to write a pid file β because in those cases the normal pid file isn't used. so yeah, you kind of need it πΈ-oPXβ not intended for general use, okay? π The daemon uses it when terminating due to aSIGTEM, possibly in combination with-oP <path>. It causes the pid file to be removed. that's it, that's the whole job. π§Ή-or <time>β sets a timeout value for incoming non-SMTP messages. If it isn't set, Exim will wait forever for the standard input. forever forever π The value can also be set by thereceive_timeoutoption.-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 thesmtp_receive_timeoutoption, and it defaults to5 minutes. β°-ovβ this option has exactly the same effect as-v. same vibes, different spelling π-oX <number or string>β relevant only 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. so don't come crying about a missing pid file, k? π-oYβ this controls the creation of an inter-process communications endpoint by the Exim daemon, and 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 it should be used on all of them. Just know that the features supported by the socket will not be available in such cases. trade-offs, bestie π¬
The socket is currently used for:
- fast ramp-up of queue runner processes π₯
- caching compiled regexes β¨
- obtaining a current queue size π
-pdβ this 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's needed. lazy girlboss behavior, honestly π-psβ also for the embedded Perl interpreter case. It overrides the setting of theperl_at_startoption, forcing the starting of the interpreter to occur as soon as Exim is started. no waiting, we go now πββοΈ-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's therefore impossible to set a protocol value of d or s using this option (but that doesn't seem a real limitation). Also: repeated use of this option is not supported. π
-qβ normally restricted to admin users. However, there's a configuration option calledprod_requires_adminwhich can be set false to relax this restriction β and it also relaxes 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 β use -qf (see below) if you want to override that. β³
If the delivery process spawns other processes to deliver other messages down passed SMTP connections, the queue runner waits for these to finish before proceeding.
When all the queued messages have been considered, the original queue runner process terminates. In other words: a single pass is made over the waiting mail, one message at a time. Use -q with a time (see below) if you want it repeated periodically. π
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 all that matters. If one particular message screws up a remote MTA, other messages to the same MTA have a chance of getting through if they get tried first. chaos as a feature, honestly π
It is possible to cause the messages to be processed in lexical message id order β which is essentially the order in which they arrived β by setting the queue_run_in_order option, but this is not recommended for normal use. π
-q<qflags>β 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 is described in a separate item below. order matters, bestie π-qq...β an option starting with-qqrequests a two-stage queue run. In the first stage, the queue is scanned as if thequeue_smtp_domainsoption matched every domain. Addresses are routed, local deliveries happen, but no remote transports are run. β¨
Performance will be best if the queue_run_in_order option is false. If that's 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 completes, 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. chef's kiss efficiency π
Two-phase queue runs are lowkey a must on systems that have a big queue even sometimes (think mailing-list operators, they get it). They can also be a vibe for hosts that only hop onto the Internet intermittently. π¦
-q[q]i...β if thatiflag is there, the queue runner only spins up delivery processes for messages that haven't been tried yet (istands for "initial delivery", iykyk). Super helpful when you've been dropping messages into the queue with-odqand you just want a queue runner to handle the fresh ones. β¨-q[q][i]f...β onefflag present? Then a delivery attempt gets forced for every non-frozen message. Withoutf, only the non-frozen addresses that have already passed their retry times get tried. no cap.-q[q][i]ff...β withff, a delivery attempt is forced for every message, frozen or not. literally all of them. π-q[q][i][f[f]]lβ thelflag (that's the letter "ell", bestie, don't come for me) means only local deliveries get done. If a message needs any remote deliveries, it just chills in the queue for later. π-q[q][i][f[f]][l][G<name>[/<time>]]]β if theGflag and a name are present, the queue runner operates on the queue with that given name instead of the default queue. The name should not contain a/character. For a periodic queue run (peep below π) you append a slash and a time value to the name.
If other commandline options specify an action, a -qG<name> option specifies 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 skip over messages whose ids are lexically less than a given value, by following the-qoption with a starting message id. Example:
exim -q 0t5C6f-0000c8-00
Messages that arrived earlier than 0t5C6f-0000c8-00 are not inspected. If you give a second message id, messages whose ids are lexically greater than it get skipped too. And if you give the same id twice, like:
exim -q 0t5C6f-0000c8-00 0t5C6f-0000c8-00
then just one delivery process starts, 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 this selection mechanism does not affect the order in which messages are scanned. There are other ways of selecting specific sets of messages for delivery in a queue run too β see -R and -S. π
-q<qflags><time>β when a time value is present,-qmakes Exim run as a daemon, starting a queue runner process at intervals specified by that time value. This form is commonly combined with-bd, in which case a single daemon process handles both functions. A common way of starting up a combined daemon at system boot time is a command like:
/usr/exim/bin/exim -bd -q30m
Such a daemon listens for incoming SMTP calls, and also starts a queue runner process every 30 minutes. π
You can set up runners for multiple named queues within one daemon, like:
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's here for Sendmail compatibility. π-qS<rsflags> <string>β 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 β it causes Exim to perform a single queue run β except that when scanning the messages on the queue, Exim only processes those with at least one undelivered recipient address containing the given string, checked in a case-independent way. If <rsflags> start with r, <string> is interpreted as a regular expression; otherwise it's a literal string. π¦
Wanna do periodic queue runs for messages with specific recipients? Combine -R with -q and a time value. Example:
exim -q25m -R @special.domain.example
That does a queue run for messages with recipients in the given domain every 25 minutes. Any additional flags specified with -q get 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. That means if delivery of any address in the first message succeeds, any existing retry information is deleted, so delivery attempts for that address in subsequently selected messages (processed without forcing) will run. But if delivery of any address doesn't succeed, the retry information is updated, and in subsequently selected messages the failing address gets skipped. π
If <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 a while. 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β a documented (for Sendmail) obsolete alternative name for-f. that's it, that's the whole option. π-S<rsflags> <string>β acts like-Rexcept 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 option hasforffin its flags, the associated action is taken. π-Tqt <times>β exclusively for the Exim testing suite. It is not recognized when Exim is run normally. It allows setting up explicit "queue times" so various warning/retry features can be tested. π§-tβ when Exim is receiving a locally-generated, non-SMTP message on its standard input,-tmakes the recipients come 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. β¨
If the command has any arguments, they specify addresses the message is not to be delivered to. That is, the argument addresses are removed from the recipients list obtained from the headers. This is compatible with Smail 3 and in accordance with the documented behaviour of several versions of Sendmail, as described in man pages on a number of operating systems (e.g. Solaris 8, IRIX 6.5, HP-UX 11). However, some versions of Sendmail add argument addresses to those obtained from the headers, and the O'Reilly Sendmail book documents it that way. You can make Exim add argument addresses instead of subtracting them by setting the option extract_addresses_remove_arguments to false. π
If there are any Resent- header lines in the message, Exim extracts recipients from all Resent-To:, Resent-Cc:, and Resent-Bcc: header lines instead of from To:, Cc:, and Bcc:. This is for compatibility with Sendmail and other MTAs. (Prior to release 4.20, Exim gave an error if -t was used in conjunction with Resent- header lines.) π
RFC 2822 talks about different sets of Resent- header lines (for when a message is resent several times). The RFC also specifies they should be added at the front of the message, and separated by Received: lines. It is not at all clear how -t should operate in the presence of multiple sets, nor indeed exactly what constitutes a "set". In practice it seems MUAs do not follow the RFC. The Resent- lines are often added at the end of the header, and if a message is resent more than once, it's common for the original set of Resent- headers to be renamed as X-Resent- when a new set is added. This removes any possible ambiguity. πΈ
-tiβ exactly equivalent to-t -i. Provided for compatibility with Sendmail. π«Ά-tls-on-connectβ available when Exim is compiled with TLS support. It forces all incoming SMTP connections to behave as if the incoming port is listed in thetls_on_connect_portsoption. π₯-Uβ Sendmail uses this option for "initial message submission", and its documentation states that in future releases it may complain about syntactically invalid messages rather than fixing them when this flag is not set. Exim ignores this option. π-vβ bestie, this is the tell me everything mode π£οΈβ¨ It makes Exim dump info onto the standard error stream describing what it's doing. Like, literally narrating its life. Specifically? It shows the log lines for receiving and delivering a message, and if an SMTP connection happens, you get the whole SMTP dialogue on display π Some of the log lines it shows might not actually make it into the log, though β depends on whatlog_selectoris set to, because that setting can discard them π Any relevant selectors get shown next to each log line, so you can see what's filtering what. And if no selectors show up next to a line? That means the logging is unconditional, no cap π―-xβ okay so this one is a whole AIX situation π AIX uses-xfor a private purpose of its own β and I'm quoting here β "mail from a local mail program has National Language Support extended characters in the body of the mail item". AIX just sets-xwhen it calls the MTA from its mail command, so it's a them thing, not an Exim thing. Exim straight up ignores this option π«Ά nothing happens, it's just vibes.-X <logfile>β this flag gets interpreted by Sendmail to send debug information to the named file. Exim? Exim ignores it entirely π Sorry to that flag.-z <log-line>β this one actually does something, and it's kinda iconic π It writes its argument straight into Exim's logfile. But β and this is important, bestie β use is restricted to administrators π The whole intent here is for operational notes, little annotations in the log, y'know? Also under most shells you should use quotes so a multi-word item stays as a single argument, fr fr π
β οΈ Real talk: -z is admin-only. Don't come for me if you get told no π
β¨ SEE ALSO β¨
There's more where this came from, and it's all excellent reading material πΈ:
- The full Exim specification π
- The Exim book π
- The Exim wiki π
Go read the spec, it's giving encyclopedia but make it mail server and honestly she ate π
And that's a wrap on the whole page, bestie!! π This whole thing lives under the EXIM(8) footer β yep, that little tag at the bottom right, the source/version-and-date situation that says "you are here, this is the Exim 8 man page" π¦ So go forth, read your spec, check your log_selector, and remember: the manual said it, so it's canon π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: exim 4.98.2-bp160.2.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: exim 4.98.2-bp160.2.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: exim 4.98.2-bp160.2.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: exim 4.98.2-bp160.2.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms