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