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