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