Remove my email address accidentally left in the NOTICE file.
[exim.git] / doc / doc-docbook / spec.ascd
CommitLineData
168e428f 1////////////////////////////////////////////////////////////////////////////
f9daeae0 2$Cambridge: exim/doc/doc-docbook/spec.ascd,v 1.4 2005/12/05 14:38:18 ph10 Exp $
168e428f
PH
3
4This is the primary source of the Exim Manual. It is an AsciiDoc document
5that is converted into DocBook XML for subsequent conversion into printing
6and online formats. The markup used herein is traditional AsciiDoc markup,
7with some extras. The markup is summarized in a file called AdMarkup.txt. A
8private AsciiDoc configuration file specifies how the extra markup is to be
9translated into DocBook XML. You MUST use this private AsciiDoc markup if you
10want to get sensible results from processing this document.
11////////////////////////////////////////////////////////////////////////////
12
13
14
15////////////////////////////////////////////////////////////////////////////
16I am abusing the <abstract> DocBook element as the only trivial way of getting
17this information onto the title verso page in the printed renditions. A better
18title page would be a useful improvement. The <abstract> element is removed by
19preprocessing for the HTML renditions, and the whole <docbookinfo> element is
20removed for ascii output formats.
21////////////////////////////////////////////////////////////////////////////
22
23Specification of the Exim Mail Transfer Agent
24=============================================
25:abstract: University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England
26:author: Philip Hazel
27:copyright: University of Cambridge
28:cpyear: 2005
068aaea8 29:date: 01 November 2005
168e428f 30:doctitleabbrev: The Exim MTA
068aaea8 31:revision: 4.60
168e428f
PH
32
33
34//////////////////////////////////////////////////////////////////////////////
35***WARNING*** Do not put anything, not even a titleabbrev, setting before
36the first chapter (luckily it does not need one) because if you do, AsciiDoc
37creates an empty <preface> element, which we do not want.
38//////////////////////////////////////////////////////////////////////////////
39
40Introduction
41------------
42
43////////////////////////////////////////////////////////////////////////////
44These are definitions of AsciiDoc "attributes" that are in effect "variables"
45whose values can be substituted. The first makes index entries shorter. The
46second avoids problems with literal asterisks getting tangled up with bold
47emphasis quotes. The others are here for convenience of editing.
48
49***WARNING*** The positioning of these definitions, after the first Chapter
50title, seems to be important. If they are placed earlier, they give rise to
51incorrect XML.
52////////////////////////////////////////////////////////////////////////////
53
54:ACL: access control lists (ACLs)
55:star: *
068aaea8
PH
56:previousversion: 4.50
57:version: 4.60
168e428f
PH
58
59
60////////////////////////////////////////////////////////////////////////////
61This chunk of literal XML implements index entries of the form "x, see y" and
62"x, see also y". It didn't seem worth inventing AsciiDoc markup for this,
63because is it not something that is likely to change often.
64////////////////////////////////////////////////////////////////////////////
65
66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
67<indexterm role="concept">
68 <primary>$1, $2, etc.</primary>
69 <see><emphasis>numerical variables</emphasis></see>
70</indexterm>
71<indexterm role="concept">
72 <primary>address</primary>
73 <secondary>rewriting</secondary>
74 <see><emphasis>rewriting</emphasis></see>
75</indexterm>
76<indexterm role="concept">
068aaea8
PH
77 <primary>Bounce Address Tag Validation</primary>
78 <see><emphasis>BATV</emphasis></see>
79</indexterm>
80<indexterm role="concept">
81 <primary>Client SMTP Authorization</primary>
82 <see><emphasis>CSA</emphasis></see>
83</indexterm>
84<indexterm role="concept">
168e428f
PH
85 <primary>CR character</primary>
86 <see><emphasis>carriage return</emphasis></see>
87</indexterm>
88<indexterm role="concept">
89 <primary>CRL</primary>
90 <see><emphasis>certificate revocation list</emphasis></see>
91</indexterm>
92<indexterm role="concept">
93 <primary>delivery</primary>
94 <secondary>failure report</secondary>
95 <see><emphasis>bounce message</emphasis></see>
96</indexterm>
97<indexterm role="concept">
98 <primary>dialup</primary>
99 <see><emphasis>intermittently connected hosts</emphasis></see>
100</indexterm>
101<indexterm role="concept">
102 <primary>exiscan</primary>
103 <see><emphasis>content scanning</emphasis></see>
104</indexterm>
105<indexterm role="concept">
106 <primary>failover</primary>
107 <see><emphasis>fallback</emphasis></see>
108</indexterm>
109<indexterm role="concept">
110 <primary>fallover</primary>
111 <see><emphasis>fallback</emphasis></see>
112</indexterm>
113<indexterm role="concept">
114 <primary>filter</primary>
115 <secondary>Sieve</secondary>
116 <see><emphasis>Sieve filter</emphasis></see>
117</indexterm>
118<indexterm role="concept">
119 <primary>ident</primary>
120 <see><emphasis>RFC 1413</emphasis></see>
121</indexterm>
122<indexterm role="concept">
123 <primary>LF character</primary>
124 <see><emphasis>linefeed</emphasis></see>
125</indexterm>
126<indexterm role="concept">
127 <primary>maximum</primary>
128 <see><emphasis>limit</emphasis></see>
129</indexterm>
130<indexterm role="concept">
068aaea8
PH
131 <primary>monitor</primary>
132 <see><emphasis>Exim monitor</emphasis></see>
133</indexterm>
134<indexterm role="concept">
168e428f
PH
135 <primary>no_<emphasis>xxx</emphasis></primary>
136 <see>entry for xxx</see>
137</indexterm>
138<indexterm role="concept">
139 <primary>NUL</primary>
140 <see><emphasis>binary zero</emphasis></see>
141</indexterm>
142<indexterm role="concept">
143 <primary>passwd file</primary>
144 <see><emphasis>/etc/passwd</emphasis></see>
145</indexterm>
146<indexterm role="concept">
147 <primary>process id</primary>
148 <see><emphasis>pid</emphasis></see>
149</indexterm>
150<indexterm role="concept">
151 <primary>RBL</primary>
152 <see><emphasis>DNS list</emphasis></see>
153</indexterm>
154<indexterm role="concept">
155 <primary>redirection</primary>
156 <see><emphasis>address redirection</emphasis></see>
157</indexterm>
158<indexterm role="concept">
159 <primary>return path</primary>
160 <seealso><emphasis>envelope sender</emphasis></seealso>
161</indexterm>
162<indexterm role="concept">
163 <primary>scanning</primary>
164 <see><emphasis>content scanning</emphasis></see>
165</indexterm>
166<indexterm role="concept">
167 <primary>SSL</primary>
168 <see><emphasis>TLS</emphasis></see>
169</indexterm>
170<indexterm role="concept">
171 <primary>string</primary>
172 <secondary>expansion</secondary>
173 <see><emphasis>expansion</emphasis></see>
174</indexterm>
175<indexterm role="concept">
176 <primary>top bit</primary>
177 <see><emphasis>8-bit characters</emphasis></see>
178</indexterm>
179<indexterm role="concept">
180 <primary>variables</primary>
181 <see><emphasis>expansion, variables</emphasis></see>
182</indexterm>
183<indexterm role="concept">
184 <primary>zero, binary</primary>
185 <see><emphasis>binary zero</emphasis></see>
186</indexterm>
187++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
188
189
190////////////////////////////////////////////////////////////////////////////
191OK, now we start with the real data for this first chapter.
192////////////////////////////////////////////////////////////////////////////
193
194Exim is a mail transfer agent (MTA) for hosts that are running Unix or
195Unix-like operating systems. It was designed on the assumption that it would be
196run on hosts that are permanently connected to the Internet. However, it can be
197used on intermittently connected hosts with suitable configuration adjustments.
198
199Configuration files currently exist for the following operating systems: AIX,
068aaea8
PH
200BSD/OS (aka BSDI), Darwin (Mac OS X), DGUX, Dragonfly, FreeBSD, GNU/Hurd,
201GNU/Linux, HI-OSF (Hitachi), HI-UX, HP-UX, IRIX, MIPS RISCOS, NetBSD, OpenBSD,
202OpenUNIX, QNX, SCO, SCO SVR4.2 (aka UNIX-SV), Solaris (aka SunOS5), SunOS4,
203Tru64-Unix (formerly Digital UNIX, formerly DEC-OSF1), Ultrix, and Unixware.
204Some of these operating systems are no longer current and cannot easily be
205tested, so the configuration files may no longer work in practice.
168e428f
PH
206
207There are also configuration files for compiling Exim in the Cygwin environment
208that can be installed on systems running Windows. However, this document does
209not contain any information about running Exim in the Cygwin environment.
210
211The terms and conditions for the use and distribution of Exim are contained in
212the file _NOTICE_. Exim is distributed under the terms of the GNU General
213Public Licence, a copy of which may be found in the file _LICENCE_.
214
215The use, supply or promotion of Exim for the purpose of sending bulk,
216unsolicited electronic mail is incompatible with the basic aims of the program,
217which revolve around the free provision of a service that enhances the quality
218of personal communications. The author of Exim regards indiscriminate
219mass-mailing as an antisocial, irresponsible abuse of the Internet.
220
221Exim owes a great deal to Smail 3 and its author, Ron Karr. Without the
222experience of running and working on the Smail 3 code, I could never have
223contemplated starting to write a new MTA. Many of the ideas and user interfaces
224were originally taken from Smail 3, though the actual code of Exim is entirely
225new, and has developed far beyond the initial concept.
226
227Many people, both in Cambridge and around the world, have contributed to the
228development and the testing of Exim, and to porting it to various operating
229systems. I am grateful to them all. The distribution now contains a file called
230_ACKNOWLEDGMENTS_, in which I have started recording the names of
231contributors.
232
233
234
235Exim documentation
236~~~~~~~~~~~~~~~~~~
237[revisionflag="changed"]
238cindex:[documentation]
239This edition of the Exim specification applies to version {version} of Exim.
240Substantive changes from the {previousversion} edition are marked in some
241renditions of the document; this paragraph is so marked if the rendition is
242capable of showing a change indicator.
243
244This document is very much a reference manual; it is not a tutorial. The reader
245is expected to have some familiarity with the SMTP mail transfer protocol and
246with general Unix system administration. Although there are some discussions
247and examples in places, the information is mostly organized in a way that makes
248it easy to look up, rather than in a natural order for sequential reading.
249Furthermore, the manual aims to cover every aspect of Exim in detail, including
250a number of rarely-used, special-purpose features that are unlikely to be of
251very wide interest.
252
253cindex:[books about Exim]
254An ``easier'' discussion of Exim which provides more in-depth explanatory,
255introductory, and tutorial material can be found in a book entitled
256'The Exim SMTP Mail Server', published by UIT Cambridge
257(*http://www.uit.co.uk/exim-book/[]*).
258
259This book also contains a chapter that gives a general introduction to SMTP and
260Internet mail. Inevitably, however, the book is unlikely to be fully up-to-date
261with the latest release of Exim. (Note that the earlier book about Exim,
262published by O'Reilly, covers Exim 3, and many things have changed in Exim 4.)
263
068aaea8
PH
264[revisionflag="changed"]
265cindex:[Debian,information sources]
266If you are using a Debian distribution of Exim, you will find information about
267Debian-specific features in the file
268&&&&
269_/usr/share/doc/exim4-base/README.Debian_
270&&&&
271The command ^man update-exim.conf^ is another source of Debian-specific
272information.
273
168e428f
PH
274cindex:[_doc/NewStuff_]
275cindex:[_doc/ChangeLog_]
276cindex:[change log]
277As the program develops, there may be features in newer versions that have not
278yet made it into this document, which is updated only when the most significant
279digit of the fractional part of the version number changes. Specifications of
280new features that are not yet in this manual are placed in the file
281_doc/NewStuff_ in the Exim distribution.
282
283Some features may be classified as ``experimental''. These may change
284incompatibly while they are developing, or even be withdrawn. For this reason,
285they are not documented in this manual. Information about experimental features
286can be found in the file _doc/experimental.txt_.
287
288All changes to the program (whether new features, bug fixes, or other kinds of
289change) are noted briefly in the file called _doc/ChangeLog_.
290
291cindex:[_doc/spec.txt_]
292This specification itself is available as an ASCII file in _doc/spec.txt_ so
293that it can easily be searched with a text editor. Other files in the _doc_
294directory are:
295
296[frame="none"]
297`--------------------`------------------------------------------
298_OptionLists.txt_ list of all options in alphabetical order
299_dbm.discuss.txt_ discussion about DBM libraries
300_exim.8_ a man page of Exim's command line options
301_experimental.txt_ documentation of experimental features
302_filter.txt_ specification of the filter language
303_pcrepattern.txt_ specification of PCRE regular expressions
304_pcretest.txt_ specification of the PCRE testing program
305_Exim3.upgrade_ upgrade notes from release 2 to release 3
306_Exim4.upgrade_ upgrade notes from release 3 to release 4
307----------------------------------------------------------------
308
309The main specification and the specification of the filtering language are also
310available in other formats (HTML, PostScript, PDF, and Texinfo). Section
311<<SECTavail>> below tells you how to get hold of these.
312
313
314
315FTP and web sites
316~~~~~~~~~~~~~~~~~
317cindex:[web site]
318cindex:[FTP site]
068aaea8 319The primary site for Exim source distributions is currently the University of
168e428f
PH
320Cambridge's FTP site, whose contents are described in 'Where to find the Exim
321distribution' below. In addition, there is a web site and an FTP site at
322%exim.org%. These are now also hosted at the University of Cambridge. The
323%exim.org% site was previously hosted for a number of years by Energis Squared,
324formerly Planet Online Ltd, whose support I gratefully acknowledge.
325
326As well as Exim distribution tar files, the Exim web site contains a number of
327differently formatted versions of the documentation, including the
328cindex:[FAQ] FAQ in both text and HTML formats. The HTML version comes with
329a keyword-in-context index. A recent addition to the online information is the
330cindex:[wiki]
331Exim wiki (*http://www.exim.org/eximwiki/[]*).
332We hope that this will make it easier for Exim users to contribute examples,
333tips, and know-how for the benefit of others.
334
335
336
337Mailing lists
338~~~~~~~~~~~~~
339cindex:[mailing lists,for Exim users]
340The following are the three main Exim mailing lists:
341
342[frame="none"]
343`-------------------------------`----------------------------------------
344'exim-users@exim.org' general discussion list
345'exim-dev@exim.org' discussion of bugs, enhancements, etc.
346'exim-announce@exim.org' moderated, low volume announcements list
347-------------------------------------------------------------------------
348
349You can subscribe to these lists, change your existing subscriptions, and view
350or search the archives via the mailing lists link on the Exim home page. The
351'exim-users' mailing list is also forwarded to
352*http://www.egroups.com/list/exim-users[]*, an archiving system with searching
353capabilities.
354
068aaea8
PH
355[revisionflag="changed"]
356cindex:[Debian,mailing list for]
357If you are using a Debian distribution of Exim, you may wish to subscribe to
358the Debian-specific mailing list, which is
359'pkg-exim4-users@lists.alioth.debian.org'.
360
168e428f
PH
361
362Exim training
363~~~~~~~~~~~~~
364cindex:[training courses]
068aaea8
PH
365From time to time (approximately annually at the time of writing), training
366courses are run by the author of Exim in Cambridge, UK. Details can be found on
367the web site *http://www-tus.csx.cam.ac.uk/courses/exim/[]*.
168e428f
PH
368
369
370Bug reports
371~~~~~~~~~~~
372cindex:[bug reports]
373cindex:[reporting bugs]
374Reports of obvious bugs should be emailed to 'bugs@exim.org'. However, if
375you are unsure whether some behaviour is a bug or not, the best thing to do is
068aaea8 376to post a message to the 'exim-dev' mailing list and have it discussed.
168e428f
PH
377
378
379
380[[SECTavail]]
381Where to find the Exim distribution
382~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
383cindex:[FTP site]
384cindex:[distribution,ftp site]
385The master ftp site for the Exim distribution is
386
387&&&
388*ftp://ftp.csx.cam.ac.uk/pub/software/email/exim[]*
389&&&
390
391This is mirrored by
392
393&&&
394*ftp://ftp.exim.org/pub/exim[]*
395&&&
396
397The file references that follow are relative to the _exim_ directories at these
398sites. There are now quite a number of independent mirror sites around the
399world. Those that I know about are listed in the file called _Mirrors_.
400
401Within the _exim_ directory there are subdirectories called _exim3_ (for
402previous Exim 3 distributions), _exim4_ (for the latest Exim 4
403distributions), and _Testing_ for testing versions. In the _exim4_
404subdirectory, the current release can always be found in files called
405
406&&&
407_exim-n.nn.tar.gz_
408_exim-n.nn.tar.bz2_
409&&&
410
411where 'n.nn' is the highest such version number in the directory. The two
412files contain identical data; the only difference is the type of compression.
413The _.bz2_ file is usually a lot smaller than the _.gz_ file.
414
415cindex:[distribution,signing details]
416cindex:[distribution,public key]
417cindex:[public key for signed distribution]
418The distributions are currently signed with Philip Hazel's GPG key. The
419corresponding public key is available from a number of keyservers, and there is
420also a copy in the file _Public-Key_. The signatures for the tar bundles are
421in:
422
423&&&
424_exim-n.nn.tar.gz.sig_
425_exim-n.nn.tar.bz2.sig_
426&&&
427
428For each released version, the log of changes is made separately available in a
429separate file in the directory _ChangeLogs_ so that it is possible to
430find out what has changed without having to download the entire distribution.
431
432cindex:[documentation,available formats]
433The main distribution contains ASCII versions of this specification and other
434documentation; other formats of the documents are available in separate files
435inside the _exim4_ directory of the FTP site:
436
437&&&
438_exim-html-n.nn.tar.gz_
439_exim-pdf-n.nn.tar.gz_
440_exim-postscript-n.nn.tar.gz_
441_exim-texinfo-n.nn.tar.gz_
442&&&
443
444These tar files contain only the _doc_ directory, not the complete
445distribution, and are also available in _.bz2_ as well as _.gz_ forms.
446cindex:[FAQ]
447The FAQ is available for downloading in two different formats in these files:
448
449&&&
450_exim4/FAQ.txt.gz_
451_exim4/FAQ.html.tar.gz_
452&&&
453
454The first of these is a single ASCII file that can be searched with a text
455editor. The second is a directory of HTML files, normally accessed by starting
456at _index.html_. The HTML version of the FAQ (which is also included in the
457HTML documentation tarbundle) includes a keyword-in-context index, which is
458often the most convenient way of finding your way around.
459
460
461Wish list
462~~~~~~~~~
463cindex:[wish list]
464A wish list is maintained, containing ideas for new features that have been
465submitted. From time to time the file is exported to the ftp site into the file
466_exim4/WishList_. Items are removed from the list if they get implemented.
467
468
469
470Contributed material
471~~~~~~~~~~~~~~~~~~~~
472cindex:[contributed material]
473At the ftp site, there is a directory called _Contrib_ that contains
474miscellaneous files contributed to the Exim community by Exim users. There is
475also a collection of contributed configuration examples in
476_exim4/config.samples.tar.gz_. These samples are referenced from the FAQ.
477
478
479
480Limitations
481~~~~~~~~~~~
482- cindex:[limitations of Exim]
483Exim is designed for use as an Internet MTA, and therefore handles addresses
484in RFC 2822 domain format only.
485cindex:[bang paths,not handled by Exim]
486It cannot handle UUCP ``bang paths'', though simple two-component bang paths can
487be converted by a straightforward rewriting configuration. This restriction
488does not prevent Exim from being interfaced to UUCP as a transport mechanism,
489provided that domain addresses are used.
490
491- cindex:[domainless addresses]
492cindex:[address,without domain]
493Exim insists that every address it handles has a domain attached. For incoming
494local messages, domainless addresses are automatically qualified with a
495configured domain value. Configuration options specify from which remote
496systems unqualified addresses are acceptable. These are then qualified on
497arrival.
498
499- cindex:[transport,external]
500cindex:[external transports]
501The only external transport currently implemented is an SMTP transport over a
502TCP/IP network (using sockets, including support for IPv6). However, a pipe
503transport is available, and there are facilities for writing messages to files
504and pipes, optionally in 'batched SMTP' format; these facilities can be used
505to send messages to some other transport mechanism such as UUCP, provided it
506can handle domain-style addresses. Batched SMTP input is also catered for.
507
508- Exim is not designed for storing mail for dial-in hosts. When the volumes of
509such mail are large, it is better to get the messages ``delivered'' into files
510(that is, off Exim's queue) and subsequently passed on to the dial-in hosts by
511other means.
512
513- Although Exim does have basic facilities for scanning incoming messages, these
514are not comprehensive enough to do full virus or spam scanning. Such operations
515are best carried out using additional specialized software packages. If you
516compile Exim with the content-scanning extension, straightforward interfaces to
517a number of common scanners are provided.
518
519
520
521
522
523Run time configuration
524~~~~~~~~~~~~~~~~~~~~~~
525Exim's run time configuration is held in a single text file that is divided
526into a number of sections. The entries in this file consist of keywords and
527values, in the style of Smail 3 configuration files. A default configuration
528file which is suitable for simple online installations is provided in the
529distribution, and is described in chapter <<CHAPdefconfil>> below.
530
531
532
533Calling interface
534~~~~~~~~~~~~~~~~~
535cindex:[Sendmail compatibility,command line interface]
536Like many MTAs, Exim has adopted the Sendmail command line interface so that it
537can be a straight replacement for _/usr/lib/sendmail_ or
538_/usr/sbin/sendmail_ when sending mail, but you do not need to know anything
539about Sendmail in order to run Exim. For actions other than sending messages,
540Sendmail-compatible options also exist, but those that produce output (for
541example, %-bp%, which lists the messages on the queue) do so in Exim's own
542format. There are also some additional options that are compatible with Smail
5433, and some further options that are new to Exim. Chapter <<CHAPcommandline>>
544documents all Exim's command line options. This information is automatically
545made into the man page that forms part of the Exim distribution.
546
547Control of messages on the queue can be done via certain privileged command
548line options. There is also an optional monitor program called 'eximon', which
549displays current information in an X window, and which contains a menu
550interface to Exim's command line administration options.
551
552
553
554Terminology
555~~~~~~~~~~~
556cindex:[terminology definitions]
557cindex:[body of message,definition of]
558The 'body' of a message is the actual data that the sender wants to transmit.
559It is the last part of a message, and is separated from the 'header' (see
560below) by a blank line.
561
562cindex:[bounce message,definition of]
563When a message cannot be delivered, it is normally returned to the sender in a
564delivery failure message or a ``non-delivery report'' (NDR). The term 'bounce'
565is commonly used for this action, and the error reports are often called
566'bounce messages'. This is a convenient shorthand for ``delivery failure error
567report''. Such messages have an empty sender address in the message's
568'envelope' (see below) to ensure that they cannot themselves give rise to
569further bounce messages.
570
571The term 'default' appears frequently in this manual. It is used to qualify a
572value which is used in the absence of any setting in the configuration. It may
573also qualify an action which is taken unless a configuration setting specifies
574otherwise.
575
576The term 'defer' is used when the delivery of a message to a specific
577destination cannot immediately take place for some reason (a remote host may be
578down, or a user's local mailbox may be full). Such deliveries are 'deferred'
579until a later time.
580
581The word 'domain' is sometimes used to mean all but the first component of a
582host's name. It is 'not' used in that sense here, where it normally
583refers to the part of an email address following the @ sign.
584
585cindex:[envelope, definition of]
586cindex:[sender,definition of]
587A message in transit has an associated 'envelope', as well as a header and a
588body. The envelope contains a sender address (to which bounce messages should
589be delivered), and any number of recipient addresses. References to the
590sender or the recipients of a message usually mean the addresses in the
591envelope. An MTA uses these addresses for delivery, and for returning bounce
592messages, not the addresses that appear in the header lines.
593
594cindex:[message header, definition of]
595cindex:[header section,definition of]
596The 'header' of a message is the first part of a message's text, consisting
597of a number of lines, each of which has a name such as 'From:', 'To:',
598'Subject:', etc. Long header lines can be split over several text lines by
599indenting the continuations. The header is separated from the body by a blank
600line.
601
602cindex:[local part,definition of]
603cindex:[domain,definition of]
604The term 'local part', which is taken from RFC 2822, is used to refer to that
605part of an email address that precedes the @ sign. The part that follows the
606@ sign is called the 'domain' or 'mail domain'.
607
608cindex:[local delivery,definition of]
609cindex:[remote delivery, definition of]
610The terms 'local delivery' and 'remote delivery' are used to distinguish
611delivery to a file or a pipe on the local host from delivery by SMTP over
068aaea8
PH
612TCP/IP to another host. As far as Exim is concerned, all hosts other than the
613host it is running on are 'remote'.
168e428f
PH
614
615cindex:[return path,definition of]
616'Return path' is another name that is used for the sender address in a
617message's envelope.
618
619cindex:[queue,definition of]
620The term 'queue' is used to refer to the set of messages awaiting delivery,
621because this term is in widespread use in the context of MTAs. However, in
622Exim's case the reality is more like a pool than a queue, because there is
623normally no ordering of waiting messages.
624
625cindex:[queue runner,definition of]
626The term 'queue runner' is used to describe a process that scans the queue
627and attempts to deliver those messages whose retry times have come. This term
628is used by other MTAs, and also relates to the command %runq%, but in Exim
629the waiting messages are normally processed in an unpredictable order.
630
631cindex:[spool directory,definition of]
632The term 'spool directory' is used for a directory in which Exim keeps the
633messages on its queue -- that is, those that it is in the process of
634delivering. This should not be confused with the directory in which local
635mailboxes are stored, which is called a ``spool directory'' by some people. In
636the Exim documentation, ``spool'' is always used in the first sense.
637
638
639
640
641
642
643////////////////////////////////////////////////////////////////////////////
644////////////////////////////////////////////////////////////////////////////
645
646Incorporated code
647-----------------
648cindex:[incorporated code]
649cindex:[regular expressions,library]
650cindex:[PCRE]
651A number of pieces of external code are included in the Exim distribution.
652
653- Regular expressions are supported in the main Exim program and in the Exim
654monitor using the freely-distributable PCRE library, copyright (c) University
655of Cambridge. The source is distributed in the directory _src/pcre_. However,
656this is a cut-down version of PCRE. If you want to use the PCRE library in
657other programs, you should obtain and install the full version from
658*ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre[]*.
659
660- cindex:[cdb,acknowledgement]
661Support for the cdb (Constant DataBase) lookup method is provided by code
662contributed by Nigel Metheringham of (at the time he contributed it) Planet
663Online Ltd. which contains the following statements:
664+
068aaea8
PH
665++++++++++++++++++++++
666<blockquote>
667++++++++++++++++++++++
668+
168e428f
PH
669Copyright (c) 1998 Nigel Metheringham, Planet Online Ltd
670+
671This program is free software; you can redistribute it and/or modify it under
672the terms of the GNU General Public License as published by the Free Software
673Foundation; either version 2 of the License, or (at your option) any later
674version.
675+
676This code implements Dan Bernstein's Constant DataBase (cdb) spec. Information,
677the spec and sample code for cdb can be obtained from
678*http://www.pobox.com/{tl}djb/cdb.html[]*. This implementation borrows some code
679from Dan Bernstein's implementation (which has no license restrictions applied
680to it).
681+
068aaea8
PH
682++++++++++++++++++++++
683</blockquote>
684++++++++++++++++++++++
685+
168e428f
PH
686The implementation is completely contained within the code of Exim.
687It does not link against an external cdb library.
688
689- cindex:[SPA authentication]
690cindex:[Samba project]
691cindex:[Microsoft Secure Password Authentication]
692Client support for Microsoft's 'Secure Password Authentication' is provided
693by code contributed by Marc Prud'hommeaux. Server support was contributed by
694Tom Kistner. This includes code taken from the Samba project, which is released
695under the Gnu GPL.
696
697- cindex:[Cyrus]
698cindex:['pwcheck' daemon]
699cindex:['pwauthd' daemon]
700Support for calling the Cyrus 'pwcheck' and 'saslauthd' daemons is provided
701by code taken from the Cyrus-SASL library and adapted by Alexander S.
702Sabourenkov. The permission notice appears below, in accordance with the
703conditions expressed therein.
704+
068aaea8
PH
705++++++++++++++++++++++
706<blockquote>
707++++++++++++++++++++++
708+
168e428f
PH
709Copyright (c) 2001 Carnegie Mellon University. All rights reserved.
710+
711Redistribution and use in source and binary forms, with or without
712modification, are permitted provided that the following conditions
713are met:
714+
715. Redistributions of source code must retain the above copyright
716notice, this list of conditions and the following disclaimer.
717
718. Redistributions in binary form must reproduce the above copyright
719notice, this list of conditions and the following disclaimer in
720the documentation and/or other materials provided with the
721distribution.
722
723. The name ``Carnegie Mellon University'' must not be used to
724endorse or promote products derived from this software without
725prior written permission. For permission or any other legal
726details, please contact
727+
728&&&
068aaea8
PH
729 Office of Technology Transfer
730 Carnegie Mellon University
731 5000 Forbes Avenue
732 Pittsburgh, PA 15213-3890
733 (412) 268-4387, fax: (412) 268-7395
734 tech-transfer@andrew.cmu.edu
168e428f 735&&&
068aaea8
PH
736///
737The need to indent that block explicitly is a pain.
738///
168e428f
PH
739
740. Redistributions of any form whatsoever must retain the following
741acknowledgment:
742+
068aaea8
PH
743``This product includes software developed by Computing Services
744at Carnegie Mellon University (*http://www.cmu.edu/computing/[]*).''
168e428f
PH
745+
746CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
747THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
748AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
749FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
750WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
751AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
752OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
753
068aaea8
PH
754///
755Note, no "+" line there, because we want to terminate the inner list item
756before ending the block quote.
757///
758+
759++++++++++++++++++++++
760</blockquote>
761++++++++++++++++++++++
762
763- cindex:[Exim monitor,acknowledgement]
168e428f
PH
764cindex:[X-windows]
765cindex:[Athena]
766The Exim Monitor program, which is an X-Window application, includes
767modified versions of the Athena StripChart and TextPop widgets.
768This code is copyright by DEC and MIT, and their permission notice appears
769below, in accordance with the conditions expressed therein.
770+
068aaea8
PH
771++++++++++++++++++++++
772<blockquote>
773++++++++++++++++++++++
774+
168e428f
PH
775Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
776and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
777+
778All Rights Reserved
779+
780Permission to use, copy, modify, and distribute this software and its
781documentation for any purpose and without fee is hereby granted,
782provided that the above copyright notice appear in all copies and that
783both that copyright notice and this permission notice appear in
784supporting documentation, and that the names of Digital or MIT not be
785used in advertising or publicity pertaining to distribution of the
786software without specific, written prior permission.
787+
788DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
789ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
790DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
791ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
792WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
793ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
794SOFTWARE.
068aaea8
PH
795+
796++++++++++++++++++++++
797</blockquote>
798++++++++++++++++++++++
168e428f 799
068aaea8 800- Many people have contributed code fragments, some large, some small, that were
168e428f
PH
801not covered by any specific licence requirements. It is assumed that the
802contributors are happy to see their code incoporated into Exim under the GPL.
803
804
805
806
807
808////////////////////////////////////////////////////////////////////////////
809////////////////////////////////////////////////////////////////////////////
810
811[titleabbrev="Receiving and delivering mail"]
812How Exim receives and delivers mail
813-----------------------------------
814
815
816Overall philosophy
817~~~~~~~~~~~~~~~~~~
818cindex:[design philosophy]
819Exim is designed to work efficiently on systems that are permanently connected
820to the Internet and are handling a general mix of mail. In such circumstances,
821most messages can be delivered immediately. Consequently, Exim does not
822maintain independent queues of messages for specific domains or hosts, though
823it does try to send several messages in a single SMTP connection after a host
824has been down, and it also maintains per-host retry information.
825
826
827
828Policy control
829~~~~~~~~~~~~~~
830cindex:[policy control,overview]
831Policy controls are now an important feature of MTAs that are connected to the
832Internet. Perhaps their most important job is to stop MTAs being abused as
833``open relays'' by misguided individuals who send out vast amounts of unsolicited
834junk, and want to disguise its source. Exim provides flexible facilities for
835specifying policy controls on incoming mail:
836
837- cindex:[{ACL},introduction]
838Exim 4 (unlike previous versions of Exim) implements policy controls on
839incoming mail by means of 'Access Control Lists' (ACLs). Each list is a
840series of statements that may either grant or deny access. ACLs can be used at
841several places in the SMTP dialogue while receiving a message from a remote
842host. However, the most common places are after each RCPT command, and at
843the very end of the message. The sysadmin can specify conditions for accepting
844or rejecting individual recipients or the entire message, respectively, at
845these two points (see chapter <<CHAPACL>>). Denial of access results in an SMTP
846error code.
847
848- An ACL is also available for locally generated, non-SMTP messages. In this
849case, the only available actions are to accept or deny the entire message.
850
851- When Exim is compiled with the content-scanning extension, facilities are
852provided in the ACL mechanism for passing the message to external virus and/or
853spam scanning software. The result of such a scan is passed back to the ACL,
854which can then use it to decide what to do with the message.
855
856- When a message has been received, either from a remote host or from the local
857host, but before the final acknowledgement has been sent, a locally supplied C
858function called 'local_scan()' can be run to inspect the message and decide
859whether to accept it or not (see chapter <<CHAPlocalscan>>). If the message is
860accepted, the list of recipients can be modified by the function.
861
862- Using the 'local_scan()' mechanism is another way of calling external
863scanner software. The %SA-Exim% add-on package works this way. It does not
864require Exim to be compiled with the content-scanning extension.
865
866- After a message has been accepted, a further checking mechanism is available in
867the form of the 'system filter' (see chapter <<CHAPsystemfilter>>). This runs
868at the start of every delivery process.
869
870
871
872User filters
873~~~~~~~~~~~~
874cindex:[filter,introduction]
875cindex:[Sieve filter]
876In a conventional Exim configuration, users are able to run private filters by
877setting up appropriate _.forward_ files in their home directories. See
878chapter <<CHAPredirect>> (about the ^redirect^ router) for the configuration
879needed to support this, and the separate document entitled 'Exim's interfaces
880to mail filtering' for user details. Two different kinds of filtering are
881available:
882
883- Sieve filters are written in the standard filtering language that is defined
884by RFC 3028.
885
886- Exim filters are written in a syntax that is unique to Exim, but which is more
887powerful than Sieve, which it pre-dates.
888
889User filters are run as part of the routing process, described below.
890
891
892
893[[SECTmessiden]]
894Message identification
895~~~~~~~~~~~~~~~~~~~~~~
896cindex:[message ids, details of format]
897cindex:[format,of message id]
898cindex:[id of message]
899cindex:[base62]
900cindex:[base36]
901cindex:[Darwin]
902cindex:[Cygwin]
903Every message handled by Exim is given a 'message id' which is sixteen
904characters long. It is divided into three parts, separated by hyphens, for
905example `16VDhn-0001bo-D3`. Each part is a sequence of letters and digits,
906normally encoding numbers in base 62. However, in the Darwin operating
907system (Mac OS X) and when Exim is compiled to run under Cygwin, base 36
908(avoiding the use of lower case letters) is used instead, because the message
909id is used to construct file names, and the names of files in those systems are
068aaea8 910not always case-sensitive.
168e428f
PH
911
912cindex:[pid (process id),re-use of]
913The detail of the contents of the message id have changed as Exim has evolved.
914Earlier versions relied on the operating system not re-using a process id (pid)
915within one second. On modern operating systems, this assumption can no longer
916be made, so the algorithm had to be changed. To retain backward compatibility,
917the format of the message id was retained, which is why the following rules are
918somewhat eccentric:
919
920- The first six characters of the message id are the time at which the message
921started to be received, to a granularity of one second. That is, this field
922contains the number of seconds since the start of the epoch (the normal Unix
923way of representing the date and time of day).
924
925- After the first hyphen, the next six characters are the id of the process that
926received the message.
927
928- There are two different possibilities for the final two characters:
929
930. cindex:[%localhost_number%]
931If %localhost_number% is not set, this value is the fractional part of the
932time of reception, normally in units of 1/2000 of a second, but for systems
933that must use base 36 instead of base 62 (because of case-insensitive file
934systems), the units are 1/1000 of a second.
935
936. If %localhost_number% is set, it is multiplied by 200 (100) and added to
937the fractional part of the time, which in this case is in units of 1/200
938(1/100) of a second.
939
940After a message has been received, Exim waits for the clock to tick at the
941appropriate resolution before proceeding, so that if another message is
942received by the same process, or by another process with the same (re-used)
943pid, it is guaranteed that the time will be different. In most cases, the clock
944will already have ticked while the message was being received.
945
946
947Receiving mail
948~~~~~~~~~~~~~~
949cindex:[receiving mail]
950cindex:[message,reception]
068aaea8
PH
951The only way Exim can receive mail from another host is using SMTP over
952TCP/IP, in which case the sender and recipient addresses are transferred using
168e428f
PH
953SMTP commands. However, from a locally running process (such as a user's MUA),
954there are several possibilities:
955
956- If the process runs Exim with the %-bm% option, the message is read
957non-interactively (usually via a pipe), with the recipients taken from the
958command line, or from the body of the message if %-t% is also used.
959
960- If the process runs Exim with the %-bS% option, the message is also read
961non-interactively, but in this case the recipients are listed at the start of
962the message in a series of SMTP RCPT commands, terminated by a DATA
963command. This is so-called ``batch SMTP'' format,
964but it isn't really SMTP. The SMTP commands are just another way of passing
965envelope addresses in a non-interactive submission.
966
967- If the process runs Exim with the %-bs% option, the message is read
968interactively, using the SMTP protocol. A two-way pipe is normally used for
969passing data between the local process and the Exim process.
970This is ``real'' SMTP and is handled in the same way as SMTP over TCP/IP. For
971example, the ACLs for SMTP commands are used for this form of submission.
972
973- A local process may also make a TCP/IP call to the host's loopback address
974(127.0.0.1) or any other of its IP addresses. When receiving messages, Exim
975does not treat the loopback address specially. It treats all such connections
976in the same way as connections from other hosts.
977
978
979cindex:[message sender, constructed by Exim]
980cindex:[sender,constructed by Exim]
981In the three cases that do not involve TCP/IP, the sender address is
982constructed from the login name of the user that called Exim and a default
983qualification domain (which can be set by the %qualify_domain% configuration
984option). For local or batch SMTP, a sender address that is passed using the
985SMTP MAIL command is ignored. However, the system administrator may allow
986certain users (``trusted users'') to specify a different sender address
987unconditionally, or all users to specify certain forms of different sender
988address. The %-f% option or the SMTP MAIL command is used to specify these
989different addresses. See section <<SECTtrustedadmin>> for details of trusted
990users, and the %untrusted_set_sender% option for a way of allowing untrusted
991users to change sender addresses.
992
993Messages received by either of the non-interactive mechanisms are subject to
994checking by the non-SMTP ACL, if one is defined. Messages received using SMTP
995(either over TCP/IP, or interacting with a local process) can be checked by a
996number of ACLs that operate at different times during the SMTP session. Either
997individual recipients, or the entire message, can be rejected if local policy
998requirements are not met. The 'local_scan()' function (see chapter
999<<CHAPlocalscan>>) is run for all incoming messages.
1000
1001Exim can be configured not to start a delivery process when a message is
1002received; this can be unconditional, or depend on the number of incoming SMTP
1003connections or the system load. In these situations, new messages wait on the
1004queue until a queue runner process picks them up. However, in standard
1005configurations under normal conditions, delivery is started as soon as a
1006message is received.
1007
1008
1009
1010
1011
1012Handling an incoming message
1013~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1014cindex:[spool directory,files that hold a message]
1015cindex:[file,how a message is held]
1016When Exim accepts a message, it writes two files in its spool directory. The
1017first contains the envelope information, the current status of the message, and
1018the header lines, and the second contains the body of the message. The names of
1019the two spool files consist of the message id, followed by `-H` for the
1020file containing the envelope and header, and `-D` for the data file.
1021
1022cindex:[spool directory,_input_ sub-directory]
1023By default all these message files are held in a single directory called
1024_input_ inside the general Exim spool directory. Some operating systems do
1025not perform very well if the number of files in a directory gets very large; to
1026improve performance in such cases, the %split_spool_directory% option can be
1027used. This causes Exim to split up the input files into 62 sub-directories
1028whose names are single letters or digits.
1029
1030The envelope information consists of the address of the message's sender and
1031the addresses of the recipients. This information is entirely separate from
1032any addresses contained in the header lines. The status of the message includes
1033a list of recipients who have already received the message. The format of the
1034first spool file is described in chapter <<CHAPspool>>.
1035
1036cindex:[rewriting,addresses]
1037Address rewriting that is specified in the rewrite section of the configuration
1038(see chapter <<CHAPrewrite>>) is done once and for all on incoming addresses,
1039both in the header lines and the envelope, at the time the message is accepted.
1040If during the course of delivery additional addresses are generated (for
1041example, via aliasing), these new addresses are rewritten as soon as they are
1042generated. At the time a message is actually delivered (transported) further
1043rewriting can take place; because this is a transport option, it can be
1044different for different forms of delivery. It is also possible to specify the
1045addition or removal of certain header lines at the time the message is
1046delivered (see chapters <<CHAProutergeneric>> and <<CHAPtransportgeneric>>).
1047
1048
1049
1050Life of a message
1051~~~~~~~~~~~~~~~~~
1052cindex:[message,life of]
1053cindex:[message,frozen]
1054A message remains in the spool directory until it is completely delivered to
1055its recipients or to an error address, or until it is deleted by an
1056administrator or by the user who originally created it. In cases when delivery
1057cannot proceed -- for example, when a message can neither be delivered to its
1058recipients nor returned to its sender, the message is marked ``frozen'' on the
1059spool, and no more deliveries are attempted.
1060
1061cindex:[frozen messages,thawing]
1062cindex:[message,thawing frozen]
1063An administrator can ``thaw'' such messages when the problem has been corrected,
1064and can also freeze individual messages by hand if necessary. In addition, an
1065administrator can force a delivery error, causing a bounce message to be sent.
1066
068aaea8 1067[revisionflag="changed"]
168e428f 1068cindex:[%timeout_frozen_after%]
068aaea8
PH
1069cindex:[%ignore_bounce_errors_after%]
1070There are options called %ignore_bounce_errors_after% and
1071%timeout_frozen_after%, which discard frozen messages after a certain time.
1072The first applies only to frozen bounces, the second to any frozen messages.
168e428f
PH
1073
1074cindex:[message,log file for]
1075cindex:[log,file for each message]
1076While Exim is working on a message, it writes information about each delivery
068aaea8 1077attempt to its main log file. This includes successful, unsuccessful, and
168e428f
PH
1078delayed deliveries for each recipient (see chapter <<CHAPlog>>). The log lines
1079are also written to a separate 'message log' file for each message. These
1080logs are solely for the benefit of the administrator, and are normally deleted
1081along with the spool files when processing of a message is complete.
1082The use of individual message logs can be disabled by setting
1083%no_message_logs%; this might give an improvement in performance on very
1084busy systems.
1085
1086cindex:[journal file]
1087cindex:[file,journal]
1088All the information Exim itself needs to set up a delivery is kept in the first
1089spool file, along with the header lines. When a successful delivery occurs, the
1090address is immediately written at the end of a journal file, whose name is the
1091message id followed by `-J`. At the end of a delivery run, if there are some
1092addresses left to be tried again later, the first spool file (the `-H` file)
1093is updated to indicate which these are, and the journal file is then deleted.
1094Updating the spool file is done by writing a new file and renaming it, to
1095minimize the possibility of data loss.
1096
1097Should the system or the program crash after a successful delivery but before
1098the spool file has been updated, the journal is left lying around. The next
1099time Exim attempts to deliver the message, it reads the journal file and
1100updates the spool file before proceeding. This minimizes the chances of double
1101deliveries caused by crashes.
1102
1103
1104
1105[[SECTprocaddress]]
1106Processing an address for delivery
1107~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1108cindex:[drivers,definition of]
1109cindex:[router,definition of]
1110cindex:[transport,definition of]
1111The main delivery processing elements of Exim are called 'routers' and
1112'transports', and collectively these are known as 'drivers'. Code for a
1113number of them is provided in the source distribution, and compile-time options
1114specify which ones are included in the binary. Run time options specify which
1115ones are actually used for delivering messages.
1116
1117cindex:[drivers,instance definition]
1118Each driver that is specified in the run time configuration is an 'instance'
1119of that particular driver type. Multiple instances are allowed; for example,
1120you can set up several different ^smtp^ transports, each with different
1121option values that might specify different ports or different timeouts. Each
1122instance has its own identifying name. In what follows we will normally use the
1123instance name when discussing one particular instance (that is, one specific
1124configuration of the driver), and the generic driver name when discussing
1125the driver's features in general.
1126
1127A 'router' is a driver that operates on an address, either determining how
068aaea8 1128its delivery should happen, by assigning it to a specific transport, or
168e428f
PH
1129converting the address into one or more new addresses (for example, via an
1130alias file). A router may also explicitly choose to fail an address, causing it
1131to be bounced.
1132
1133A 'transport' is a driver that transmits a copy of the message from Exim's
1134spool to some destination. There are two kinds of transport: for a 'local'
1135transport, the destination is a file or a pipe on the local host, whereas for a
1136'remote' transport the destination is some other host. A message is passed
1137to a specific transport as a result of successful routing. If a message has
1138several recipients, it may be passed to a number of different transports.
1139
1140cindex:[preconditions,definition of]
1141An address is processed by passing it to each configured router instance in
1142turn, subject to certain preconditions, until a router accepts the address or
1143specifies that it should be bounced. We will describe this process in more
068aaea8
PH
1144detail shortly. First, as a simple example, we consider how each recipient
1145address in a message is processed in a small configuration of three routers.
168e428f 1146
068aaea8 1147To make this a more concrete example, it is described in terms of some actual
168e428f
PH
1148routers, but remember, this is only an example. You can configure Exim's
1149routers in many different ways, and there may be any number of routers in a
1150configuration.
1151
1152The first router that is specified in a configuration is often one that handles
1153addresses in domains that are not recognized specially by the local host. These
1154are typically addresses for arbitrary domains on the Internet. A precondition
1155is set up which looks for the special domains known to the host (for example,
1156its own domain name), and the router is run for addresses that do 'not'
1157match. Typically, this is a router that looks up domains in the DNS in order to
1158find the hosts to which this address routes. If it succeeds, the address is
068aaea8 1159assigned to a suitable SMTP transport; if it does not succeed, the router is
168e428f
PH
1160configured to fail the address.
1161
068aaea8
PH
1162The second router is reached only when the domain is recognized as one that
1163``belongs'' to the local host. This router does redirection -- also known as
1164aliasing and forwarding. When it generates one or more new addresses from the
1165original, each of them is routed independently from the start. Otherwise, the
1166router may cause an address to fail, or it may simply decline to handle the
1167address, in which case the address is passed to the next router.
168e428f
PH
1168
1169The final router in many configurations is one that checks to see if the
1170address belongs to a local mailbox. The precondition may involve a check to
1171see if the local part is the name of a login account, or it may look up the
1172local part in a file or a database. If its preconditions are not met, or if
1173the router declines, we have reached the end of the routers. When this happens,
1174the address is bounced.
1175
1176
1177
1178Processing an address for verification
1179~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1180cindex:[router,for verification]
1181cindex:[verifying address, overview]
1182As well as being used to decide how to deliver to an address, Exim's routers
1183are also used for 'address verification'. Verification can be requested as
1184one of the checks to be performed in an ACL for incoming messages, on both
1185sender and recipient addresses, and it can be tested using the %-bv% and
1186%-bvs% command line options.
1187
1188When an address is being verified, the routers are run in ``verify mode''. This
1189does not affect the way the routers work, but it is a state that can be
1190detected. By this means, a router can be skipped or made to behave differently
1191when verifying. A common example is a configuration in which the first router
1192sends all messages to a message-scanning program, unless they have been
1193previously scanned. Thus, the first router accepts all addresses without any
1194checking, making it useless for verifying. Normally, the %no_verify% option
1195would be set for such a router, causing it to be skipped in verify mode.
1196
1197
1198
1199
1200[[SECTrunindrou]]
1201Running an individual router
1202~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1203cindex:[router,running details]
1204cindex:[preconditions,checking]
1205cindex:[router,result of running]
1206As explained in the example above, a number of preconditions are checked before
1207running a router. If any are not met, the router is skipped, and the address is
1208passed to the next router. When all the preconditions on a router 'are' met,
1209the router is run. What happens next depends on the outcome, which is one of
1210the following:
1211
068aaea8 1212- 'accept': The router accepts the address, and either assigns it to a
168e428f
PH
1213transport, or generates one or more ``child'' addresses. Processing the original
1214address ceases,
1215cindex:[%unseen% option]
1216unless the %unseen% option is set on the router. This option
1217can be used to set up multiple deliveries with different routing (for example,
1218for keeping archive copies of messages). When %unseen% is set, the address is
1219passed to the next router. Normally, however, an 'accept' return marks the
1220end of routing.
1221+
068aaea8
PH
1222Any child addresses generated by the router are processed independently,
1223starting with the first router by default. It is possible to change this by
1224setting the %redirect_router% option to specify which router to start at for
1225child addresses. Unlike %pass_router% (see below) the router specified by
168e428f
PH
1226%redirect_router% may be anywhere in the router configuration.
1227
1228- 'pass': The router recognizes the address, but cannot handle it itself. It
1229requests that the address be passed to another router. By default the address
1230is passed to the next router, but this can be changed by setting the
1231%pass_router% option. However, (unlike %redirect_router%) the named router
1232must be below the current router (to avoid loops).
1233
1234- 'decline': The router declines to accept the address because it does not
1235recognize it at all. By default, the address is passed to the next router, but
1236this can be prevented by setting the %no_more% option. When %no_more% is set,
068aaea8
PH
1237all the remaining routers are skipped. In effect, %no_more% converts 'decline'
1238into 'fail'.
168e428f
PH
1239
1240- 'fail': The router determines that the address should fail, and queues it for
1241the generation of a bounce message. There is no further processing of the
1242original address unless %unseen% is set on the router.
1243
068aaea8
PH
1244- 'defer': The router cannot handle the address at the present time. (A
1245database may be offline, or a DNS lookup may have timed out.) No further
1246processing of the address happens in this delivery attempt. It is tried again
1247next time the message is considered for delivery.
168e428f
PH
1248
1249- 'error': There is some error in the router (for example, a syntax error in
1250its configuration). The action is as for defer.
1251
1252If an address reaches the end of the routers without having been accepted by
068aaea8
PH
1253any of them, it is bounced as unrouteable. The default error message in this
1254situation is ``unrouteable address'', but you can set your own message by
1255making use of the %cannot_route_message% option. This can be set for any
1256router; the value from the last router that ``saw'' the address is used.
168e428f
PH
1257
1258Sometimes while routing you want to fail a delivery when some conditions are
1259met but others are not, instead of passing the address on for further routing.
1260You can do this by having a second router that explicitly fails the delivery
1261when the relevant conditions are met. The ^redirect^ router has a ``fail''
1262facility for this purpose.
1263
1264
068aaea8
PH
1265Duplicate addresses
1266~~~~~~~~~~~~~~~~~~~
1267
1268[revisionflag="changed"]
1269cindex:[case of local parts]
1270cindex:[address duplicate, discarding]
1271Once routing is complete, Exim scans the addresses that are assigned to local
1272and remote transports, and discards any duplicates that it finds. During this
1273check, local parts are treated as case-sensitive.
1274
168e428f
PH
1275
1276
1277[[SECTrouprecon]]
1278Router preconditions
1279~~~~~~~~~~~~~~~~~~~~
1280cindex:[router preconditions, order of processing]
1281cindex:[preconditions,order of processing]
1282The preconditions that are tested for each router are listed below, in the
1283order in which they are tested. The individual configuration options are
1284described in more detail in chapter <<CHAProutergeneric>>.
1285
1286- The %local_part_prefix% and %local_part_suffix% options can specify that
1287the local parts handled by the router may or must have certain prefixes and/or
1288suffixes. If a mandatory affix (prefix or suffix) is not present, the router is
1289skipped. These conditions are tested first. When an affix is present, it is
1290removed from the local part before further processing, including the evaluation
1291of any other conditions.
1292
1293- Routers can be designated for use only when not verifying an address, that is,
1294only when routing it for delivery (or testing its delivery routing). If the
1295%verify% option is set false, the router is skipped when Exim is verifying an
1296address.
1297Setting the %verify% option actually sets two options, %verify_sender% and
1298%verify_recipient%, which independently control the use of the router for
1299sender and recipient verification. You can set these options directly if
1300you want a router to be used for only one type of verification.
1301
1302- If the %address_test% option is set false, the router is skipped when Exim is
1303run with the %-bt% option to test an address routing. This can be helpful when
1304the first router sends all new messages to a scanner of some sort; it makes it
1305possible to use %-bt% to test subsequent delivery routing without having to
1306simulate the effect of the scanner.
1307
1308- Routers can be designated for use only when verifying an address, as
1309opposed to routing it for delivery. The %verify_only% option controls this.
1310
068aaea8
PH
1311- Individual routers can be explicitly skipped when running the routers to
1312check an address given in the SMTP EXPN command (see the %expn% option).
168e428f 1313
068aaea8
PH
1314- If the %domains% option is set, the domain of the address must be in the set
1315of domains that it defines.
168e428f 1316
068aaea8
PH
1317- cindex:[$local_part_prefix$]
1318cindex:[$local_part$]
1319cindex:[$local_part_suffix$]
1320If the %local_parts% option is set, the local part of the address must be in
168e428f
PH
1321the set of local parts that it defines. If %local_part_prefix% or
1322%local_part_suffix% is in use, the prefix or suffix is removed from the local
1323part before this check. If you want to do precondition tests on local parts
1324that include affixes, you can do so by using a %condition% option (see below)
1325that uses the variables $local_part$, $local_part_prefix$, and
1326$local_part_suffix$ as necessary.
1327
068aaea8
PH
1328- cindex:[$local_user_uid$]
1329cindex:[$local_user_gid$]
1330cindex:[$home$]
1331If the %check_local_user% option is set, the local part must be the name of
1332an account on the local host. If this check succeeds, the uid and gid of the
1333local user are placed in $local_user_uid$ and $local_user_gid$ and the user's
1334home directory is placed in $home$; these values can be used in the remaining
1335preconditions.
168e428f
PH
1336
1337- If the %router_home_directory% option is set, it is expanded at this point,
1338because it overrides the value of $home$. If this expansion were left till
1339later, the value of $home$ as set by %check_local_user% would be used in
1340subsequent tests. Having two different values of $home$ in the same router
1341could lead to confusion.
1342
1343- If the %senders% option is set, the envelope sender address must be in the set
1344of addresses that it defines.
1345
1346- If the %require_files% option is set, the existence or non-existence of
1347specified files is tested.
1348
1349- cindex:[customizing,precondition]
1350If the %condition% option is set, it is evaluated and tested. This option uses
1351an expanded string to allow you to set up your own custom preconditions.
1352Expanded strings are described in chapter <<CHAPexpand>>.
1353
1354
1355Note that %require_files% comes near the end of the list, so you cannot use it
1356to check for the existence of a file in which to lookup up a domain, local
1357part, or sender. However, as these options are all expanded, you can use the
1358%exists% expansion condition to make such tests within each condition. The
1359%require_files% option is intended for checking files that the router may be
1360going to use internally, or which are needed by a specific transport (for
1361example, _.procmailrc_).
1362
1363
1364
1365Delivery in detail
1366~~~~~~~~~~~~~~~~~~
1367cindex:[delivery,in detail]
1368When a message is to be delivered, the sequence of events is as follows:
1369
1370- If a system-wide filter file is specified, the message is passed to it. The
1371filter may add recipients to the message, replace the recipients, discard the
1372message, cause a new message to be generated, or cause the message delivery to
1373fail. The format of the system filter file is the same as for Exim user filter
1374files, described in the separate document entitled
1375'Exim's interfaces to mail filtering'.
1376cindex:[Sieve filter,not available for system filter]
1377(*Note*: Sieve cannot be used for system filter files.)
1378+
1379Some additional features are available in system filters -- see chapter
1380<<CHAPsystemfilter>> for details. Note that a message is passed to the system
1381filter only once per delivery attempt, however many recipients it has. However,
1382if there are several delivery attempts because one or more addresses could not
1383be immediately delivered, the system filter is run each time. The filter
1384condition %first_delivery% can be used to detect the first run of the system
1385filter.
1386
1387- Each recipient address is offered to each configured router in turn, subject
1388to its preconditions, until one is able to handle it. If no router can handle
1389the address, that is, if they all decline, the address is failed. Because
1390routers can be targeted at particular domains, several locally handled domains
1391can be processed entirely independently of each other.
1392
1393- cindex:[routing,loops in]
1394cindex:[loop,while routing]
068aaea8
PH
1395A router that accepts an address may assign it to a local or a remote transport. However, the transport is not run at this time. Instead, the address is
1396placed on a list for the particular transport, which will be run later.
1397Alternatively, the router may generate one or more new addresses (typically
1398from alias, forward, or filter files). New addresses are fed back into this
1399process from the top, but in order to avoid loops, a router ignores any address
1400which has an identically-named ancestor that was processed by itself.
168e428f
PH
1401
1402- When all the routing has been done, addresses that have been successfully
1403handled are passed to their assigned transports. When local transports are
1404doing real local deliveries, they handle only one address at a time, but if a
1405local transport is being used as a pseudo-remote transport (for example, to
1406collect batched SMTP messages for transmission by some other means) multiple
1407addresses can be handled. Remote transports can always handle more than one
1408address at a time, but can be configured not to do so, or to restrict multiple
1409addresses to the same domain.
1410
1411- Each local delivery to a file or a pipe runs in a separate process under a
1412non-privileged uid, and these deliveries are run one at a time. Remote
1413deliveries also run in separate processes, normally under a uid that is private
1414to Exim (``the Exim user''), but in this case, several remote deliveries can be
1415run in parallel. The maximum number of simultaneous remote deliveries for any
1416one message is set by the %remote_max_parallel% option.
1417The order in which deliveries are done is not defined, except that all local
1418deliveries happen before any remote deliveries.
1419
1420- cindex:[queue runner]
1421When it encounters a local delivery during a queue run, Exim checks its retry
1422database to see if there has been a previous temporary delivery failure for the
1423address before running the local transport. If there was a previous failure,
1424Exim does not attempt a new delivery until the retry time for the address is
1425reached. However, this happens only for delivery attempts that are part of a
1426queue run. Local deliveries are always attempted when delivery immediately
1427follows message reception, even if retry times are set for them. This makes for
1428better behaviour if one particular message is causing problems (for example,
1429causing quota overflow, or provoking an error in a filter file).
1430
1431- cindex:[delivery,retry in remote transports]
1432Remote transports do their own retry handling, since an address may be
1433deliverable to one of a number of hosts, each of which may have a different
1434retry time. If there have been previous temporary failures and no host has
1435reached its retry time, no delivery is attempted, whether in a queue run or
1436not. See chapter <<CHAPretry>> for details of retry strategies.
1437
1438- If there were any permanent errors, a bounce message is returned to an
1439appropriate address (the sender in the common case), with details of the error
1440for each failing address. Exim can be configured to send copies of bounce
1441messages to other addresses.
1442
1443- cindex:[delivery,deferral]
1444If one or more addresses suffered a temporary failure, the message is left on
1445the queue, to be tried again later. Delivery of these addresses is said to be
1446'deferred'.
1447
1448- When all the recipient addresses have either been delivered or bounced,
1449handling of the message is complete. The spool files and message log are
1450deleted, though the message log can optionally be preserved if required.
1451
1452
1453
1454
1455Retry mechanism
1456~~~~~~~~~~~~~~~
1457cindex:[delivery,retry mechanism]
1458cindex:[retry,description of mechanism]
1459cindex:[queue runner]
1460Exim's mechanism for retrying messages that fail to get delivered at the first
1461attempt is the queue runner process. You must either run an Exim daemon that
1462uses the %-q% option with a time interval to start queue runners at regular
1463intervals, or use some other means (such as 'cron') to start them. If you do
1464not arrange for queue runners to be run, messages that fail temporarily at the
1465first attempt will remain on your queue for ever. A queue runner process works
068aaea8 1466its way through the queue, one message at a time, trying each delivery that has
168e428f
PH
1467passed its retry time.
1468You can run several queue runners at once.
1469
1470Exim uses a set of configured rules to determine when next to retry the failing
1471address (see chapter <<CHAPretry>>). These rules also specify when Exim should
1472give up trying to deliver to the address, at which point it generates a bounce
1473message. If no retry rules are set for a particular host, address, and error
1474combination, no retries are attempted, and temporary errors are treated as
1475permanent.
1476
1477
1478
1479Temporary delivery failure
1480~~~~~~~~~~~~~~~~~~~~~~~~~~
1481cindex:[delivery,temporary failure]
1482There are many reasons why a message may not be immediately deliverable to a
1483particular address. Failure to connect to a remote machine (because it, or the
1484connection to it, is down) is one of the most common. Temporary failures may be
1485detected during routing as well as during the transport stage of delivery.
1486Local deliveries may be delayed if NFS files are unavailable, or if a mailbox
1487is on a file system where the user is over quota. Exim can be configured to
1488impose its own quotas on local mailboxes; where system quotas are set they will
1489also apply.
1490
1491If a host is unreachable for a period of time, a number of messages may be
1492waiting for it by the time it recovers, and sending them in a single SMTP
1493connection is clearly beneficial. Whenever a delivery to a remote host is
1494deferred,
1495
1496cindex:[hints database]
1497Exim makes a note in its hints database, and whenever a successful
1498SMTP delivery has happened, it looks to see if any other messages are waiting
1499for the same host. If any are found, they are sent over the same SMTP
1500connection, subject to a configuration limit as to the maximum number in any
1501one connection.
1502
1503
1504
1505
1506Permanent delivery failure
1507~~~~~~~~~~~~~~~~~~~~~~~~~~
1508cindex:[delivery,permanent failure]
1509cindex:[bounce message,when generated]
1510When a message cannot be delivered to some or all of its intended recipients, a
1511bounce message is generated. Temporary delivery failures turn into permanent
1512errors when their timeout expires. All the addresses that fail in a given
1513delivery attempt are listed in a single message. If the original message has
1514many recipients, it is possible for some addresses to fail in one delivery
1515attempt and others to fail subsequently, giving rise to more than one bounce
1516message. The wording of bounce messages can be customized by the administrator.
1517See chapter <<CHAPemsgcust>> for details.
1518
1519cindex:['X-Failed-Recipients:' header line]
1520Bounce messages contain an 'X-Failed-Recipients:' header line that lists the
1521failed addresses, for the benefit of programs that try to analyse such messages
1522automatically.
1523
1524cindex:[bounce message,recipient of]
1525A bounce message is normally sent to the sender of the original message, as
1526obtained from the message's envelope. For incoming SMTP messages, this is the
1527address given in the MAIL command. However, when an address is
1528expanded via a forward or alias file, an alternative address can be specified
1529for delivery failures of the generated addresses. For a mailing list expansion
1530(see section <<SECTmailinglists>>) it is common to direct bounce messages to the
1531manager of the list.
1532
1533
1534
1535
1536Failures to deliver bounce messages
1537~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1538cindex:[bounce message,failure to deliver]
1539If a bounce message (either locally generated or received from a remote host)
1540itself suffers a permanent delivery failure, the message is left on the queue,
1541but it is frozen, awaiting the attention of an administrator. There are options
068aaea8 1542that can be used to make Exim discard such failed messages, or to keep them
168e428f
PH
1543for only a short time (see %timeout_frozen_after% and
1544%ignore_bounce_errors_after%).
1545
1546
1547
1548
1549
1550////////////////////////////////////////////////////////////////////////////
1551////////////////////////////////////////////////////////////////////////////
1552
1553Building and installing Exim
1554----------------------------
1555
1556cindex:[building Exim]
1557
1558Unpacking
1559~~~~~~~~~
1560Exim is distributed as a gzipped or bzipped tar file which, when upacked,
1561creates a directory with the name of the current release (for example,
1562_exim-{version}_) into which the following files are placed:
1563
1564[frame="none"]
1565`--------------------`--------------------------------------------------------
1566_ACKNOWLEDGMENTS_ contains some acknowledgments
1567_CHANGES_ contains a reference to where changes are documented
1568_LICENCE_ the GNU General Public Licence
1569_Makefile_ top-level make file
1570_NOTICE_ conditions for the use of Exim
1571_README_ list of files, directories and simple build instructions
1572------------------------------------------------------------------------------
1573
1574Other files whose names begin with _README_ may also be present. The
1575following subdirectories are created:
1576
1577[frame="none"]
1578`--------------------`------------------------------------------------
1579_Local_ an empty directory for local configuration files
1580_OS_ OS-specific files
1581_doc_ documentation files
1582_exim_monitor_ source files for the Exim monitor
1583_scripts_ scripts used in the build process
1584_src_ remaining source files
1585_util_ independent utilities
1586----------------------------------------------------------------------
1587
1588The main utility programs are contained in the _src_ directory, and are built
1589with the Exim binary. The _util_ directory contains a few optional scripts
1590that may be useful to some sites.
1591
1592
1593Multiple machine architectures and operating systems
1594~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1595cindex:[building Exim,multiple OS/architectures]
1596The building process for Exim is arranged to make it easy to build binaries for
1597a number of different architectures and operating systems from the same set of
1598source files. Compilation does not take place in the _src_ directory. Instead,
1599a 'build directory' is created for each architecture and operating system.
1600
1601cindex:[symbolic link,to build directory]
1602Symbolic links to the sources are installed in this directory, which is where
1603the actual building takes place.
1604
1605In most cases, Exim can discover the machine architecture and operating system
1606for itself, but the defaults can be overridden if necessary.
1607
1608
1609[[SECTdb]]
1610DBM libraries
1611~~~~~~~~~~~~~
1612cindex:[DBM libraries, discussion of]
1613cindex:[hints database,DBM files used for]
1614Even if you do not use any DBM files in your configuration, Exim still needs a
1615DBM library in order to operate, because it uses indexed files for its hints
1616databases. Unfortunately, there are a number of DBM libraries in existence, and
1617different operating systems often have different ones installed.
1618
1619cindex:[Solaris,DBM library for]
1620cindex:[IRIX, DBM library for]
1621cindex:[BSD, DBM library for]
1622cindex:[Linux, DBM library for]
1623If you are using Solaris, IRIX, one of the modern BSD systems, or a modern
1624Linux distribution, the DBM configuration should happen automatically, and you
1625may be able to ignore this section. Otherwise, you may have to learn more than
1626you would like about DBM libraries from what follows.
1627
1628cindex:['ndbm' DBM library]
1629Licensed versions of Unix normally contain a library of DBM functions operating
1630via the 'ndbm' interface, and this is what Exim expects by default. Free
1631versions of Unix seem to vary in what they contain as standard. In particular,
1632some early versions of Linux have no default DBM library, and different
1633distributors have chosen to bundle different libraries with their packaged
1634versions. However, the more recent releases seem to have standardised on the
1635Berkeley DB library.
1636
1637Different DBM libraries have different conventions for naming the files they
1638use. When a program opens a file called _dbmfile_, there are four
1639possibilities:
1640
1641. A traditional 'ndbm' implementation, such as that supplied as part of
1642Solaris, operates on two files called _dbmfile.dir_ and _dbmfile.pag_.
1643
1644. cindex:['gdbm' DBM library]
1645The GNU library, 'gdbm', operates on a single file. If used via its 'ndbm'
1646compatibility interface it makes two different hard links to it with names
1647_dbmfile.dir_ and _dbmfile.pag_, but if used via its native interface, the
1648file name is used unmodified.
1649
1650. cindex:[Berkeley DB library]
1651The Berkeley DB package, if called via its 'ndbm' compatibility interface,
1652operates on a single file called _dbmfile.db_, but otherwise looks to the
1653programmer exactly the same as the traditional 'ndbm' implementation.
1654
1655. If the Berkeley package is used in its native mode, it operates on a single
1656file called _dbmfile_; the programmer's interface is somewhat different to
1657the traditional 'ndbm' interface.
1658
1659. To complicate things further, there are several very different versions of the
1660Berkeley DB package. Version 1.85 was stable for a very long time, releases
16612.'x' and 3.'x' were current for a while, but the latest versions are now
1662numbered 4.'x'. Maintenance of some of the earlier releases has ceased. All
1663versions of Berkeley DB can be obtained from
1664+
1665&&&
1666*http://www.sleepycat.com/[]*
1667&&&
1668
1669. cindex:['tdb' DBM library]
1670Yet another DBM library, called 'tdb', has become available from
1671+
1672&&&
1673*http://download.sourceforge.net/tdb[]*
1674&&&
1675+
1676It has its own interface, and also operates on a single file.
1677
1678cindex:[USE_DB]
1679cindex:[DBM libraries, configuration for building]
1680Exim and its utilities can be compiled to use any of these interfaces. In order
1681to use any version of the Berkeley DB package in native mode, you must set
1682USE_DB in an appropriate configuration file (typically
1683_Local/Makefile_). For example:
1684
1685 USE_DB=yes
1686
1687Similarly, for gdbm you set USE_GDBM, and for tdb you set USE_TDB. An
1688error is diagnosed if you set more than one of these.
1689
1690At the lowest level, the build-time configuration sets none of these options,
1691thereby assuming an interface of type (1). However, some operating system
1692configuration files (for example, those for the BSD operating systems and
1693Linux) assume type (4) by setting USE_DB as their default, and the
1694configuration files for Cygwin set USE_GDBM. Anything you set in
1695_Local/Makefile_, however, overrides these system defaults.
1696
1697As well as setting USE_DB, USE_GDBM, or USE_TDB, it may also be
1698necessary to set DBMLIB, to cause inclusion of the appropriate library, as
1699in one of these lines:
1700
1701 DBMLIB = -ldb
1702 DBMLIB = -ltdb
1703
1704Settings like that will work if the DBM library is installed in the standard
1705place. Sometimes it is not, and the library's header file may also not be in
1706the default path. You may need to set INCLUDE to specify where the header
1707file is, and to specify the path to the library more fully in DBMLIB, as in
1708this example:
1709
1710 INCLUDE=-I/usr/local/include/db-4.1
1711 DBMLIB=/usr/local/lib/db-4.1/libdb.a
1712
1713
1714There is further detailed discussion about the various DBM libraries in the
1715file _doc/dbm.discuss.txt_ in the Exim distribution.
1716
1717
1718
1719Pre-building configuration
1720~~~~~~~~~~~~~~~~~~~~~~~~~~
1721cindex:[building Exim,pre-building configuration]
1722cindex:[configuration for building Exim]
1723cindex:[_Local/Makefile_]
1724cindex:[_src/EDITME_]
1725Before building Exim, a local configuration file that specifies options
1726independent of any operating system has to be created with the name
1727_Local/Makefile_. A template for this file is supplied as the file
1728_src/EDITME_, and it contains full descriptions of all the option settings
1729therein. These descriptions are therefore not repeated here. If you are
1730building Exim for the first time, the simplest thing to do is to copy
1731_src/EDITME_ to _Local/Makefile_, then read it and edit it appropriately.
1732
1733There are three settings that you must supply, because Exim will not build
1734without them. They are the location of the run time configuration file
1735(CONFIGURE_FILE), the directory in which Exim binaries will be installed
1736(BIN_DIRECTORY), and the identity of the Exim user (EXIM_USER and
1737maybe EXIM_GROUP as well). The value of CONFIGURE_FILE can in fact be
1738a colon-separated list of file names; Exim uses the first of them that exists.
1739
1740There are a few other parameters that can be specified either at build time or
1741at run time, to enable the same binary to be used on a number of different
1742machines. However, if the locations of Exim's spool directory and log file
1743directory (if not within the spool directory) are fixed, it is recommended that
1744you specify them in _Local/Makefile_ instead of at run time, so that errors
1745detected early in Exim's execution (such as a malformed configuration file) can
1746be logged.
1747
1748cindex:[content scanning,specifying at build time]
068aaea8 1749Exim's interfaces for calling virus and spam scanning software directly from
168e428f
PH
1750access control lists are not compiled by default. If you want to include these
1751facilities, you need to set
1752
1753 WITH_CONTENT_SCAN=yes
1754
1755in your _Local/Makefile_. For details of the facilities themselves, see
1756chapter <<CHAPexiscan>>.
1757
1758
1759cindex:[_Local/eximon.conf_]
1760cindex:[_exim_monitor/EDITME_]
1761If you are going to build the Exim monitor, a similar configuration process is
1762required. The file _exim_monitor/EDITME_ must be edited appropriately for
1763your installation and saved under the name _Local/eximon.conf_. If you are
1764happy with the default settings described in _exim_monitor/EDITME_,
1765_Local/eximon.conf_ can be empty, but it must exist.
1766
1767This is all the configuration that is needed in straightforward cases for known
1768operating systems. However, the building process is set up so that it is easy
1769to override options that are set by default or by operating-system-specific
1770configuration files, for example to change the name of the C compiler, which
1771defaults to %gcc%. See section <<SECToverride>> below for details of how to do
1772this.
1773
1774
1775
1776Support for iconv()
1777~~~~~~~~~~~~~~~~~~~
1778cindex:['iconv()' support]
d1e83bff 1779cindex:[RFC 2047]
168e428f
PH
1780The contents of header lines in messages may be encoded according to the rules
1781described RFC 2047. This makes it possible to transmit characters that are not
1782in the ASCII character set, and to label them as being in a particular
1783character set. When Exim is inspecting header lines by means of the %\$h_%
1784mechanism, it decodes them, and translates them into a specified character set
1785(default ISO-8859-1). The translation is possible only if the operating system
1786supports the 'iconv()' function.
1787
1788However, some of the operating systems that supply 'iconv()' do not support
1789very many conversions. The GNU %libiconv% library (available from
1790*http://www.gnu.org/software/libiconv/[]*) can be installed on such systems to
1791remedy this deficiency, as well as on systems that do not supply 'iconv()' at
1792all. After installing %libiconv%, you should add
1793
1794 HAVE_ICONV=yes
1795
1796to your _Local/Makefile_ and rebuild Exim.
1797
1798
1799
1800[[SECTinctlsssl]]
1801Including TLS/SSL encryption support
1802~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1803cindex:[TLS,including support for TLS]
1804cindex:[encryption,including support for]
1805cindex:[SUPPORT_TLS]
1806cindex:[OpenSSL,building Exim with]
1807cindex:[GnuTLS,building Exim with]
1808Exim can be built to support encrypted SMTP connections, using the STARTTLS
1809command as per RFC 2487. It can also support legacy clients that expect to
1810start a TLS session immediately on connection to a non-standard port (see the
1811%tls_on_connect_ports% runtime option and the %-tls-on-connect% command
1812line option).
1813
1814If you want to build Exim with TLS support, you must first install either the
1815OpenSSL or GnuTLS library. There is no cryptographic code in Exim itself for
1816implementing SSL.
1817
1818If OpenSSL is installed, you should set
1819
1820 SUPPORT_TLS=yes
1821 TLS_LIBS=-lssl -lcrypto
1822
1823in _Local/Makefile_. You may also need to specify the locations of the
1824OpenSSL library and include files. For example:
1825
1826 SUPPORT_TLS=yes
1827 TLS_LIBS=-L/usr/local/openssl/lib -lssl -lcrypto
1828 TLS_INCLUDE=-I/usr/local/openssl/include/
1829
1830cindex:[USE_GNUTLS]
1831If GnuTLS is installed, you should set
1832
1833 SUPPORT_TLS=yes
1834 USE_GNUTLS=yes
1835 TLS_LIBS=-lgnutls -ltasn1 -lgcrypt
1836
1837in _Local/Makefile_, and again you may need to specify the locations of the
1838library and include files. For example:
1839
1840 SUPPORT_TLS=yes
1841 USE_GNUTLS=yes
1842 TLS_LIBS=-L/usr/gnu/lib -lgnutls -ltasn1 -lgcrypt
1843 TLS_INCLUDE=-I/usr/gnu/include
1844
1845You do not need to set TLS_INCLUDE if the relevant directory is already
1846specified in INCLUDE. Details of how to configure Exim to make use of TLS
1847are given in chapter <<CHAPTLS>>.
1848
1849
1850
1851
1852Use of tcpwrappers
1853~~~~~~~~~~~~~~~~~~
1854cindex:[tcpwrappers, building Exim to support]
1855cindex:[USE_TCP_WRAPPERS]
1856Exim can be linked with the 'tcpwrappers' library in order to check incoming
1857SMTP calls using the 'tcpwrappers' control files. This may be a convenient
1858alternative to Exim's own checking facilities for installations that are
1859already making use of 'tcpwrappers' for other purposes. To do this, you should
1860set USE_TCP_WRAPPERS in _Local/Makefile_, arrange for the file
1861_tcpd.h_ to be available at compile time, and also ensure that the library
1862_libwrap.a_ is available at link time, typically by including %-lwrap% in
1863EXTRALIBS_EXIM. For example, if 'tcpwrappers' is installed in
1864_/usr/local_, you might have
1865
1866 USE_TCP_WRAPPERS=yes
1867 CFLAGS=-O -I/usr/local/include
1868 EXTRALIBS_EXIM=-L/usr/local/lib -lwrap
1869
1870in _Local/Makefile_. The name to use in the 'tcpwrappers' control files is
1871``exim''. For example, the line
1872
1873 exim : LOCAL 192.168.1. .friendly.domain.example
1874
1875in your _/etc/hosts.allow_ file allows connections from the local host, from
1876the subnet 192.168.1.0/24, and from all hosts in 'friendly.domain.example'.
1877All other connections are denied. Consult the 'tcpwrappers' documentation for
1878further details.
1879
1880
1881
1882Including support for IPv6
1883~~~~~~~~~~~~~~~~~~~~~~~~~~
1884cindex:[IPv6,including support for]
1885Exim contains code for use on systems that have IPv6 support. Setting
1886`HAVE_IPV6=YES` in _Local/Makefile_ causes the IPv6 code to be included;
1887it may also be necessary to set IPV6_INCLUDE and IPV6_LIBS on systems
1888where the IPv6 support is not fully integrated into the normal include and
1889library files.
1890
1891Two different types of DNS record for handling IPv6 addresses have been
1892defined. AAAA records (analagous to A records for IPv4) are in use, and are
1893currently seen as the mainstream. Another record type called A6 was proposed
1894as better than AAAA because it had more flexibility. However, it was felt to be
1895over-complex, and its status was reduced to ``experimental''. It is not known
1896if anyone is actually using A6 records. Exim has support for A6 records, but
1897this is included only if you set `SUPPORT_A6=YES` in _Local/Makefile_. The
1898support has not been tested for some time.
1899
1900
1901
1902The building process
1903~~~~~~~~~~~~~~~~~~~~
1904cindex:[build directory]
1905Once _Local/Makefile_ (and _Local/eximon.conf_, if required) have been
1906created, run 'make' at the top level. It determines the architecture and
1907operating system types, and creates a build directory if one does not exist.
1908For example, on a Sun system running Solaris 8, the directory
1909_build-SunOS5-5.8-sparc_ is created.
1910cindex:[symbolic link,to source files]
1911Symbolic links to relevant source files are installed in the build directory.
1912
1913*Warning*: The %-j% (parallel) flag must not be used with 'make'; the
1914building process fails if it is set.
1915
1916If this is the first time 'make' has been run, it calls a script that builds
1917a make file inside the build directory, using the configuration files from the
1918_Local_ directory. The new make file is then passed to another instance of
1919'make'. This does the real work, building a number of utility scripts, and
1920then compiling and linking the binaries for the Exim monitor (if configured), a
1921number of utility programs, and finally Exim itself. The command 'make
1922makefile' can be used to force a rebuild of the make file in the build
1923directory, should this ever be necessary.
1924
1925If you have problems building Exim, check for any comments there may be in the
1926_README_ file concerning your operating system, and also take a look at the
1927FAQ, where some common problems are covered.
1928
1929
1930
068aaea8
PH
1931Output from ``make''
1932~~~~~~~~~~~~~~~~~~~~
1933
1934[revisionflag="changed"]
1935The output produced by the 'make' process for compile lines is often very
1936unreadable, because these lines can be very long. For this reason, the normal
1937output is suppressed by default, and instead output similar to that which
1938appears when compiling the 2.6 Linux kernel is generated: just a short line for
1939each module that is being compiled or linked. However, it is still possible to
1940get the full output, by calling 'make' like this:
1941
1942 FULLECHO='' make -e
1943
1944The value of FULLECHO defaults to ``@'', the flag character that suppresses
1945command reflection in 'make'. When you ask for the full output, it is
1946given in addition to the the short output.
1947
1948
1949
168e428f
PH
1950
1951[[SECToverride]]
1952Overriding build-time options for Exim
1953~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1954cindex:[build-time options, overriding]
1955The main make file that is created at the beginning of the building process
1956consists of the concatenation of a number of files which set configuration
1957values, followed by a fixed set of 'make' instructions. If a value is set
1958more than once, the last setting overrides any previous ones. This provides a
1959convenient way of overriding defaults. The files that are concatenated are, in
1960order:
1961
1962&&&
1963_OS/Makefile-Default_
1964_OS/Makefile-_<'ostype'>
1965_Local/Makefile_
1966_Local/Makefile-_<'ostype'>
1967_Local/Makefile-_<'archtype'>
1968_Local/Makefile-_<'ostype'>-<'archtype'>
1969_OS/Makefile-Base_
1970&&&
1971
1972cindex:[_Local/Makefile_]
1973cindex:[building Exim,operating system type]
1974cindex:[building Exim,architecture type]
1975where <'ostype'> is the operating system type and <'archtype'> is the
1976architecture type. _Local/Makefile_ is required to exist, and the building
1977process fails if it is absent. The other three _Local_ files are optional,
1978and are often not needed.
1979
1980The values used for <'ostype'> and <'archtype'> are obtained from scripts
1981called _scripts/os-type_ and _scripts/arch-type_ respectively. If either of
1982the environment variables EXIM_OSTYPE or EXIM_ARCHTYPE is set, their
1983values are used, thereby providing a means of forcing particular settings.
1984Otherwise, the scripts try to get values from the %uname% command. If this
1985fails, the shell variables OSTYPE and ARCHTYPE are inspected. A number
1986of 'ad hoc' transformations are then applied, to produce the standard names
1987that Exim expects. You can run these scripts directly from the shell in order
1988to find out what values are being used on your system.
1989
1990
1991_OS/Makefile-Default_ contains comments about the variables that are set
1992therein. Some (but not all) are mentioned below. If there is something that
1993needs changing, review the contents of this file and the contents of the make
1994file for your operating system (_OS/Makefile-<ostype>_) to see what the
1995default values are.
1996
1997
1998cindex:[building Exim,overriding default settings]
1999If you need to change any of the values that are set in _OS/Makefile-Default_
2000or in _OS/Makefile-<ostype>_, or to add any new definitions, you do not
2001need to change the original files. Instead, you should make the changes by
2002putting the new values in an appropriate _Local_ file. For example,
2003cindex:[Tru64-Unix build-time settings]
2004when building Exim in many releases of the Tru64-Unix (formerly Digital UNIX,
2005formerly DEC-OSF1) operating system, it is necessary to specify that the C
2006compiler is called 'cc' rather than 'gcc'. Also, the compiler must be
2007called with the option %-std1%, to make it recognize some of the features of
2008Standard C that Exim uses. (Most other compilers recognize Standard C by
2009default.) To do this, you should create a file called _Local/Makefile-OSF1_
2010containing the lines
2011
2012 CC=cc
2013 CFLAGS=-std1
2014
2015If you are compiling for just one operating system, it may be easier to put
2016these lines directly into _Local/Makefile_.
2017
2018Keeping all your local configuration settings separate from the distributed
2019files makes it easy to transfer them to new versions of Exim simply by copying
2020the contents of the _Local_ directory.
2021
2022
2023cindex:[NIS lookup type,including support for]
2024cindex:[NIS+ lookup type,including support for]
2025cindex:[LDAP,including support for]
2026cindex:[lookup,inclusion in binary]
2027Exim contains support for doing LDAP, NIS, NIS+, and other kinds of file
2028lookup, but not all systems have these components installed, so the default is
2029not to include the relevant code in the binary. All the different kinds of file
2030and database lookup that Exim supports are implemented as separate code modules
2031which are included only if the relevant compile-time options are set. In the
2032case of LDAP, NIS, and NIS+, the settings for _Local/Makefile_ are:
2033
2034 LOOKUP_LDAP=yes
2035 LOOKUP_NIS=yes
2036 LOOKUP_NISPLUS=yes
2037
2038and similar settings apply to the other lookup types. They are all listed in
068aaea8 2039_src/EDITME_. In many cases the relevant include files and interface
168e428f
PH
2040libraries need to be installed before compiling Exim.
2041cindex:[cdb,including support for]
068aaea8
PH
2042However, there are some optional lookup types (such as cdb) for which
2043the code is entirely contained within Exim, and no external include
168e428f
PH
2044files or libraries are required. When a lookup type is not included in the
2045binary, attempts to configure Exim to use it cause run time configuration
2046errors.
2047
2048cindex:[Perl,including support for]
2049Exim can be linked with an embedded Perl interpreter, allowing Perl
2050subroutines to be called during string expansion. To enable this facility,
2051
2052 EXIM_PERL=perl.o
2053
2054must be defined in _Local/Makefile_. Details of this facility are given in
2055chapter <<CHAPperl>>.
2056
2057cindex:[X11 libraries, location of]
2058The location of the X11 libraries is something that varies a lot between
068aaea8 2059operating systems, and there may be different versions of X11 to cope
168e428f
PH
2060with. Exim itself makes no use of X11, but if you are compiling the Exim
2061monitor, the X11 libraries must be available.
2062The following three variables are set in _OS/Makefile-Default_:
2063
2064 X11=/usr/X11R6
2065 XINCLUDE=-I$(X11)/include
2066 XLFLAGS=-L$(X11)/lib
2067
2068These are overridden in some of the operating-system configuration files. For
2069example, in _OS/Makefile-SunOS5_ there is
2070
2071 X11=/usr/openwin
2072 XINCLUDE=-I$(X11)/include
2073 XLFLAGS=-L$(X11)/lib -R$(X11)/lib
2074
2075If you need to override the default setting for your operating system, place a
2076definition of all three of these variables into your
2077_Local/Makefile-<ostype>_ file.
2078
2079cindex:[EXTRALIBS]
2080If you need to add any extra libraries to the link steps, these can be put in a
2081variable called EXTRALIBS, which appears in all the link commands, but by
2082default is not defined. In contrast, EXTRALIBS_EXIM is used only on the
2083command for linking the main Exim binary, and not for any associated utilities.
2084
2085cindex:[DBM libraries, configuration for building]
2086There is also DBMLIB, which appears in the link commands for binaries that
2087use DBM functions (see also section <<SECTdb>>). Finally, there is
2088EXTRALIBS_EXIMON, which appears only in the link step for the Exim monitor
2089binary, and which can be used, for example, to include additional X11
2090libraries.
2091
2092cindex:[configuration file,editing]
2093The make file copes with rebuilding Exim correctly if any of the configuration
2094files are edited. However, if an optional configuration file is deleted, it is
2095necessary to touch the associated non-optional file (that is, _Local/Makefile_
2096or _Local/eximon.conf_) before rebuilding.
2097
2098
2099OS-specific header files
2100~~~~~~~~~~~~~~~~~~~~~~~~
2101cindex:[_os.h_]
2102cindex:[building Exim,OS-specific C header files]
2103The _OS_ directory contains a number of files with names of the form
2104_os.h-<ostype>_. These are system-specific C header files that should not
2105normally need to be changed. There is a list of macro settings that are
2106recognized in the file _OS/os.configuring_, which should be consulted if you
2107are porting Exim to a new operating system.
2108
2109
2110
2111Overriding build-time options for the monitor
2112~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2113cindex:[building Eximon,overriding default options]
2114A similar process is used for overriding things when building the Exim monitor,
2115where the files that are involved are
2116
2117&&&
2118_OS/eximon.conf-Default_
2119_OS/eximon.conf-_<'ostype'>
2120_Local/eximon.conf_
2121_Local/eximon.conf-_<'ostype'>
2122_Local/eximon.conf-_<'archtype'>
2123_Local/eximon.conf-_<'ostype'>-<'archtype'>
2124&&&
2125
2126cindex:[_Local/eximon.conf_]
2127As with Exim itself, the final three files need not exist, and in this case the
2128_OS/eximon.conf-<ostype>_ file is also optional. The default values in
2129_OS/eximon.conf-Default_ can be overridden dynamically by setting environment
2130variables of the same name, preceded by EXIMON_. For example, setting
2131EXIMON_LOG_DEPTH in the environment overrides the value of
2132LOG_DEPTH at run time.
2133
2134
2135
2136
2137Installing Exim binaries and scripts
2138~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2139cindex:[installing Exim]
2140cindex:[BIN_DIRECTORY]
068aaea8
PH
2141The command 'make install' runs the 'exim_install' script with no arguments.
2142The script copies binaries and utility scripts into the directory whose name is
2143specified by the BIN_DIRECTORY setting in _Local/Makefile_.
2144cindex:[setuid,installing Exim with]
2145The install script copies files only if they are newer than the files they are
2146going to replace. The Exim binary is required to be owned by root and have the
2147'setuid' bit set, for normal configurations. Therefore, you must run 'make
2148install' as root so that it can set up the Exim binary in this way. However, in
2149some special situations (for example, if a host is doing no local deliveries)
2150it may be possible to run Exim without making the binary setuid root (see
2151chapter <<CHAPsecurity>> for details).
168e428f
PH
2152
2153cindex:[CONFIGURE_FILE]
2154Exim's run time configuration file is named by the CONFIGURE_FILE setting
2155in _Local/Makefile_. If this names a single file, and the file does not
2156exist, the default configuration file _src/configure.default_ is copied there
2157by the installation script. If a run time configuration file already exists, it
2158is left alone. If CONFIGURE_FILE is a colon-separated list, naming several
2159alternative files, no default is installed.
2160
2161cindex:[system aliases file]
2162cindex:[_/etc/aliases_]
2163One change is made to the default configuration file when it is installed: the
2164default configuration contains a router that references a system aliases file.
2165The path to this file is set to the value specified by
2166SYSTEM_ALIASES_FILE in _Local/Makefile_ (_/etc/aliases_ by default).
2167If the system aliases file does not exist, the installation script creates it,
2168and outputs a comment to the user.
2169
2170The created file contains no aliases, but it does contain comments about the
2171aliases a site should normally have. Mail aliases have traditionally been
2172kept in _/etc/aliases_. However, some operating systems are now using
2173_/etc/mail/aliases_. You should check if yours is one of these, and change
2174Exim's configuration if necessary.
2175
2176The default configuration uses the local host's name as the only local domain,
2177and is set up to do local deliveries into the shared directory _/var/mail_,
2178running as the local user. System aliases and _.forward_ files in users' home
2179directories are supported, but no NIS or NIS+ support is configured. Domains
2180other than the name of the local host are routed using the DNS, with delivery
2181over SMTP.
2182
168e428f
PH
2183It is possible to install Exim for special purposes (such as building a binary
2184distribution) in a private part of the file system. You can do this by a
2185command such as
2186
2187 make DESTDIR=/some/directory/ install
2188
2189This has the effect of pre-pending the specified directory to all the file
2190paths, except the name of the system aliases file that appears in the default
2191configuration. (If a default alias file is created, its name 'is' modified.)
2192For backwards compatibility, ROOT is used if DESTDIR is not set,
2193but this usage is deprecated.
2194
2195cindex:[installing Exim,what is not installed]
2196Running 'make install' does not copy the Exim 4 conversion script
2197'convert4r4', or the 'pcretest' test program. You will probably run the
2198first of these only once (if you are upgrading from Exim 3), and the second
2199isn't really part of Exim. None of the documentation files in the _doc_
2200directory are copied, except for the info files when you have set
2201INFO_DIRECTORY, as described in section <<SECTinsinfdoc>> below.
2202
2203For the utility programs, old versions are renamed by adding the suffix _.O_
2204to their names. The Exim binary itself, however, is handled differently. It is
2205installed under a name that includes the version number and the compile number,
2206for example _exim-{version}-1_. The script then arranges for a symbolic link
2207called _exim_ to point to the binary. If you are updating a previous version
2208of Exim, the script takes care to ensure that the name _exim_ is never absent
2209from the directory (as seen by other processes).
2210
2211cindex:[installing Exim,testing the script]
2212If you want to see what the 'make install' will do before running it for
2213real, you can pass the %-n% option to the installation script by this command:
2214
2215 make INSTALL_ARG=-n install
2216
2217The contents of the variable INSTALL_ARG are passed to the installation
2218script. You do not need to be root to run this test. Alternatively, you can run
2219the installation script directly, but this must be from within the build
2220directory. For example, from the top-level Exim directory you could use this
2221command:
2222
2223 (cd build-SunOS5-5.5.1-sparc; ../scripts/exim_install -n)
2224
2225cindex:[installing Exim,install script options]
2226There are two other options that can be supplied to the installation script.
2227
2228- %-no_chown% bypasses the call to change the owner of the installed binary
2229to root, and the call to make it a setuid binary.
2230
2231- %-no_symlink% bypasses the setting up of the symbolic link _exim_ to the
2232installed binary.
2233
2234INSTALL_ARG can be used to pass these options to the script. For example:
2235
2236 make INSTALL_ARG=-no_symlink install
2237
2238
2239The installation script can also be given arguments specifying which files are
2240to be copied. For example, to install just the Exim binary, and nothing else,
2241without creating the symbolic link, you could use:
2242
2243 make INSTALL_ARG='-no_symlink exim' install
2244
2245
2246
2247
2248[[SECTinsinfdoc]]
2249Installing info documentation
2250~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2251cindex:[installing Exim,'info' documentation]
2252Not all systems use the GNU 'info' system for documentation, and for this
2253reason, the Texinfo source of Exim's documentation is not included in the main
2254distribution. Instead it is available separately from the ftp site (see section
2255<<SECTavail>>).
2256
2257If you have defined INFO_DIRECTORY in _Local/Makefile_ and the Texinfo
2258source of the documentation is found in the source tree, running 'make
2259install' automatically builds the info files and installs them.
2260
2261
2262
2263Setting up the spool directory
2264~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2265cindex:[spool directory,creating]
2266When it starts up, Exim tries to create its spool directory if it does not
2267exist. The Exim uid and gid are used for the owner and group of the spool
2268directory. Sub-directories are automatically created in the spool directory as
2269necessary.
2270
2271
2272
2273
2274Testing
2275~~~~~~~
2276cindex:[testing,installation]
2277Having installed Exim, you can check that the run time configuration file is
2278syntactically valid by running the following command, which assumes that the
2279Exim binary directory is within your PATH environment variable:
2280
2281 exim -bV
2282
2283If there are any errors in the configuration file, Exim outputs error messages.
2284Otherwise it outputs the version number and build date,
2285the DBM library that is being used, and information about which drivers and
2286other optional code modules are included in the binary.
2287Some simple routing tests can be done by using the address testing option. For
2288example,
2289
2290 exim -bt <local username>
2291
2292should verify that it recognizes a local mailbox, and
2293
2294 exim -bt <remote address>
2295
2296a remote one. Then try getting it to deliver mail, both locally and remotely.
2297This can be done by passing messages directly to Exim, without going through a
2298user agent. For example:
2299
068aaea8
PH
2300....
2301exim -v postmaster@your.domain.example
2302From: user@your.domain.example
2303To: postmaster@your.domain.example
2304Subject: Testing Exim
168e428f 2305
068aaea8
PH
2306This is a test message.
2307^D
2308....
168e428f
PH
2309
2310The %-v% option causes Exim to output some verification of what it is doing.
2311In this case you should see copies of three log lines, one for the message's
2312arrival, one for its delivery, and one containing ``Completed''.
2313
2314cindex:[delivery,problems with]
2315If you encounter problems, look at Exim's log files ('mainlog' and
2316'paniclog') to see if there is any relevant information there. Another source
2317of information is running Exim with debugging turned on, by specifying the
2318%-d% option. If a message is stuck on Exim's spool, you can force a delivery
2319with debugging turned on by a command of the form
2320
2321 exim -d -M <message-id>
2322
2323You must be root or an ``admin user'' in order to do this. The %-d% option
2324produces rather a lot of output, but you can cut this down to specific areas.
2325For example, if you use %-d-all+route% only the debugging information relevant
2326to routing is included. (See the %-d% option in chapter <<CHAPcommandline>> for
2327more details.)
2328
2329cindex:[``sticky'' bit]
2330cindex:[lock files]
2331One specific problem that has shown up on some sites is the inability to do
2332local deliveries into a shared mailbox directory, because it does not have the
2333``sticky bit'' set on it. By default, Exim tries to create a lock file before
2334writing to a mailbox file, and if it cannot create the lock file, the delivery
2335is deferred. You can get round this either by setting the ``sticky bit'' on the
2336directory, or by setting a specific group for local deliveries and allowing
2337that group to create files in the directory (see the comments above the
2338^local_delivery^ transport in the default configuration file). Another
2339approach is to configure Exim not to use lock files, but just to rely on
2340'fcntl()' locking instead. However, you should do this only if all user
2341agents also use 'fcntl()' locking. For further discussion of locking issues,
2342see chapter <<CHAPappendfile>>.
2343
2344One thing that cannot be tested on a system that is already running an MTA is
2345the receipt of incoming SMTP mail on the standard SMTP port. However, the
2346%-oX% option can be used to run an Exim daemon that listens on some other
2347port, or 'inetd' can be used to do this. The %-bh% option and the
2348'exim_checkaccess' utility can be used to check out policy controls on
2349incoming SMTP mail.
2350
2351Testing a new version on a system that is already running Exim can most easily
2352be done by building a binary with a different CONFIGURE_FILE setting. From
2353within the run time configuration, all other file and directory names
2354that Exim uses can be altered, in order to keep it entirely clear of the
2355production version.
2356
2357
2358Replacing another MTA with Exim
2359~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2360cindex:[replacing another MTA]
2361Building and installing Exim for the first time does not of itself put it in
2362general use. The name by which the system's MTA is called by mail user agents
2363is either _/usr/sbin/sendmail_, or _/usr/lib/sendmail_ (depending on the
2364operating system), and it is necessary to make this name point to the 'exim'
2365binary in order to get the user agents to pass messages to Exim. This is
2366normally done by renaming any existing file and making _/usr/sbin/sendmail_
2367or _/usr/lib/sendmail_
2368
2369cindex:[symbolic link,to 'exim' binary]
2370a symbolic link to the 'exim' binary. It is a good idea to remove any setuid
2371privilege and executable status from the old MTA. It is then necessary to stop
2372and restart the mailer daemon, if one is running.
2373
2374cindex:[FreeBSD, MTA indirection]
2375cindex:[_/etc/mail/mailer.conf_]
2376Some operating systems have introduced alternative ways of switching MTAs. For
2377example, if you are running FreeBSD, you need to edit the file
2378_/etc/mail/mailer.conf_ instead of setting up a symbolic link as just
2379described. A typical example of the contents of this file for running Exim is
2380as follows:
2381
2382 sendmail /usr/exim/bin/exim
2383 send-mail /usr/exim/bin/exim
2384 mailq /usr/exim/bin/exim -bp
2385 newaliases /usr/bin/true
2386
2387
2388Once you have set up the symbolic link, or edited _/etc/mail/mailer.conf_,
2389your Exim installation is ``live''. Check it by sending a message from your
2390favourite user agent.
2391
2392You should consider what to tell your users about the change of MTA. Exim may
2393have different capabilities to what was previously running, and there are
2394various operational differences such as the text of messages produced by
2395command line options and in bounce messages. If you allow your users to make
2396use of Exim's filtering capabilities, you should make the document entitled
2397'Exim's interface to mail filtering'
2398available to them.
2399
2400
2401
2402Upgrading Exim
2403~~~~~~~~~~~~~~
2404cindex:[upgrading Exim]
2405If you are already running Exim on your host, building and installing a new
2406version automatically makes it available to MUAs, or any other programs that
2407call the MTA directly. However, if you are running an Exim daemon, you do need
2408to send it a HUP signal, to make it re-exec itself, and thereby pick up the new
2409binary. You do not need to stop processing mail in order to install a new
068aaea8
PH
2410version of Exim. The install script does not modify an existing runtime
2411configuration file.
2412
168e428f
PH
2413
2414
2415
2416Stopping the Exim daemon on Solaris
2417~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2418cindex:[Solaris,stopping Exim on]
2419The standard command for stopping the mailer daemon on Solaris is
2420
2421 /etc/init.d/sendmail stop
2422
2423If _/usr/lib/sendmail_ has been turned into a symbolic link, this script
2424fails to stop Exim because it uses the command 'ps -e' and greps the output
2425for the text ``sendmail''; this is not present because the actual program name
2426(that is, ``exim'') is given by the 'ps' command with these options. A solution
2427is to replace the line that finds the process id with something like
2428
2429 pid=`cat /var/spool/exim/exim-daemon.pid`
2430
2431to obtain the daemon's pid directly from the file that Exim saves it in.
2432
2433Note, however, that stopping the daemon does not ``stop Exim''. Messages can
2434still be received from local processes, and if automatic delivery is configured
2435(the normal case), deliveries will still occur.
2436
2437
2438
2439
2440////////////////////////////////////////////////////////////////////////////
2441////////////////////////////////////////////////////////////////////////////
2442
2443[[CHAPcommandline]]
2444The Exim command line
2445---------------------
2446cindex:[command line,options]
2447cindex:[options,command line]
2448Exim's command line takes the standard Unix form of a sequence of options,
2449each starting with a hyphen character, followed by a number of arguments. The
2450options are compatible with the main options of Sendmail, and there are also
2451some additional options, some of which are compatible with Smail 3. Certain
2452combinations of options do not make sense, and provoke an error if used.
2453The form of the arguments depends on which options are set.
2454
2455
2456Setting options by program name
2457~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2458cindex:['mailq']
2459If Exim is called under the name 'mailq', it behaves as if the option %-bp%
2460were present before any other options.
2461The %-bp% option requests a listing of the contents of the mail queue on the
2462standard output.
2463This feature is for compatibility with some systems that contain a command of
2464that name in one of the standard libraries, symbolically linked to
2465_/usr/sbin/sendmail_ or _/usr/lib/sendmail_.
2466
2467cindex:['rsmtp']
2468If Exim is called under the name 'rsmtp' it behaves as if the option %-bS%
2469were present before any other options, for compatibility with Smail. The %-bS%
2470option is used for reading in a number of messages in batched SMTP format.
2471
2472cindex:['rmail']
2473If Exim is called under the name 'rmail' it behaves as if the %-i% and
2474%-oee% options were present before any other options, for compatibility with
2475Smail. The name 'rmail' is used as an interface by some UUCP systems.
2476
2477cindex:['runq']
2478cindex:[queue runner]
2479If Exim is called under the name 'runq' it behaves as if the option %-q% were
2480present before any other options, for compatibility with Smail. The %-q%
2481option causes a single queue runner process to be started.
2482
2483cindex:['newaliases']
2484cindex:[alias file,building]
2485cindex:[Sendmail compatibility,calling Exim as 'newaliases']
2486If Exim is called under the name 'newaliases' it behaves as if the option
2487%-bi% were present before any other options, for compatibility with Sendmail.
2488This option is used for rebuilding Sendmail's alias file. Exim does not have
2489the concept of a single alias file, but can be configured to run a given
2490command if called with the %-bi% option.
2491
2492
2493[[SECTtrustedadmin]]
2494Trusted and admin users
2495~~~~~~~~~~~~~~~~~~~~~~~
2496Some Exim options are available only to 'trusted users' and others are
2497available only to 'admin users'. In the description below, the phrases ``Exim
2498user'' and ``Exim group'' mean the user and group defined by EXIM_USER and
2499EXIM_GROUP in _Local/Makefile_ or set by the %exim_user% and
2500%exim_group% options. These do not necessarily have to use the name ``exim''.
2501
2502- cindex:[trusted user,definition of]
2503cindex:[user, trusted definition of]
2504The trusted users are root, the Exim user, any user listed in the
2505%trusted_users% configuration option, and any user whose current group or any
2506supplementary group is one of those listed in the %trusted_groups%
2507configuration option. Note that the Exim group is not automatically trusted.
2508+
2509cindex:[``From'' line]
2510cindex:[envelope sender]
2511Trusted users are always permitted to use the %-f% option or a leading ``From ''
2512line to specify the envelope sender of a message that is passed to Exim through
2513the local interface (see the %-bm% and %-f% options below). See the
2514%untrusted_set_sender% option for a way of permitting non-trusted users to
2515set envelope senders.
2516+
2517cindex:['From:' header line]
2518cindex:['Sender:' header line]
2519For a trusted user, there is never any check on the contents of the 'From:'
2520header line, and a 'Sender:' line is never added. Furthermore, any existing
2521'Sender:' line in incoming local (non-TCP/IP) messages is not removed.
2522+
2523Trusted users may also specify a host name, host address, interface address,
2524protocol name, ident value, and authentication data when submitting a message
2525locally. Thus, they are able to insert messages into Exim's queue locally that
2526have the characteristics of messages received from a remote host. Untrusted
2527users may in some circumstances use %-f%, but can never set the other values
2528that are available to trusted users.
2529
2530- cindex:[user, admin definition of]
2531cindex:[admin user,definition of]
2532The admin users are root, the Exim user, and any user that is a member of the
2533Exim group or of any group listed in the %admin_groups% configuration option.
2534The current group does not have to be one of these groups.
2535+
2536Admin users are permitted to list the queue, and to carry out certain
2537operations on messages, for example, to force delivery failures. It is also
2538necessary to be an admin user in order to see the full information provided by
2539the Exim monitor, and full debugging output.
2540+
2541By default, the use of the %-M%, %-q%, %-R%, and %-S% options to cause Exim
2542to attempt delivery of messages on its queue is restricted to admin users.
2543However, this restriction can be relaxed by setting the %prod_requires_admin%
2544option false (that is, specifying %no_prod_requires_admin%).
2545+
2546Similarly, the use of the %-bp% option to list all the messages in the queue
2547is restricted to admin users unless %queue_list_requires_admin% is set
2548false.
2549
2550
2551*Warning*: If you configure your system so that admin users are able to
2552edit Exim's configuration file, you are giving those users an easy way of
2553getting root. There is further discussion of this issue at the start of chapter
2554<<CHAPconf>>.
2555
2556
2557
2558
2559Command line options
2560~~~~~~~~~~~~~~~~~~~~
2561The command options are described in alphabetical order below.
2562
2563///
2564We insert a stylized DocBook comment here, to identify the start of the command
2565line options. This is for the benefit of the Perl script that automatically
2566creates a man page for the options.
2567///
2568
2569++++
2570<!-- === Start of command line options === -->
2571++++
2572
2573
2574*{hh}*::
2575oindex:[{hh}]
2576cindex:[options, command line; terminating]
2577This is a pseudo-option whose only purpose is to terminate the options and
2578therefore to cause subsequent command line items to be treated as arguments
2579rather than options, even if they begin with hyphens.
2580
2581*--help*::
2582oindex:[%{hh}help%]
2583This option causes Exim to output a few sentences stating what it is.
2584The same output is generated if the Exim binary is called with no options and
2585no arguments.
2586
2587*-B*<'type'>::
2588oindex:[%-B%]
2589cindex:[8-bit characters]
2590cindex:[Sendmail compatibility,8-bit characters]
2591This is a Sendmail option for selecting 7 or 8 bit processing. Exim is 8-bit
2592clean; it ignores this option.
2593
2594*-bd*::
2595oindex:[%-bd%]
2596cindex:[daemon]
2597cindex:[SMTP listener]
2598cindex:[queue runner]
2599This option runs Exim as a daemon, awaiting incoming SMTP connections. Usually
2600the %-bd% option is combined with the %-q%<'time'> option, to specify that
2601the daemon should also initiate periodic queue runs.
2602+
2603The %-bd% option can be used only by an admin user. If either of the %-d%
2604(debugging) or %-v% (verifying) options are set, the daemon does not
2605disconnect from the controlling terminal. When running this way, it can be
2606stopped by pressing ctrl-C.
2607+
2608By default, Exim listens for incoming connections to the standard SMTP port on
2609all the host's running interfaces. However, it is possible to listen on other
2610ports, on multiple ports, and only on specific interfaces. Chapter
2611<<CHAPinterfaces>> contains a description of the options that control this.
2612+
2613When a listening daemon
2614cindex:[daemon,process id (pid)]
2615cindex:[pid (process id),of daemon]
2616is started without the use of %-oX% (that is, without overriding the normal
2617configuration), it writes its process id to a file called _exim-daemon.pid_ in
2618Exim's spool directory. This location can be overridden by setting
2619PID_FILE_PATH in _Local/Makefile_. The file is written while Exim is still
2620running as root.
2621+
2622When %-oX% is used on the command line to start a listening daemon, the
2623process id is not written to the normal pid file path. However, %-oP% can be
2624used to specify a path on the command line if a pid file is required.
2625+
2626The SIGHUP signal
2627cindex:[SIGHUP]
2628can be used to cause the daemon to re-exec itself. This should be done whenever
2629Exim's configuration file, or any file that is incorporated into it by means of
2630the %.include% facility, is changed, and also whenever a new version of Exim is
2631installed. It is not necessary to do this when other files that are referenced
2632from the configuration (for example, alias files) are changed, because these
2633are reread each time they are used.
2634
2635*-bdf*::
2636oindex:[%-bdf%]
2637This option has the same effect as %-bd% except that it never disconnects from
2638the controlling terminal, even when no debugging is specified.
2639
2640*-be*::
2641oindex:[%-be%]
2642cindex:[testing,string expansion]
2643cindex:[expansion,testing]
2644Run Exim in expansion testing mode. Exim discards its root privilege, to
2645prevent ordinary users from using this mode to read otherwise inaccessible
2646files. If no arguments are given, Exim runs interactively, prompting for lines
2647of data.
2648+
2649If Exim was built with USE_READLINE=yes in _Local/Makefile_, it tries
2650to load the %libreadline% library dynamically whenever the %-be% option is
2651used without command line arguments. If successful, it uses the 'readline()'
2652function, which provides extensive line-editing facilities, for reading the
2653test data. A line history is supported.
2654+
2655Long expansion expressions can be split over several lines by using backslash
068aaea8 2656continuations. As in Exim's run time configuration, white space at the start of
168e428f
PH
2657continuation lines is ignored. Each argument or data line is passed through the
2658string expansion mechanism, and the result is output. Variable values from the
2659configuration file (for example, $qualify_domain$) are available, but no
2660message-specific values (such as $domain$) are set, because no message is
2661being processed.
2662
2663*-bF*~<'filename'>::
2664oindex:[%-bF%]
2665cindex:[system filter,testing]
2666cindex:[testing,system filter]
2667This option is the same as %-bf% except that it assumes that the filter being
2668tested is a system filter. The additional commands that are available only in
2669system filters are recognized.
2670
2671*-bf*~<'filename'>::
2672oindex:[%-bf%]
2673cindex:[filter,testing]
2674cindex:[testing,filter file]
2675cindex:[forward file,testing]
2676cindex:[testing,forward file]
2677cindex:[Sieve filter,testing]
2678This option runs Exim in user filter testing mode; the file is the filter file
2679to be tested, and a test message must be supplied on the standard input. If
2680there are no message-dependent tests in the filter, an empty file can be
2681supplied.
2682+
2683If you want to test a system filter file, use %-bF% instead of %-bf%. You can
2684use both %-bF% and %-bf% on the same command, in order to
2685test a system filter and a user filter in the same run. For example:
2686
2687 exim -bF /system/filter -bf /user/filter </test/message
2688+
2689This is helpful when the system filter adds header lines or sets filter
2690variables that are used by the user filter.
2691+
2692If the test filter file does not begin with one of the special lines
2693
2694 # Exim filter
2695 # Sieve filter
2696+
2697it is taken to be a normal _.forward_ file, and is tested for validity under
2698that interpretation. See sections <<SECTitenonfilred>> to <<SECTspecitredli>> for a
2699description of the possible contents of non-filter redirection lists.
2700+
2701The result of an Exim command that uses %-bf%, provided no errors are
2702detected, is a list of the actions that Exim would try to take if presented
2703with the message for real. More details of filter testing are given in the
2704separate document entitled 'Exim's interfaces to mail filtering'.
2705+
2706When testing a filter file,
2707cindex:[``From'' line]
2708cindex:[envelope sender]
2709cindex:[%-f% option,for filter testing]
2710the envelope sender can be set by the %-f% option,
2711or by a ``From '' line at the start of the test message. Various parameters that
2712would normally be taken from the envelope recipient address of the message can
2713be set by means of additional command line options (see the next four options).
2714
2715*-bfd*~<'domain'>::
2716oindex:[%-bfd%]
068aaea8 2717cindex:[$qualify_domain$]
168e428f
PH
2718This sets the domain of the recipient address when a filter file is being
2719tested by means of the %-bf% option. The default is the value of
2720$qualify_domain$.
2721
2722*-bfl*~<'local~part'>::
2723oindex:[%-bfl%]
2724This sets the local part of the recipient address when a filter file is being
2725tested by means of the %-bf% option. The default is the username of the
2726process that calls Exim. A local part should be specified with any prefix or
2727suffix stripped, because that is how it appears to the filter when a message is
2728actually being delivered.
2729
2730*-bfp*~<'prefix'>::
2731oindex:[%-bfp%]
2732This sets the prefix of the local part of the recipient address when a filter
2733file is being tested by means of the %-bf% option. The default is an empty
2734prefix.
2735
2736*-bfs*~<'suffix'>::
2737oindex:[%-bfs%]
2738This sets the suffix of the local part of the recipient address when a filter
2739file is being tested by means of the %-bf% option. The default is an empty
2740suffix.
2741
2742*-bh*~<'IP~address'>::
2743oindex:[%-bh%]
2744cindex:[testing,incoming SMTP]
2745cindex:[SMTP,testing incoming]
2746cindex:[testing,relay control]
2747cindex:[relaying,testing configuration]
2748cindex:[policy control,testing]
2749cindex:[debugging,%-bh% option]
2750This option runs a fake SMTP session as if from the given IP address, using the
2751standard input and output. The IP address may include a port number at the end,
2752after a full stop. For example:
2753
2754 exim -bh 10.9.8.7.1234
2755 exim -bh fe80::a00:20ff:fe86:a061.5678
2756+
2757When an IPv6 address is given, it is converted into canonical form. In the case
2758of the second example above, the value of $sender_host_address$ after
2759conversion to the canonical form is `fe80:0000:0000:0a00:20ff:fe86:a061.5678`.
2760+
2761Comments as to what is going on are written to the standard error file. These
2762include lines beginning with ``LOG'' for anything that would have been logged.
2763This facility is provided for testing configuration options for incoming
2764messages, to make sure they implement the required policy. For example, you can
2765test your relay controls using %-bh%.
2766+
2767*Warning 1*:
2768cindex:[RFC 1413]
2769You cannot test features of the configuration that rely on
2770ident (RFC 1413) callouts. These cannot be done when testing using
2771%-bh% because there is no incoming SMTP connection.
2772+
2773*Warning 2*: Address verification callouts (see section <<SECTcallver>>) are
2774also skipped when testing using %-bh%. If you want these callouts to occur,
2775use %-bhc% instead.
2776+
2777Messages supplied during the testing session are discarded, and nothing is
2778written to any of the real log files. There may be pauses when DNS (and other)
2779lookups are taking place, and of course these may time out. The %-oMi% option
2780can be used to specify a specific IP interface and port if this is important.
2781+
2782The 'exim_checkaccess' utility is a ``packaged'' version of %-bh% whose
2783output just states whether a given recipient address from a given host is
2784acceptable or not. See section <<SECTcheckaccess>>.
2785
2786*-bhc*~<'IP~address'>::
2787oindex:[%-bhc%]
2788This option operates in the same way as %-bh%, except that address
2789verification callouts are performed if required. This includes consulting and
2790updating the callout cache database.
2791
2792*-bi*::
2793oindex:[%-bi%]
2794cindex:[alias file,building]
2795cindex:[building alias file]
2796cindex:[Sendmail compatibility,%-bi% option]
2797Sendmail interprets the %-bi% option as a request to rebuild its alias file.
2798Exim does not have the concept of a single alias file, and so it cannot mimic
2799this behaviour. However, calls to _/usr/lib/sendmail_ with the %-bi% option
2800tend to appear in various scripts such as NIS make files, so the option must be
2801recognized.
2802+
2803If %-bi% is encountered, the command specified by the %bi_command%
2804configuration option is run, under the uid and gid of the caller of Exim. If
2805the %-oA% option is used, its value is passed to the command as an argument.
2806The command set by %bi_command% may not contain arguments. The command can use
2807the 'exim_dbmbuild' utility, or some other means, to rebuild alias files if
2808this is required. If the %bi_command% option is not set, calling Exim with
2809%-bi% is a no-op.
2810
2811*-bm*::
2812oindex:[%-bm%]
2813cindex:[local message reception]
2814This option runs an Exim receiving process that accepts an incoming,
2815locally-generated message on the current input. The recipients are given as the
2816command arguments (except when %-t% is also present -- see below). Each
2817argument can be a comma-separated list of RFC 2822 addresses. This is the
2818default option for selecting the overall action of an Exim call; it is assumed
2819if no other conflicting option is present.
2820+
2821If any addresses in the message are unqualified (have no domain), they are
2822qualified by the values of the %qualify_domain% or %qualify_recipient%
2823options, as appropriate. The %-bnq% option (see below) provides a way of
2824suppressing this for special cases.
2825+
2826Policy checks on the contents of local messages can be enforced by means of
2827the non-SMTP ACL. See chapter <<CHAPACL>> for details.
2828+
2829The return code
2830cindex:[return code,for %-bm%]
2831is zero if the message is successfully accepted. Otherwise, the
2832action is controlled by the %-oe'x'% option setting -- see below.
2833+
2834The format
2835cindex:[message,format]
2836cindex:[format,message]
2837cindex:[``From'' line]
2838cindex:[UUCP,``From'' line]
2839cindex:[Sendmail compatibility,``From'' line]
2840of the message must be as defined in RFC 2822, except that, for
2841compatibility with Sendmail and Smail, a line in one of the forms
2842
2843 From sender Fri Jan 5 12:55 GMT 1997
2844 From sender Fri, 5 Jan 97 12:55:01
2845+
2846(with the weekday optional, and possibly with additional text after the date)
2847is permitted to appear at the start of the message. There appears to be no
2848authoritative specification of the format of this line. Exim recognizes it by
2849matching against the regular expression defined by the %uucp_from_pattern%
2850option, which can be changed if necessary.
2851+
2852The
2853cindex:[%-f% option,overriding ``From'' line]
2854specified sender is treated as if it were given as the argument to the
2855%-f% option, but if a %-f% option is also present, its argument is used in
2856preference to the address taken from the message. The caller of Exim must be a
2857trusted user for the sender of a message to be set in this way.
2858
2859*-bnq*::
2860oindex:[%-bnq%]
2861cindex:[address qualification, suppressing]
2862By default, Exim automatically qualifies unqualified addresses (those
2863without domains) that appear in messages that are submitted locally (that
2864is, not over TCP/IP). This qualification applies both to addresses in
2865envelopes, and addresses in header lines. Sender addresses are qualified using
2866%qualify_domain%, and recipient addresses using %qualify_recipient% (which
2867defaults to the value of %qualify_domain%).
2868+
2869Sometimes, qualification is not wanted. For example, if %-bS% (batch SMTP) is
2870being used to re-submit messages that originally came from remote hosts after
2871content scanning, you probably do not want to qualify unqualified addresses in
2872header lines. (Such lines will be present only if you have not enabled a header
2873syntax check in the appropriate ACL.)
2874+
2875The %-bnq% option suppresses all qualification of unqualified addresses in
2876messages that originate on the local host. When this is used, unqualified
2877addresses in the envelope provoke errors (causing message rejection) and
2878unqualified addresses in header lines are left alone.
2879
2880
2881*-bP*::
2882oindex:[%-bP%]
2883cindex:[configuration options, extracting]
2884cindex:[options,configuration -- extracting]
2885If this option is given with no arguments, it causes the values of all Exim's
2886main configuration options to be written to the standard output. The values
2887of one or more specific options can be requested by giving their names as
2888arguments, for example:
2889
2890 exim -bP qualify_domain hold_domains
2891+
2892However, any option setting that is preceded by the word ``hide'' in the
2893configuration file is not shown in full, except to an admin user. For other
2894users, the output is as in this example:
2895
2896 mysql_servers = <value not displayable>
2897+
2898If %configure_file% is given as an argument, the name of the run time
2899configuration file is output.
2900If a list of configuration files was supplied, the value that is output here
2901is the name of the file that was actually used.
2902+
2903cindex:[daemon,process id (pid)]
2904cindex:[pid (process id),of daemon]
2905If %log_file_path% or %pid_file_path% are given, the names of the directories
2906where log files and daemon pid files are written are output, respectively. If
2907these values are unset, log files are written in a sub-directory of the spool
2908directory called %log%, and the pid file is written directly into the spool
2909directory.
2910+
2911If %-bP% is followed by a name preceded by `+`, for example,
2912
2913 exim -bP +local_domains
2914+
2915it searches for a matching named list of any type (domain, host, address, or
2916local part) and outputs what it finds.
2917+
2918If
2919cindex:[options,router -- extracting]
2920cindex:[options,transport -- extracting]
2921one of the words %router%, %transport%, or %authenticator% is given,
2922followed by the name of an appropriate driver instance, the option settings for
2923that driver are output. For example:
2924
2925 exim -bP transport local_delivery
2926+
2927The generic driver options are output first, followed by the driver's private
2928options. A list of the names of drivers of a particular type can be obtained by
2929using one of the words %router_list%, %transport_list%, or
2930%authenticator_list%, and a complete list of all drivers with their option
2931settings can be obtained by using %routers%, %transports%, or %authenticators%.
2932
2933
2934*-bp*::
2935oindex:[%-bp%]
2936cindex:[queue,listing messages on]
2937cindex:[listing,messages on the queue]
2938This option requests a listing of the contents of the mail queue on the
2939standard output. If the %-bp% option is followed by a list of message ids,
2940just those messages are listed. By default, this option can be used only by an
2941admin user. However, the %queue_list_requires_admin% option can be set false
2942to allow any user to see the queue.
2943+
2944Each message on the queue is displayed as in the following example:
2945
2946 25m 2.9K 0t5C6f-0000c8-00 <alice@wonderland.fict.example>
2947 red.king@looking-glass.fict.example
2948 <other addresses>
2949+
2950The
2951cindex:[message,size in queue listing]
2952cindex:[size,of message]
2953first line contains the length of time the message has been on the queue
2954(in this case 25 minutes), the size of the message (2.9K), the unique local
2955identifier for the message, and the message sender, as contained in the
2956envelope. For bounce messages, the sender address is empty, and appears as
2957``<>''. If the message was submitted locally by an untrusted user who overrode
2958the default sender address, the user's login name is shown in parentheses
2959before the sender address.
2960+
2961If
2962cindex:[frozen messages,in queue listing]
2963the message is frozen (attempts to deliver it are suspended) then the text
2964``\*\*\* frozen \*\*\*'' is displayed at the end of this line.
2965+
2966The recipients of the message (taken from the envelope, not the headers) are
2967displayed on subsequent lines. Those addresses to which the message has already
2968been delivered are marked with the letter D. If an original address gets
2969expanded into several addresses via an alias or forward file, the original is
2970displayed with a D only when deliveries for all of its child addresses are
2971complete.
2972
2973
2974*-bpa*::
2975oindex:[%-bpa%]
2976This option operates like %-bp%, but in addition it shows delivered addresses
2977that were generated from the original top level address(es) in each message by
2978alias or forwarding operations. These addresses are flagged with ``+D'' instead
2979of just ``D''.
2980
2981
2982*-bpc*::
2983oindex:[%-bpc%]
2984cindex:[queue,count of messages on]
2985This option counts the number of messages on the queue, and writes the total
2986to the standard output. It is restricted to admin users, unless
2987%queue_list_requires_admin% is set false.
2988
2989
2990*-bpr*::
2991oindex:[%-bpr%]
2992This option operates like %-bp%, but the output is not sorted into
2993chronological order of message arrival. This can speed it up when there are
2994lots of messages on the queue, and is particularly useful if the output is
2995going to be post-processed in a way that doesn't need the sorting.
2996
2997*-bpra*::
2998oindex:[%-bpra%]
2999This option is a combination of %-bpr% and %-bpa%.
3000
3001*-bpru*::
3002oindex:[%-bpru%]
3003This option is a combination of %-bpr% and %-bpu%.
3004
3005
3006*-bpu*::
3007oindex:[%-bpu%]
3008This option operates like %-bp% but shows only undelivered top-level addresses
3009for each message displayed. Addresses generated by aliasing or forwarding are
3010not shown, unless the message was deferred after processing by a router with
3011the %one_time% option set.
3012
3013
3014*-brt*::
3015oindex:[%-brt%]
3016cindex:[testing,retry configuration]
3017cindex:[retry,configuration testing]
3018This option is for testing retry rules, and it must be followed by up to three
3019arguments. It causes Exim to look for a retry rule that matches the values
3020and to write it to the standard output. For example:
3021
3022 exim -brt bach.comp.mus.example
3023 Retry rule: *.comp.mus.example F,2h,15m; F,4d,30m;
3024+
3025See chapter <<CHAPretry>> for a description of Exim's retry rules. The first
3026argument, which is required, can be a complete address in the form
3027'local_part@domain', or it can be just a domain name. The second argument is
3028an optional second domain name; if no retry rule is found for the first
3029argument, the second is tried. This ties in with Exim's behaviour when looking
3030for retry rules for remote hosts -- if no rule is found that matches the host,
3031one that matches the mail domain is sought. The final argument is the name of a
3032specific delivery error, as used in setting up retry rules, for example
3033``quota_3d''.
3034
3035*-brw*::
3036oindex:[%-brw%]
3037cindex:[testing,rewriting]
3038cindex:[rewriting,testing]
3039This option is for testing address rewriting rules, and it must be followed by
3040a single argument, consisting of either a local part without a domain, or a
3041complete address with a fully qualified domain. Exim outputs how this address
3042would be rewritten for each possible place it might appear. See chapter
3043<<CHAPrewrite>> for further details.
3044
3045*-bS*::
3046oindex:[%-bS%]
3047cindex:[SMTP,batched incoming]
3048cindex:[batched SMTP input]
3049This option is used for batched SMTP input, which is an alternative interface
3050for non-interactive local message submission. A number of messages can be
3051submitted in a single run. However, despite its name, this is not really SMTP
3052input. Exim reads each message's envelope from SMTP commands on the standard
3053input, but generates no responses. If the caller is trusted, or
3054%untrusted_set_sender% is set, the senders in the SMTP MAIL commands are
3055believed; otherwise the sender is always the caller of Exim.
3056+
3057The message itself is read from the standard input, in SMTP format (leading
3058dots doubled), terminated by a line containing just a single dot. An error is
3059provoked if the terminating dot is missing. A further message may then follow.
3060+
3061As for other local message submissions, the contents of incoming batch SMTP
3062messages can be checked using the non-SMTP ACL (see chapter <<CHAPACL>>).
3063Unqualified addresses are automatically qualified using %qualify_domain% and
3064%qualify_recipient%, as appropriate, unless the %-bnq% option is used.
3065+
3066Some other SMTP commands are recognized in the input. HELO and EHLO act
3067as RSET; VRFY, EXPN, ETRN, and HELP act as NOOP;
3068QUIT quits, ignoring the rest of the standard input.
3069+
3070cindex:[return code,for %-bS%]
3071If any error is encountered, reports are written to the standard output and
3072error streams, and Exim gives up immediately. The return code is 0 if no error
3073was detected; it is 1 if one or more messages were accepted before the error
3074was detected; otherwise it is 2.
3075+
3076More details of input using batched SMTP are given in section
3077<<SECTincomingbatchedSMTP>>.
3078
3079*-bs*::
3080oindex:[%-bs%]
3081cindex:[SMTP,local input]
3082cindex:[local SMTP input]
3083This option causes Exim to accept one or more messages by reading SMTP commands
3084on the standard input, and producing SMTP replies on the standard output. SMTP
3085policy controls, as defined in ACLs (see chapter <<CHAPACL>>) are applied.
3086Some user agents use this interface as a way of passing locally-generated
3087messages to the MTA.
3088+
3089In
3090cindex:[sender,source of]
3091this usage, if the caller of Exim is trusted, or %untrusted_set_sender% is
3092set, the senders of messages are taken from the SMTP MAIL commands.
3093Otherwise the content of these commands is ignored and the sender is set up as
3094the calling user. Unqualified addresses are automatically qualified using
3095%qualify_domain% and %qualify_recipient%, as appropriate, unless the %-bnq%
3096option is used.
3097+
3098cindex:[inetd]
3099The
3100%-bs% option is also used to run Exim from 'inetd', as an alternative to using
3101a listening daemon. Exim can distinguish the two cases by checking whether the
3102standard input is a TCP/IP socket. When Exim is called from 'inetd', the source
3103of the mail is assumed to be remote, and the comments above concerning senders
3104and qualification do not apply. In this situation, Exim behaves in exactly the
3105same way as it does when receiving a message via the listening daemon.
3106
3107*-bt*::
3108oindex:[%-bt%]
3109cindex:[testing,addresses]
3110cindex:[address,testing]
3111This option runs Exim in address testing mode, in which each argument is taken
3112as an address to be tested for deliverability. The results are written to the
3113standard output. If a test fails, and the caller is not an admin user, no
3114details of the failure are output, because these might contain sensitive
3115information such as usernames and passwords for database lookups.
3116+
3117If no arguments are given, Exim runs in an interactive manner, prompting with a
3118right angle bracket for addresses to be tested.
3119+
3120Unlike the %-be% test option, you cannot arrange for Exim to use the
3121'readline()' function, because it is running as 'root' and there are
3122security issues.
3123+
3124Each address is handled as if it were the recipient address of a message
3125(compare the %-bv% option). It is passed to the routers and the result is
3126written to the standard output. However, any router that has
3127%no_address_test% set is bypassed. This can make %-bt% easier to use for
3128genuine routing tests if your first router passes everything to a scanner
3129program.
3130+
3131The
3132cindex:[return code,for %-bt%]
3133return code is 2 if any address failed outright; it is 1 if no address
3134failed outright but at least one could not be resolved for some reason. Return
3135code 0 is given only when all addresses succeed.
3136+
3137*Warning*: %-bt% can only do relatively simple testing. If any of the
3138routers in the configuration makes any tests on the sender address of a
3139message,
3140cindex:[%-f% option,for address testing]
3141you can use the %-f% option to set an appropriate sender when running
3142%-bt% tests. Without it, the sender is assumed to be the calling user at the
3143default qualifying domain. However, if you have set up (for example) routers
3144whose behaviour depends on the contents of an incoming message, you cannot test
3145those conditions using %-bt%. The %-N% option provides a possible way of
3146doing such tests.
3147
3148*-bV*::
3149oindex:[%-bV%]
3150cindex:[version number of Exim, verifying]
3151This option causes Exim to write the current version number, compilation
3152number, and compilation date of the 'exim' binary to the standard output.
3153It also lists the DBM library this is being used, the optional modules (such as
3154specific lookup types), the drivers that are included in the binary, and the
3155name of the run time configuration file that is in use.
3156+
3157As part of its operation, %-bV% causes Exim to read and syntax check its
3158configuration file. However, this is a static check only. It cannot check
3159values that are to be expanded. For example, although a misspelt ACL verb is
3160detected, an error in the verb's arguments is not. You cannot rely on %-bV%
3161alone to discover (for example) all the typos in the configuration; some
3162realistic testing is needed. The %-bh% and %-N% options provide more dynamic
3163testing facilities.
3164
3165*-bv*::
3166oindex:[%-bv%]
3167cindex:[verifying address, using %-bv%]
3168cindex:[address,verification]
3169This option runs Exim in address verification mode, in which each argument is
3170taken as an address to be verified. During normal operation, verification
3171happens mostly as a consequence processing a %verify% condition in an ACL (see
3172chapter <<CHAPACL>>). If you want to test an entire ACL, see the %-bh% option.
3173+
3174If verification fails, and the caller is not an admin user, no details of the
3175failure are output, because these might contain sensitive information such as
3176usernames and passwords for database lookups.
3177+
3178If no arguments are given, Exim runs in an interactive manner, prompting with a
3179right angle bracket for addresses to be verified.
3180+
3181Unlike the %-be% test option, you cannot arrange for Exim to use the
3182'readline()' function, because it is running as 'exim' and there are
3183security issues.
3184+
3185Verification differs from address testing (the %-bt% option) in that routers
3186that have %no_verify% set are skipped, and if the address is accepted by a
3187router that has %fail_verify% set, verification fails. The address is verified
3188as a recipient if %-bv% is used; to test verification for a sender address,
3189%-bvs% should be used.
3190+
3191If the %-v% option is not set, the output consists of a single line for each
3192address, stating whether it was verified or not, and giving a reason in the
3193latter case. Otherwise, more details are given of how the address has been
3194handled, and in the case of address redirection, all the generated addresses
3195are also considered. Without %-v%, generating more than one address by
3196redirection causes verification to end sucessfully.
3197+
3198The
3199cindex:[return code,for %-bv%]
3200return code is 2 if any address failed outright; it is 1 if no address
3201failed outright but at least one could not be resolved for some reason. Return
3202code 0 is given only when all addresses succeed.
3203+
3204If any of the routers in the configuration makes any tests on the sender
3205address of a message, you should use the %-f% option to set an appropriate
3206sender when running %-bv% tests. Without it, the sender is assumed to be the
3207calling user at the default qualifying domain.
3208
3209*-bvs*::
3210oindex:[%-bvs%]
3211This option acts like %-bv%, but verifies the address as a sender rather
3212than a recipient address. This affects any rewriting and qualification that
3213might happen.
3214
3215*-C*~<'filelist'>::
3216oindex:[%-C%]
3217cindex:[configuration file,alternate]
3218cindex:[CONFIGURE_FILE]
3219cindex:[alternate configuration file]
3220This option causes Exim to find the run time configuration file from the given
3221list instead of from the list specified by the CONFIGURE_FILE
3222compile-time setting. Usually, the list will consist of just a single file
3223name, but it can be a colon-separated list of names. In this case, the first
3224file that exists is used. Failure to open an existing file stops Exim from
3225proceeding any further along the list, and an error is generated.
3226+
3227When this option is used by a caller other than root or the Exim user, and the
3228list is different from the compiled-in list, Exim gives up its root privilege
3229immediately, and runs with the real and effective uid and gid set to those of
3230the caller. However, if ALT_CONFIG_ROOT_ONLY is defined in
3231_Local/Makefile_, root privilege is retained for %-C% only if the caller of
3232Exim is root.
3233+
3234That is, the Exim user is no longer privileged in this regard. This build-time
3235option is not set by default in the Exim source distribution tarbundle.
3236However, if you are using a ``packaged'' version of Exim (source or binary), the
3237packagers might have enabled it.
3238+
3239Setting ALT_CONFIG_ROOT_ONLY locks out the possibility of testing a
3240configuration using %-C% right through message reception and delivery, even if
3241the caller is root. The reception works, but by that time, Exim is running as
3242the Exim user, so when it re-execs to regain privilege for the delivery, the
3243use of %-C% causes privilege to be lost. However, root can test reception and
3244delivery using two separate commands (one to put a message on the queue, using
3245%-odq%, and another to do the delivery, using %-M%).
3246+
3247If ALT_CONFIG_PREFIX is defined _in Local/Makefile_, it specifies a
3248prefix string with which any file named in a %-C% command line option
3249must start. In addition, the file name must not contain the sequence `/../`.
3250However, if the value of the %-C% option is identical to the value of
3251CONFIGURE_FILE in _Local/Makefile_, Exim ignores %-C% and proceeds as
3252usual. There is no default setting for ALT_CONFIG_PREFIX; when it is
3253unset, any file name can be used with %-C%.
3254+
3255ALT_CONFIG_PREFIX can be used to confine alternative configuration files
3256to a directory to which only root has access. This prevents someone who has
3257broken into the Exim account from running a privileged Exim with an arbitrary
3258configuration file.
3259+
3260The %-C% facility is useful for ensuring that configuration files are
3261syntactically correct, but cannot be used for test deliveries, unless the
3262caller is privileged, or unless it is an exotic configuration that does not
3263require privilege. No check is made on the owner or group of the files
3264specified by this option.
3265
3266*-D*<'macro'>=<'value'>::
3267oindex:[%-D%]
3268cindex:[macro,setting on command line]
3269This option can be used to override macro definitions in the configuration file
3270(see section <<SECTmacrodefs>>). However, like %-C%, if it is used by an
3271unprivileged caller, it causes Exim to give up its root privilege.
3272If DISABLE_D_OPTION is defined in _Local/Makefile_, the use of %-D% is
3273completely disabled, and its use causes an immediate error exit.
3274+
3275The entire option (including equals sign if present) must all be within one
3276command line item. %-D% can be used to set the value of a macro to the empty
3277string, in which case the equals sign is optional. These two commands are
3278synonymous:
3279
3280 exim -DABC ...
3281 exim -DABC= ...
3282+
3283To include spaces in a macro definition item, quotes must be used. If you use
3284quotes, spaces are permitted around the macro name and the equals sign. For
3285example:
3286
3287 exim '-D ABC = something' ...
3288+
3289%-D% may be repeated up to 10 times on a command line.
3290
3291*-d*<'debug~options'>::
3292oindex:[%-d%]
3293cindex:[debugging,list of selectors]
3294cindex:[debugging,%-d% option]
3295This option causes debugging information to be written to the standard
3296error stream. It is restricted to admin users because debugging output may show
3297database queries that contain password information. Also, the details of users'
068aaea8
PH
3298filter files should be protected. When %-d% is used, %-v% is assumed. If %-d%
3299is given on its own, a lot of standard debugging data is output. This can be
3300reduced, or increased to include some more rarely needed information, by
3301directly following %-d% with a string made up of names preceded by plus or
3302minus characters. These add or remove sets of debugging data, respectively. For
168e428f 3303example, %-d+filter% adds filter debugging, whereas %-d-all+filter% selects
068aaea8
PH
3304only filter debugging. Note that no spaces are allowed in the debug setting.
3305The available debugging categories are:
168e428f
PH
3306+
3307&&&
3308`acl ` ACL interpretation
3309`auth ` authenticators
3310`deliver ` general delivery logic
3311`dns ` DNS lookups (see also resolver)
3312`dnsbl ` DNS black list (aka RBL) code
3313`exec ` arguments for ^^execv()^^ calls
3314`expand ` detailed debugging for string expansions
3315`filter ` filter handling
3316`hints_lookup ` hints data lookups
3317`host_lookup ` all types of name-to-IP address handling
3318`ident ` ident lookup
3319`interface ` lists of local interfaces
3320`lists ` matching things in lists
3321`load ` system load checks
3322`local_scan ` can be used by ^^local_scan()^^ (see chapter <<CHAPlocalscan>>)
3323`lookup ` general lookup code and all lookups
3324`memory ` memory handling
3325`pid ` add pid to debug output lines
3326`process_info ` setting info for the process log
3327`queue_run ` queue runs
3328`receive ` general message reception logic
3329`resolver ` turn on the DNS resolver's debugging output
3330`retry ` retry handling
3331`rewrite ` address rewriting
3332`route ` address routing
3333`timestamp ` add timestamp to debug output lines
3334`tls ` TLS logic
3335`transport ` transports
3336`uid ` changes of uid/gid and looking up uid/gid
3337`verify ` address verification logic
068aaea8 3338`all ` almost all of the above (see below), and also %-v%
168e428f
PH
3339&&&
3340+
068aaea8
PH
3341[revisionflag="changed"]
3342The `all` option excludes `memory` when used as `+all`, but includes it for
3343`-all`. The reason for this is that `+all` is something that people tend to use
3344when generating debug output for Exim maintainers. If `+memory` is included, an
3345awful lot of output that is very rarely of interest is generated, so it now has
3346to be explicitly requested. However, `-all` does turn everything off.
3347+
168e428f
PH
3348The
3349cindex:[resolver, debugging output]
3350cindex:[DNS resolver, debugging output]
3351`resolver` option produces output only if the DNS resolver was compiled
3352with DEBUG enabled. This is not the case in some operating systems. Also,
3353unfortunately, debugging output from the DNS resolver is written to stdout
3354rather than stderr.
3355+
3356The default (%-d% with no argument) omits `expand`, `filter`,
3357`interface`, `load`, `memory`, `pid`, `resolver`, and `timestamp`.
3358However, the `pid` selector is forced when debugging is turned on for a
3359daemon, which then passes it on to any re-executed Exims. Exim also
3360automatically adds the pid to debug lines when several remote deliveries are
3361run in parallel.
3362+
3363The `timestamp` selector causes the current time to be inserted at the start
3364of all debug output lines. This can be useful when trying to track down delays
3365in processing.
3366+
3367If the %debug_print% option is set in any driver, it produces output whenever
3368any debugging is selected, or if %-v% is used.
3369
3370*-dd*<'debug~options'>::
3371oindex:[%-dd%]
3372This option behaves exactly like %-d% except when used on a command that
3373starts a daemon process. In that case, debugging is turned off for the
3374subprocesses that the daemon creates. Thus, it is useful for monitoring the
3375behaviour of the daemon without creating as much output as full debugging does.
3376
3377*-dropcr*::
3378oindex:[%-dropcr%]
3379This is an obsolete option that is now a no-op. It used to affect the way Exim
3380handled CR and LF characters in incoming messages. What happens now is
3381described in section <<SECTlineendings>>.
3382
3383*-E*::
3384oindex:[%-E%]
3385cindex:[bounce message,generating]
3386This option specifies that an incoming message is a locally-generated delivery
3387failure report. It is used internally by Exim when handling delivery failures
3388and is not intended for external use. Its only effect is to stop Exim
3389generating certain messages to the postmaster, as otherwise message cascades
3390could occur in some situations. As part of the same option, a message id may
3391follow the characters %-E%. If it does, the log entry for the receipt of the
3392new message contains the id, following ``R='', as a cross-reference.
3393
3394*-e*'x'::
3395oindex:[%-e'x'%]
3396There are a number of Sendmail options starting with %-oe% which seem to be
3397called by various programs without the leading %o% in the option. For example,
3398the %vacation% program uses %-eq%. Exim treats all options of the form
3399%-e'x'% as synonymous with the corresponding %-oe'x'% options.
3400
3401*-F*~<'string'>::
3402oindex:[%-F%]
3403cindex:[sender,name]
3404cindex:[name,of sender]
3405This option sets the sender's full name for use when a locally-generated
3406message is being accepted. In the absence of this option, the user's 'gecos'
3407entry from the password data is used. As users are generally permitted to alter
3408their 'gecos' entries, no security considerations are involved. White space
3409between %-F% and the <'string'> is optional.
3410
3411*-f*~<'address'>::
3412oindex:[%-f%]
3413cindex:[sender,address]
3414cindex:[address,sender]
3415cindex:[trusted user]
3416cindex:[envelope sender]
3417cindex:[user,trusted]
3418This option sets the address of the envelope sender of a locally-generated
3419message (also known as the return path). The option can normally be used only
3420by a trusted user, but %untrusted_set_sender% can be set to allow untrusted
3421users to use it.
3422+
3423Processes running as root or the Exim user are always trusted. Other
3424trusted users are defined by the %trusted_users% or %trusted_groups% options.
3425In the absence of %-f%, or if the caller is not trusted, the sender of a local
3426message is set to the caller's login name at the default qualify domain.
3427+
3428There is one exception to the restriction on the use of %-f%: an empty sender
3429can be specified by any user, trusted or not, to create a message that can
3430never provoke a bounce. An empty sender can be specified either as an empty
3431string, or as a pair of angle brackets with nothing between them, as in these
3432examples of shell commands:
3433
3434 exim -f '<>' user@domain
3435 exim -f "" user@domain
3436+
3437In addition, the use of %-f% is not restricted when testing a filter file with
3438%-bf% or when testing or verifying addresses using the %-bt% or %-bv%
3439options.
3440+
3441Allowing untrusted users to change the sender address does not of itself make
3442it possible to send anonymous mail. Exim still checks that the 'From:' header
3443refers to the local user, and if it does not, it adds a 'Sender:' header,
3444though this can be overridden by setting %no_local_from_check%.
3445+
3446White
3447cindex:[``From'' line]
3448space between %-f% and the <'address'> is optional (that is, they can be given
3449as two arguments or one combined argument). The sender of a locally-generated
3450message can also be set (when permitted) by an initial ``From '' line in the
3451message -- see the description of %-bm% above -- but if %-f% is also present,
3452it overrides ``From''.
3453
3454*-G*::
3455oindex:[%-G%]
3456cindex:[Sendmail compatibility,%-G% option ignored]
3457This is a Sendmail option which is ignored by Exim.
3458
3459*-h*~<'number'>::
3460oindex:[%-h%]
3461cindex:[Sendmail compatibility,%-h% option ignored]
3462This option is accepted for compatibility with Sendmail, but has no effect. (In
3463Sendmail it overrides the ``hop count'' obtained by counting 'Received:'
3464headers.)
3465
3466*-i*::
3467oindex:[%-i%]
3468cindex:[Solaris,'mail' command]
3469cindex:[dot in incoming, non-SMTP message]
3470This option, which has the same effect as %-oi%, specifies that a dot on a line
3471by itself should not terminate an incoming, non-SMTP message. I can find no
3472documentation for this option in Solaris 2.4 Sendmail, but the 'mailx' command
3473in Solaris 2.4 uses it. See also %-ti%.
3474
3475*-M*~<'message~id'>~<'message~id'>~...::
3476oindex:[%-M%]
3477cindex:[forcing delivery]
3478cindex:[delivery,forcing attempt]
3479cindex:[frozen messages,forcing delivery]
3480This option requests Exim to run a delivery attempt on each message in turn. If
3481any of the messages are frozen, they are automatically thawed before the
3482delivery attempt. The settings of %queue_domains%, %queue_smtp_domains%, and
3483%hold_domains% are ignored.
3484+
3485Retry
3486cindex:[hints database,overriding retry hints]
3487hints for any of the addresses are overridden -- Exim tries to deliver even if
3488the normal retry time has not yet been reached. This option requires the caller
3489to be an admin user. However, there is an option called %prod_requires_admin%
3490which can be set false to relax this restriction (and also the same requirement
3491for the %-q%, %-R%, and %-S% options).
068aaea8
PH
3492+
3493[revisionflag="changed"]
3494The deliveries happen synchronously, that is, the original Exim process does
3495not terminate until all the delivery attempts have finished. No output is
3496produced unless there is a serious error. If you want to see what is happening,
3497use the %-v% option as well, or inspect Exim's main log.
168e428f
PH
3498
3499*-Mar*~<'message~id'>~<'address'>~<'address'>~...::
3500oindex:[%-Mar%]
3501cindex:[message,adding recipients]
3502cindex:[recipient,adding]
3503This option requests Exim to add the addresses to the list of recipients of the
3504message (``ar'' for ``add recipients''). The first argument must be a message id,
3505and the remaining ones must be email addresses. However, if the message is
3506active (in the middle of a delivery attempt), it is not altered. This option
3507can be used only by an admin user.
3508
3509*-MC*~<'transport'>~<'hostname'>~<'sequence~number'>~<'message~id'>::
3510oindex:[%-MC%]
3511cindex:[SMTP,passed connection]
3512cindex:[SMTP,multiple deliveries]
3513cindex:[multiple SMTP deliveries]
3514This option is not intended for use by external callers. It is used internally
3515by Exim to invoke another instance of itself to deliver a waiting message using
3516an existing SMTP connection, which is passed as the standard input. Details are
3517given in chapter <<CHAPSMTP>>. This must be the final option, and the caller must
3518be root or the Exim user in order to use it.
3519
3520*-MCA*::
3521oindex:[%-MCA%]
3522This option is not intended for use by external callers. It is used internally
3523by Exim in conjunction with the %-MC% option. It signifies that the connection
3524to the remote host has been authenticated.
3525
3526*-MCP*::
3527oindex:[%-MCP%]
3528This option is not intended for use by external callers. It is used internally
3529by Exim in conjunction with the %-MC% option. It signifies that the server to
3530which Exim is connected supports pipelining.
3531
3532*-MCQ*~<'process~id'>~<'pipe~fd'>::
3533oindex:[%-MCQ%]
3534This option is not intended for use by external callers. It is used internally
3535by Exim in conjunction with the %-MC% option when the original delivery was
3536started by a queue runner. It passes on the process id of the queue runner,
3537together with the file descriptor number of an open pipe. Closure of the pipe
3538signals the final completion of the sequence of processes that are passing
3539messages through the same SMTP connection.
3540
3541*-MCS*::
3542oindex:[%-MCS%]
3543This option is not intended for use by external callers. It is used internally
3544by Exim in conjunction with the %-MC% option, and passes on the fact that the
3545SMTP SIZE option should be used on messages delivered down the existing
3546connection.
3547
3548*-MCT*::
3549oindex:[%-MCT%]
3550This option is not intended for use by external callers. It is used internally
3551by Exim in conjunction with the %-MC% option, and passes on the fact that the
3552host to which Exim is connected supports TLS encryption.
3553
3554*-Mc*~<'message~id'>~<'message~id'>~...::
3555oindex:[%-Mc%]
3556cindex:[hints database,not overridden by %-Mc%]
3557cindex:[delivery,manually started -- not forced]
3558This option requests Exim to run a delivery attempt on each message in turn,
3559but unlike the %-M% option, it does check for retry hints, and respects any
3560that are found. This option is not very useful to external callers. It is
3561provided mainly for internal use by Exim when it needs to re-invoke itself in
3562order to regain root privilege for a delivery (see chapter <<CHAPsecurity>>).
3563However, %-Mc% can be useful when testing, in order to run a delivery that
3564respects retry times and other options such as %hold_domains% that are
3565overridden when %-M% is used. Such a delivery does not count as a queue run.
3566If you want to run a specific delivery as if in a queue run, you should use
3567%-q% with a message id argument. A distinction between queue run deliveries
3568and other deliveries is made in one or two places.
3569
3570*-Mes*~<'message~id'>~<'address'>::
3571oindex:[%-Mes%]
3572cindex:[message,changing sender]
3573cindex:[sender,changing]
3574This option requests Exim to change the sender address in the message to the
3575given address, which must be a fully qualified address or ``<>'' (``es'' for ``edit
3576sender''). There must be exactly two arguments. The first argument must be a
3577message id, and the second one an email address. However, if the message is
3578active (in the middle of a delivery attempt), its status is not altered. This
3579option can be used only by an admin user.
3580
3581*-Mf*~<'message~id'>~<'message~id'>~...::
3582oindex:[%-Mf%]
3583cindex:[freezing messages]
3584cindex:[message,manually freezing]
3585This option requests Exim to mark each listed message as ``frozen''. This
3586prevents any delivery attempts taking place until the message is ``thawed'',
3587either manually or as a result of the %auto_thaw% configuration option.
3588However, if any of the messages are active (in the middle of a delivery
3589attempt), their status is not altered. This option can be used only by an admin
3590user.
3591
3592*-Mg*~<'message~id'>~<'message~id'>~...::
3593oindex:[%-Mg%]
3594cindex:[giving up on messages]
3595cindex:[message,abandoning delivery attempts]
3596cindex:[delivery,abandoning further attempts]
3597This option requests Exim to give up trying to deliver the listed messages,
3598including any that are frozen. However, if any of the messages are active,
3599their status is not altered. For non-bounce messages, a delivery error message
3600is sent to the sender, containing the text ``cancelled by administrator''.
3601Bounce messages are just discarded. This option can be used only by an admin
3602user.
3603
3604*-Mmad*~<'message~id'>~<'message~id'>~...::
3605oindex:[%-Mmad%]
3606cindex:[delivery,cancelling all]
3607This option requests Exim to mark all the recipient addresses in the messages
3608as already delivered (``mad'' for ``mark all delivered''). However, if any
3609message is active (in the middle of a delivery attempt), its status is not
3610altered. This option can be used only by an admin user.
3611
3612*-Mmd*~<'message~id'>~<'address'>~<'address'>~...::
3613oindex:[%-Mmd%]
3614cindex:[delivery,cancelling by address]
3615cindex:[recipient,removing]
3616cindex:[removing recipients]
3617This option requests Exim to mark the given addresses as already delivered
3618(``md'' for ``mark delivered''). The first argument must be a message id, and
3619the remaining ones must be email addresses. These are matched to recipient
3620addresses in the message in a case-sensitive manner. If the message is active
3621(in the middle of a delivery attempt), its status is not altered. This option
3622can be used only by an admin user.
3623
3624*-Mrm*~<'message~id'>~<'message~id'>~...::
3625oindex:[%-Mrm%]
3626cindex:[removing messages]
3627cindex:[abandoning mail]
3628cindex:[message,manually discarding]
3629This option requests Exim to remove the given messages from the queue. No
3630bounce messages are sent; each message is simply forgotten. However, if any of
3631the messages are active, their status is not altered. This option can be used
3632only by an admin user or by the user who originally caused the message to be
3633placed on the queue.
3634
3635*-Mt*~<'message~id'>~<'message~id'>~...::
3636oindex:[%-Mt%]
3637cindex:[thawing messages]
3638cindex:[unfreezing messages]
3639cindex:[frozen messages,thawing]
3640cindex:[message,thawing frozen]
3641This option requests Exim to ``thaw'' any of the listed messages that are
3642``frozen'', so that delivery attempts can resume. However, if any of the messages
3643are active, their status is not altered. This option can be used only by an
3644admin user.
3645
3646*-Mvb*~<'message~id'>::
3647oindex:[%-Mvb%]
3648cindex:[listing,message body]
3649cindex:[message,listing body of]
3650This option causes the contents of the message body (-D) spool file to be
3651written to the standard output. This option can be used only by an admin user.
3652
3653*-Mvh*~<'message~id'>::
3654oindex:[%-Mvh%]
3655cindex:[listing,message headers]
3656cindex:[header lines,listing]
3657cindex:[message,listing header lines]
3658This option causes the contents of the message headers (-H) spool file to be
3659written to the standard output. This option can be used only by an admin user.
3660
3661*-Mvl*~<'message~id'>::
3662oindex:[%-Mvl%]
3663cindex:[listing,message log]
3664cindex:[message,listing message log]
3665This option causes the contents of the message log spool file to be written to
3666the standard output. This option can be used only by an admin user.
3667
3668*-m*::
3669oindex:[%-m%]
3670This is apparently a synonym for %-om% that is accepted by Sendmail, so Exim
3671treats it that way too.
3672
3673*-N*::
3674oindex:[%-N%]
3675cindex:[debugging,%-N% option]
3676cindex:[debugging,suppressing delivery]
3677This is a debugging option that inhibits delivery of a message at the transport
3678level. It implies %-v%. Exim goes through many of the motions of delivery --
3679it just doesn't actually transport the message, but instead behaves as if it
3680had successfully done so. However, it does not make any updates to the retry
3681database, and the log entries for deliveries are flagged with ``\*>'' rather
3682than ``=>''.
3683+
3684Because %-N% discards any message to which it applies, only root or the Exim
3685user are allowed to use it with %-bd%, %-q%, %-R% or %-M%. In other words,
3686an ordinary user can use it only when supplying an incoming message to which it
3687will apply. Although transportation never fails when %-N% is set, an address
3688may be deferred because of a configuration problem on a transport, or a routing
3689problem. Once %-N% has been used for a delivery attempt, it sticks to the
3690message, and applies to any subsequent delivery attempts that may happen for
3691that message.
3692
3693*-n*::
3694oindex:[%-n%]
3695cindex:[Sendmail compatibility,%-n% option ignored]
3696This option is interpreted by Sendmail to mean ``no aliasing''. It is ignored by
3697Exim.
3698
3699*-O*~<'data'>::
3700oindex:[%-O%]
3701This option is interpreted by Sendmail to mean `set option`. It is ignored by
3702Exim.
3703
3704*-oA*~<'file~name'>::
3705oindex:[%-oA%]
3706cindex:[Sendmail compatibility,%-oA% option]
3707This option is used by Sendmail in conjunction with %-bi% to specify an
3708alternative alias file name. Exim handles %-bi% differently; see the
3709description above.
3710
3711*-oB*~<'n'>::
3712oindex:[%-oB%]
3713cindex:[SMTP,passed connection]
3714cindex:[SMTP,multiple deliveries]
3715cindex:[multiple SMTP deliveries]
3716This is a debugging option which limits the maximum number of messages that can
3717be delivered down one SMTP connection, overriding the value set in any ^smtp^
3718transport. If <'n'> is omitted, the limit is set to 1.
3719
3720*-odb*::
3721oindex:[%-odb%]
3722cindex:[background delivery]
3723cindex:[delivery,in the background]
3724This option applies to all modes in which Exim accepts incoming messages,
3725including the listening daemon. It requests ``background'' delivery of such
3726messages, which means that the accepting process automatically starts a
3727delivery process for each message received, but does not wait for the delivery
3728processes to finish.
3729+
3730When all the messages have been received, the reception process exits,
3731leaving the delivery processes to finish in their own time. The standard output
3732and error streams are closed at the start of each delivery process.
3733This is the default action if none of the %-od% options are present.
3734+
3735If one of the queueing options in the configuration file
3736(%queue_only% or %queue_only_file%, for example) is in effect, %-odb%
3737overrides it if %queue_only_override% is set true, which is the default
3738setting. If %queue_only_override% is set false, %-odb% has no effect.
3739
3740*-odf*::
3741oindex:[%-odf%]
3742cindex:[foreground delivery]
3743cindex:[delivery,in the foreground]
3744This option requests ``foreground'' (synchronous) delivery when Exim has accepted
3745a locally-generated message. (For the daemon it is exactly the same as
3746%-odb%.) A delivery process is automatically started to deliver the
3747message, and Exim waits for it to complete before proceeding.
3748+
3749The original Exim reception process does not finish until the delivery
3750process for the final message has ended. The standard error stream is left open
3751during deliveries.
3752+
3753However, like %-odb%, this option has no effect if %queue_only_override% is
3754false and one of the queueing options in the configuration file is in effect.
3755+
3756If there is a temporary delivery error during foreground delivery, the
3757message is left on the queue for later delivery, and the original reception
068aaea8 3758process exits. See chapter <<CHAPnonqueueing>> for a way of setting up a
168e428f
PH
3759restricted configuration that never queues messages.
3760
3761
3762*-odi*::
3763oindex:[%-odi%]
3764This option is synonymous with %-odf%. It is provided for compatibility with
3765Sendmail.
3766
3767*-odq*::
3768oindex:[%-odq%]
3769cindex:[non-immediate delivery]
3770cindex:[delivery,suppressing immediate]
3771cindex:[queueing incoming messages]
3772This option applies to all modes in which Exim accepts incoming messages,
3773including the listening daemon. It specifies that the accepting process should
3774not automatically start a delivery process for each message received. Messages
3775are placed on the queue, and remain there until a subsequent queue runner
3776process encounters them. There are several configuration options (such as
3777%queue_only%) that can be used to queue incoming messages under certain
3778conditions. This option overrides all of them and also %-odqs%. It always
3779forces queueing.
3780
3781*-odqs*::
3782oindex:[%-odqs%]
3783cindex:[SMTP,delaying delivery]
3784This option is a hybrid between %-odb%/%-odi% and %-odq%.
3785However, like %-odb% and %-odi%, this option has no effect if
3786%queue_only_override% is false and one of the queueing options in the
3787configuration file is in effect.
3788+
3789When %-odqs% does operate, a delivery process is started for each incoming
3790message, in the background by default, but in the foreground if %-odi% is also
3791present. The recipient addresses are routed, and local deliveries are done in
3792the normal way. However, if any SMTP deliveries are required, they are not done
3793at this time, so the message remains on the queue until a subsequent queue
3794runner process encounters it. Because routing was done, Exim knows which
3795messages are w