added note about manual and spec
[exim-website.git] / FAQ.html
1 <HTML>
2 <HEAD>
3 <TITLE>Exim FAQ</TITLE>
4 </HEAD>
5 <body bgcolor="#FFFFFF" text="#00005A">
6 <H1>Exim FAQ</H1>
7 <P>
8 This is the FAQ for the Exim Mail Transfer Agent. Thanks to the many
9 people who provided the original information. This file would be amazingly
10 cluttered if I tried to list them all. Suggestions for corrections,
11 improvements, and additions are welcome.
12
13 </P>
14 <P>
15 This version of the FAQ applies to Exim 3.20 and later releases. The syntax of
16 some of the options was altered and tidied up at release 3.00. Some of the
17 examples quoted here will not work with earlier releases.
18
19 </P>
20 <P>
21 References of the form Cnnn and Fnnn are to the sample configuration and filter
22 files that can be found in the separately distributed directory called
23 <B>config.samples.</B> The primary location is
24
25 </P>
26 <PRE>
27    <A HREF="ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim3/config.samples.tar.gz">ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim3/config.samples.tar.gz</A>
28    <A HREF="ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim3/config.samples.tar.bz2">ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim3/config.samples.tar.bz2</A></PRE>
29 <P>
30 There are brief descriptions of these files at the end of this document.
31
32 </P>
33 The FAQ is divided into the following sections:
34 <A HREF="FAQ.html#TOC1">Debugging</A>,
35 <A HREF="FAQ.html#TOC49">Building exim</A>,
36 <A HREF="FAQ.html#TOC64">Mailbox locking</A>,
37 <A HREF="FAQ.html#TOC67">Routing</A>,
38 <A HREF="FAQ.html#TOC94">Directing</A>,
39 <A HREF="FAQ.html#TOC141">Delivery</A>,
40 <A HREF="FAQ.html#TOC182">UUCP</A>,
41 <A HREF="FAQ.html#TOC186">Performance</A>,
42 <A HREF="FAQ.html#TOC191">Policy controls</A>,
43 <A HREF="FAQ.html#TOC232">Majordomo</A>,
44 <A HREF="FAQ.html#TOC238">Rewriting addresses</A>,
45 <A HREF="FAQ.html#TOC246">Headers</A>,
46 <A HREF="FAQ.html#TOC252">Fetchmail</A>,
47 <A HREF="FAQ.html#TOC256">Perl</A>,
48 <A HREF="FAQ.html#TOC259">Dial-up</A>,
49 <A HREF="FAQ.html#TOC264">Modifying message bodies</A>,
50 <A HREF="FAQ.html#TOC267">Millennium</A>,
51 <A HREF="FAQ.html#TOC269">Miscellaneous</A>,
52 <A HREF="FAQ.html#TOC321">HP-UX</A>,
53 <A HREF="FAQ.html#TOC323">BSDI</A>,
54 <A HREF="FAQ.html#TOC325">IRIX</A>,
55 <A HREF="FAQ.html#TOC328">Linux</A>,
56 <A HREF="FAQ.html#TOC337">Sun systems</A>,
57 <A HREF="FAQ.html#TOC347">Cookbook</A>, and
58 <A HREF="FAQ.html#TOC372">List of sample configurations</A>.
59 <P>
60 Philip Hazel <B><B>&#60;ph10@cus.cam.ac.uk</B>&#62;</B><BR>
61 Last update: 23-April-2001<BR>
62 <BR>
63 </P>
64 <HR><BR>
65 <A NAME="TOC1" HREF="FAQ.html#SEC1">0. DEBUGGING</A>
66 <UL>
67 <LI><A NAME="TOC2" HREF="FAQ.html#SEC2">Q0001</A>: Exim is crashing. What is wrong?
68 <LI><A NAME="TOC3" HREF="FAQ.html#SEC3">Q0002</A>: Exim is not working. What is wrong? How can I check what it is doing?
69 <LI><A NAME="TOC4" HREF="FAQ.html#SEC4">Q0003</A>: What does the error "Child process of <TT>address_pipe</TT> transport returned
70        69 from command <I>xxx</I>" mean?
71 <LI><A NAME="TOC5" HREF="FAQ.html#SEC5">Q0004</A>: My virtual domain setup isn't working. How can I debug it?
72 <LI><A NAME="TOC6" HREF="FAQ.html#SEC6">Q0005</A>: Why is Exim giving "421 Unexpected log failure, please try later" when
73        receiving an SMTP message with a large number of recipients?
74 <LI><A NAME="TOC7" HREF="FAQ.html#SEC7">Q0006</A>: Why is Exim not rejecting incoming messages addressed to non-existent
75        users at SMTP time?
76 <LI><A NAME="TOC8" HREF="FAQ.html#SEC8">Q0007</A>: I've put an entry for <B>*.my.domain</B> in a DBM lookup file, but it isn't
77        getting recognized.
78 <LI><A NAME="TOC9" HREF="FAQ.html#SEC9">Q0008</A>: I've put the entry <B><B>*@domain.com</B></B> in a lookup database, but it isn't
79        working. The expansion I'm using is:
80 <LI><A NAME="TOC10" HREF="FAQ.html#SEC10">Q0009</A>: Is there a way to print recognized local domains?
81 <LI><A NAME="TOC11" HREF="FAQ.html#SEC11">Q0010</A>: If I run <B>"./exim</B> <B>-d9</B> <B>-bt</B> <B>user@domain</B>" all seems well, but when I send a
82        message from my User Agent, it does not arrive at its destination.
83 <LI><A NAME="TOC12" HREF="FAQ.html#SEC12">Q0011</A>: I am getting this message in mainlog every so often: "no immediate
84        delivery: too many connections (19, max 0)". What am I missing?
85 <LI><A NAME="TOC13" HREF="FAQ.html#SEC13">Q0012</A>: What does "no immediate delivery: too many messages received in one SMTP
86        connection" mean?
87 <LI><A NAME="TOC14" HREF="FAQ.html#SEC14">Q0013</A>: Exim puts "for &#60;address&#62;" in the Received: headers of some, but not all,
88        messages. Is this a bug?
89 <LI><A NAME="TOC15" HREF="FAQ.html#SEC15">Q0014</A>: Instead of <TT>exim_dbmbuild</TT>, I'm using a homegrown program to build DBM
90        (or cdb) files, but Exim doesn't seem to be able to use them.
91 <LI><A NAME="TOC16" HREF="FAQ.html#SEC16">Q0015</A>: Exim is unable to route to any remote domains. It doesn't seen to be
92        able to access the DNS.
93 <LI><A NAME="TOC17" HREF="FAQ.html#SEC17">Q0016</A>: I'm using ETRN to run a script that checks things and doesn't always
94        end up running "exim <B><B>-R".</B></B> However, after it has run once, subsequent
95        attempts fail with "458 Already processing".
96 <LI><A NAME="TOC18" HREF="FAQ.html#SEC18">Q0017</A>: What does the error message "transport <TT>system_aliases</TT>: cannot find
97        transport driver "<B>aliasfile</B>" in line 92" mean?
98 <LI><A NAME="TOC19" HREF="FAQ.html#SEC19">Q0018</A>: Exim is timing out after receiving and responding to the DATA command
99        from one particular host, and yet the client host also claims to be
100        timing out. This seems to affect only certain messages.
101 <LI><A NAME="TOC20" HREF="FAQ.html#SEC20">Q0019</A>: What does the message "Socket bind() to port 25 for address (any)
102        failed: address already in use" mean?
103 <LI><A NAME="TOC21" HREF="FAQ.html#SEC21">Q0020</A>: I've set <TT>headers_check_syntax</TT>, but this causes Exim to complain about
104        headers like "To: Work: Jim <B>&#60;jims@email</B>&#62;, Home: Bob <B>&#60;bobs@email</B>&#62;" which
105        look all right to me. Is this a bug?
106 <LI><A NAME="TOC22" HREF="FAQ.html#SEC22">Q0021</A>: Whenever Exim tries to deliver a specific message to a particular
107        server, it fails, giving the error "Remote end closed connection after
108        data" or "Broken pipe" or a timeout. What's going on?
109 <LI><A NAME="TOC23" HREF="FAQ.html#SEC23">Q0022</A>: Why do messages not get delivered down the same connection when I do
110        something like: exim <B>-v</B> <B>-R</B> <B>@aol.com</B> ? For other domains, I do this and
111        I see the appropriate "waiting for passed connections to get used"
112        messages.
113 <LI><A NAME="TOC24" HREF="FAQ.html#SEC24">Q0023</A>: What does the error "SEGV while reading ... from dbm file: record
114        assumed not to exist" mean?
115 <LI><A NAME="TOC25" HREF="FAQ.html#SEC25">Q0024</A>: There seems to be a problem in the string expansion code: it doesn't
116        recognize references to headers such as <B><B>${h_to}.</B></B>
117 <LI><A NAME="TOC26" HREF="FAQ.html#SEC26">Q0025</A>: Exim is timing out after sending the a message's data to one particular
118        host, and yet the remote host also claims to be timing out. This seems
119        to affect only certain messages.
120 <LI><A NAME="TOC27" HREF="FAQ.html#SEC27">Q0026</A>: When the Exim daemon forks a copy of itself to handle an incoming SMTP
121        request, the forked copy seems to go around in circles  for a
122        significant (up to 5 minutes, so far) amount of time before deciding to
123        accept the message.
124 <LI><A NAME="TOC28" HREF="FAQ.html#SEC28">Q0027</A>: What does "failed to create child process to send failure message" mean?
125        This is a busy mail server with <TT>smtp_accept_max</TT> set to 500, but this
126        problem started to occur at about 300 incoming connections.
127 <LI><A NAME="TOC29" HREF="FAQ.html#SEC29">Q0028</A>: What does "&#60;message filter&#62; transporting defer (-1): No transport set
128        by director" in a log line mean?
129 <LI><A NAME="TOC30" HREF="FAQ.html#SEC30">Q0029</A>: Why is Exim refusing to relay, saying "failed to find host name from IP
130        address" when I have the sender's IP address in <TT>host_accept_relay</TT>? My
131        configuration contains this:
132 <LI><A NAME="TOC31" HREF="FAQ.html#SEC31">Q0030</A>: When I run "exim <B>-bd</B> <B>-q10m"</B> I get "PANIC LOG: exec of exim <B>-q</B> failed".
133 <LI><A NAME="TOC32" HREF="FAQ.html#SEC32">Q0031</A>: Why do connections to my machine's SMTP port take a long time to respond
134        with the banner, when connections to other ports respond instantly?
135 <LI><A NAME="TOC33" HREF="FAQ.html#SEC33">Q0032</A>: I can't seem to get a pipe command to run when I include a <B>${if</B>
136        expansion in it. This fails:
137 <LI><A NAME="TOC34" HREF="FAQ.html#SEC34">Q0033</A>: I'm trying to get Exim to connect an alias to a pipe, but it always
138        gives error code 69, with the comment "(could mean service or program
139        unavailable)".
140 <LI><A NAME="TOC35" HREF="FAQ.html#SEC35">Q0034</A>: I'm having a problem with an Exim RPM.
141 <LI><A NAME="TOC36" HREF="FAQ.html#SEC36">Q0035</A>: What does the error "Spool file is locked" mean?
142 <LI><A NAME="TOC37" HREF="FAQ.html#SEC37">Q0036</A>: Exim is reporting IP addresses as 0.0.0.0 or 255.255.255.255 instead of
143        their correct values. What's going on?
144 <LI><A NAME="TOC38" HREF="FAQ.html#SEC38">Q0037</A>: I can't seem to figure out why PAM support doesn't work correctly.
145 <LI><A NAME="TOC39" HREF="FAQ.html#SEC39">Q0038</A>: I'm trying to use a query-style lookup for hosts that are allowed to
146        relay, but it is giving really weird errors.
147 <LI><A NAME="TOC40" HREF="FAQ.html#SEC40">Q0039</A>: Exim is rejecting calls from hosts that have more than one IP address,
148        for no apparent reason.
149 <LI><A NAME="TOC41" HREF="FAQ.html#SEC41">Q0040</A>: Exim is failing to find the MySQL library, even though is it present
150        within <B><B>$LD_LIBRARY_PATH.</B></B> I'm getting this error:
151 <LI><A NAME="TOC42" HREF="FAQ.html#SEC42">Q0041</A>: I have a collection of Exim processes that have been around for days,
152        and are apparently stuck while trying to deliver to remote hosts. This
153        is causing the messages they are handling to get stuck.
154 <LI><A NAME="TOC43" HREF="FAQ.html#SEC43">Q0042</A>: I have a message in the spool which couldn't be delivered because of a
155        timeout from the remote smtp server. When I try to deliver this message
156        in eximon, I get "Spool file is locked". How can I deliver the message?
157 <LI><A NAME="TOC44" HREF="FAQ.html#SEC44">Q0043</A>: What does the error "lookup of host <B>"xx<EM>.xx</EM><EM>.xx</EM>"</B> failed in <I>yyy</I>y router"
158        mean? Any suggestions to stop this these sort of errors from being
159        frozen would be muchly appreciated.
160 <LI><A NAME="TOC45" HREF="FAQ.html#SEC45">Q0044</A>: My filter isn't working. How can I test it?
161 <LI><A NAME="TOC46" HREF="FAQ.html#SEC46">Q0045</A>: Exim works fine on one host, but when I copied the binary to another
162        identical host, it stopped working (it could not resolve DNS names).
163 <LI><A NAME="TOC47" HREF="FAQ.html#SEC47">Q0046</A>: Once in a while, a user will send a message and immediatly get a
164        response back "No Transport Provider"  If they choose "Send Again",
165        sometimes it works, sometimes it doesn't.
166 <LI><A NAME="TOC48" HREF="FAQ.html#SEC48">Q0047</A>: I set <TT>host_accept_relay</TT> to do a lookup in a file of IP addresses, but it
167        doesn't work.
168 </UL>
169
170 <A NAME="TOC49" HREF="FAQ.html#SEC49">1. BUILDING EXIM</A>
171 <UL>
172 <LI><A NAME="TOC50" HREF="FAQ.html#SEC50">Q0101</A>: I get the error "conflicting types" when Exim is building the libident
173        library.
174 <LI><A NAME="TOC51" HREF="FAQ.html#SEC51">Q0102</A>: When I ran <B>make</B> I got the error "undefined reference to <TT>dbopen</TT>".
175 <LI><A NAME="TOC52" HREF="FAQ.html#SEC52">Q0103</A>: I can't get Exim to compile with Berkeley DB version 2.x.
176 <LI><A NAME="TOC53" HREF="FAQ.html#SEC53">Q0104</A>: I'm getting an "undefined symbol" error for <TT>hosts_ctl</TT> when I try to
177        build Exim. (On some systems this error is "undefined reference to
178        'hosts_ctl'".)
179 <LI><A NAME="TOC54" HREF="FAQ.html#SEC54">Q0105</A>: I'm about to upgrade to a new Exim release. Do I need to ensure the
180        spool is empty, or take any other special action?
181 <LI><A NAME="TOC55" HREF="FAQ.html#SEC55">Q0106</A>: What does the error "<B>install-info</B>: command not found" mean?
182 <LI><A NAME="TOC56" HREF="FAQ.html#SEC56">Q0107</A>: Exim doesn't seem to be recognizing my operating system type correctly,
183        and so is failing to build.
184 <LI><A NAME="TOC57" HREF="FAQ.html#SEC57">Q0108</A>: I am getting an error "`exim' undeclared here" when I compile, in the
185        <B>globals.c</B> module.
186 <LI><A NAME="TOC58" HREF="FAQ.html#SEC58">Q0109</A>: Exim fails to build, complaining about the absence of the "killpg"
187        function.
188 <LI><A NAME="TOC59" HREF="FAQ.html#SEC59">Q0110</A>: I'm getting an unresolved symbol <TT>ldap_is_ldap_url</TT> when trying to build
189        Exim.
190 <LI><A NAME="TOC60" HREF="FAQ.html#SEC60">Q0111</A>: I'm getting an unresolved symbol <TT>mysql_close</TT> when trying to build Exim.
191 <LI><A NAME="TOC61" HREF="FAQ.html#SEC61">Q0112</A>: I'm trying to build Exim with PAM support. I have included <B>-lpam</B> in
192        <TT>EXTRALIBS</TT>, but I'm still getting a linking error:
193 <LI><A NAME="TOC62" HREF="FAQ.html#SEC62">Q0113</A>: I'm getting the error <B>"db.h:</B> No such file or directory" when I try to
194        build Exim.
195 <LI><A NAME="TOC63" HREF="FAQ.html#SEC63">Q0114</A>: I'm getting the error "/usr/bin/ld: cannot find <B>-ldb1"</B> when I try to
196        build Exim.
197 </UL>
198
199 <A NAME="TOC64" HREF="FAQ.html#SEC64">2. MAILBOX LOCKING</A>
200 <UL>
201 <LI><A NAME="TOC65" HREF="FAQ.html#SEC65">Q0201</A>: Why do I get the error "Permission denied: creating lock file hitching
202        post" when Exim tries to do a local delivery?
203 <LI><A NAME="TOC66" HREF="FAQ.html#SEC66">Q0202</A>: I am experiencing mailbox locking problems with Sun's <B>mailtool</B> used
204        over a network.
205 </UL>
206
207 <A NAME="TOC67" HREF="FAQ.html#SEC67">3. ROUTING</A>
208 <UL>
209 <LI><A NAME="TOC68" HREF="FAQ.html#SEC68">Q0301</A>: What do "lowest numbered MX record points to local host" and "remote
210        host address is the local host" mean?
211 <LI><A NAME="TOC69" HREF="FAQ.html#SEC69">Q0302</A>: How do I configure Exim to send all non-local mail to a gateway host?
212 <LI><A NAME="TOC70" HREF="FAQ.html#SEC70">Q0303</A>: How do I configure Exim to send all non-local mail to a central server
213        if it cannot be immediately delivered by my host? I don't want to have
214        queued mail waiting on my host.
215 <LI><A NAME="TOC71" HREF="FAQ.html#SEC71">Q0304</A>: How can I arrange for messages submitted by (for example) Majordomo to
216        be routed specially?
217 <LI><A NAME="TOC72" HREF="FAQ.html#SEC72">Q0305</A>: How do I arrange for all incoming email for <B><B>*@some.domain</B></B> to go into one
218        pop3 mail account? The customer doesn't want to add a list of specific
219        local parts to the system.
220 <LI><A NAME="TOC73" HREF="FAQ.html#SEC73">Q0306</A>: The <TT>route_list</TT> setting 
221          <TT>^foo$:^bar$  $domain  byname</TT> in a <B>domainlist</B>
222        router does not work.
223 <LI><A NAME="TOC74" HREF="FAQ.html#SEC74">Q0307</A>: I'm getting "permission denied" when Exim attempts to check a
224        <TT>require_files</TT> option.
225 <LI><A NAME="TOC75" HREF="FAQ.html#SEC75">Q0308</A>: I have a domain for which some local parts must be delivered locally,
226        but the remainder are to be treated like any other remote addresses.
227 <LI><A NAME="TOC76" HREF="FAQ.html#SEC76">Q0309</A>: For certain domains, I don't want Exim to use MX records. Instead, I
228        want it just to look up the hosts' A records. I tried using a negative
229        entry in <TT>mx_domains</TT> in the smtp router, but it didn't work.
230 <LI><A NAME="TOC77" HREF="FAQ.html#SEC77">Q0310</A>: How can I configure Exim on a firewall machine so that if mail arrives
231        addressed to a domain whose MX points to the firewall, it is forwarded
232        to the internal mail server, without having to have a list of all the
233        domains involved?
234 <LI><A NAME="TOC78" HREF="FAQ.html#SEC78">Q0311</A>: How can I arrange that messages larger than some limit are handled by
235        a special router?
236 <LI><A NAME="TOC79" HREF="FAQ.html#SEC79">Q0312</A>: If a DNS lookup returns no MX records why doesn't Exim just bin the
237        message?
238 <LI><A NAME="TOC80" HREF="FAQ.html#SEC80">Q0313</A>: When a DNS lookup for MX records fails to complete, why doesn't Exim
239        send the messsage to the host defined by the A record?
240 <LI><A NAME="TOC81" HREF="FAQ.html#SEC81">Q0314</A>: Can you specify a list of domains to explicitly reject?
241 <LI><A NAME="TOC82" HREF="FAQ.html#SEC82">Q0315</A>: Is it possible to use a conditional expression for the host item in a
242        <TT>route_list</TT> for the <B>domainlist</B> router? I tried the following, but it
243        doesn't work:
244 <LI><A NAME="TOC83" HREF="FAQ.html#SEC83">Q0316</A>: I send all external mail to a smart host, but this means that bad
245        addresses also get passed to the smart host. Can I avoid this?
246 <LI><A NAME="TOC84" HREF="FAQ.html#SEC84">Q0317</A>: I have a dial-up machine, and I use the <TT>queue_smtp</TT> option so that remote
247        mail only goes out when I do a queue run. However, any email I send with
248        an address <B><B>&#60;anything&#62;@aol.com</B></B> is returned within about 15 mins saying
249        'retry time exceeded', and all addresses are affected.
250 <LI><A NAME="TOC85" HREF="FAQ.html#SEC85">Q0318</A>: How can I route mail for user <B>X@local</B> to a smarthost if X doesn't exist
251        on the local host?
252 <LI><A NAME="TOC86" HREF="FAQ.html#SEC86">Q0319</A>: How can I arrange to do my own qualification of non-fully-qualified
253        domains, and then pass them on to the next router?
254 <LI><A NAME="TOC87" HREF="FAQ.html#SEC87">Q0320</A>: Every system has a "nobody" account under which httpd etc run. I would
255        like to know how to restrict mail which comes from that account to users
256        on that host only.
257 <LI><A NAME="TOC88" HREF="FAQ.html#SEC88">Q0321</A>: I have a really annoying intermittent problem where attempts to mail to
258        valid sites are rejected with "unknown mail domain". This only happens a
259        few times a day and there is no particular pattern to the sites it
260        rejects.  If I try to lookup the same domain a few minutes later then it
261        is OK.
262 <LI><A NAME="TOC89" HREF="FAQ.html#SEC89">Q0322</A>: I'd like route all mail with unresolved addresses to a relay machine.
263 <LI><A NAME="TOC90" HREF="FAQ.html#SEC90">Q0323</A>: I would like to forward all incoming email for a particular domain to
264        another machine via SMTP. Whereabouts would I configure that?
265 <LI><A NAME="TOC91" HREF="FAQ.html#SEC91">Q0324</A>: Why does Exim say "all relevant MX records point to non-existent hosts"
266        when MX records point to IP addresses?
267 <LI><A NAME="TOC92" HREF="FAQ.html#SEC92">Q0325</A>: How can I arrange for mail on my local network to be delivered directly
268        to the relevant hosts, but all other mail to be sent to my ISP's mail
269        server? The local hosts are all DNS-registered and behave like normal
270        Internet hosts.
271 <LI><A NAME="TOC93" HREF="FAQ.html#SEC93">Q0326</A>: What I'd like to do is have alternative smarthosts, where the one to be
272        used is determined by which ISP I'm connected to.
273 </UL>
274
275 <A NAME="TOC94" HREF="FAQ.html#SEC94">4. DIRECTING</A>
276 <UL>
277 <LI><A NAME="TOC95" HREF="FAQ.html#SEC95">Q0401</A>: I need to have any mail for <B>virt.dom.ain</B> that <EM>doesn't</EM> match one of the
278        aliases in <B><B>/usr/lib/aliases.virt</B></B> delivered to a particular address, for
279        example, <B><B>postmaster@virt.dom.ain.</B></B>
280 <LI><A NAME="TOC96" HREF="FAQ.html#SEC96">Q0402</A>: How do I configure Exim to send all messages to a central server?
281 <LI><A NAME="TOC97" HREF="FAQ.html#SEC97">Q0403</A>: How do I configure Exim to send messages for unknown local users to a
282        central server?
283 <LI><A NAME="TOC98" HREF="FAQ.html#SEC98">Q0404</A>: How can I arrange for messages submitted by (for example) Majordomo to
284        be handled specially?
285 <LI><A NAME="TOC99" HREF="FAQ.html#SEC99">Q0405</A>: On a host that accepts mail for several domains, do I have to use fully
286        qualified names in <B>/etc/aliases</B> or do I have to set up an alias file for
287        each domain?
288 <LI><A NAME="TOC100" HREF="FAQ.html#SEC100">Q0406</A>: Some of my users are using the <B>.forward</B> to pipe to a shell command which
289        appends to the user's INBOX. How can I forbid this?
290 <LI><A NAME="TOC101" HREF="FAQ.html#SEC101">Q0407</A>: How can I arrange for a default value when using a query-style lookup
291        such as LDAP or NIS+ to handle aliases?
292 <LI><A NAME="TOC102" HREF="FAQ.html#SEC102">Q0408</A>: If I don't fully qualify the addresses in a virtual domain's alias file
293        then mail to aliases which also match the local domain get delivered to
294        the local domain.
295 <LI><A NAME="TOC103" HREF="FAQ.html#SEC103">Q0409</A>: We've got users who chmod their home to 750, and home is NFS-mounted
296        without root privilege, so Exim cannot access <B>~user/.forward.</B>
297 <LI><A NAME="TOC104" HREF="FAQ.html#SEC104">Q0410</A>: I'm getting "permission denied" when Exim tries to check a for the
298        existence of a user's <B>.procmailrc</B> file using <TT>require_files</TT>.
299 <LI><A NAME="TOC105" HREF="FAQ.html#SEC105">Q0411</A>: How can I deliver mail into different directories for each virtual
300        domain, doing user lookups not against <B>/etc/passwd</B> but against
301        <B><B>/etc/passwd.domain</B>?</B>
302 <LI><A NAME="TOC106" HREF="FAQ.html#SEC106">Q0412</A>: I want mail for <EM>any</EM> local part at certain virtual domains to go
303        to a single address for each domain.
304 <LI><A NAME="TOC107" HREF="FAQ.html#SEC107">Q0413</A>: How can I make Exim look in the alias NIS map instead of <B>/etc/aliases</B>?
305 <LI><A NAME="TOC108" HREF="FAQ.html#SEC108">Q0414</A>: What does the error message "error in forward file (filtering not
306        enabled): missing or malformed local part ..." mean?
307 <LI><A NAME="TOC109" HREF="FAQ.html#SEC109">Q0415</A>: Exim isn't recognizing certain forms of local address.
308 <LI><A NAME="TOC110" HREF="FAQ.html#SEC110">Q0416</A>: I have a domain for which some local parts must be delivered locally,
309        but the remainder are to be treated like any other remote addresses.
310 <LI><A NAME="TOC111" HREF="FAQ.html#SEC111">Q0417</A>: What I really need is the ability to obtain the result of a pipe
311        command so that I can filter externally and redirect internally. Is
312        this possible?
313 <LI><A NAME="TOC112" HREF="FAQ.html#SEC112">Q0418</A>: When I set a suffix on one of my directors, it doesn't get stripped when
314        checking the <TT>local_parts</TT> option. Why is this?
315 <LI><A NAME="TOC113" HREF="FAQ.html#SEC113">Q0419</A>: Why will Exim deliver a message locally to any username that is longer
316        than 8 characters as long as the first 8 characters match one of the
317        local usernames?
318 <LI><A NAME="TOC114" HREF="FAQ.html#SEC114">Q0420</A>: Why am I seeing the error "bad mode (100664) for <B><B>/home/test/.forward</B></B>
319        (userforward director)"? I've looked through the documentation but can't
320        see anything to suggest that exim has to do anything other than read the
321        <B>.forward</B> file.
322 <LI><A NAME="TOC115" HREF="FAQ.html#SEC115">Q0421</A>: How can I arrange that messages larger than some limit are handled by
323        a special director?
324 <LI><A NAME="TOC116" HREF="FAQ.html#SEC116">Q0422</A>: When a user's <B>.forward</B> file is syntactially invalid, Exim defers
325        delivery of all messages to that user, which sometimes include the
326        user's own test messages. Can it be told to ignore the <B>.forward</B> file
327        and/or inform the user of the error?
328 <LI><A NAME="TOC117" HREF="FAQ.html#SEC117">Q0423</A>: I have some users on my system with upper case letters in their login
329        names, but these are not recognized.
330 <LI><A NAME="TOC118" HREF="FAQ.html#SEC118">Q0424</A>: I have unset <TT>locally_caseless</TT> because my users have upper case letters
331        in their login names, but incoming mail now has to use the correct case.
332        Can I relax this somehow?
333 <LI><A NAME="TOC119" HREF="FAQ.html#SEC119">Q0425</A>: I want to look up local users in an SQL database instead of looking in
334        the passwd file.
335 <LI><A NAME="TOC120" HREF="FAQ.html#SEC120">Q0426</A>: Is it possible for Exim to use a SQL database like MySQL for its lists
336        of virtual domains and explicit aliases?
337 <LI><A NAME="TOC121" HREF="FAQ.html#SEC121">Q0427</A>: Can I use my existing alias files and forward files as well as procmail
338        and effectively drop in exim in place of Sendmail ?
339 <LI><A NAME="TOC122" HREF="FAQ.html#SEC122">Q0428</A>: How can I route mail for user <B>X@local</B> to a smarthost if X doesn't exist
340        on the local host?
341 <LI><A NAME="TOC123" HREF="FAQ.html#SEC123">Q0429</A>: What is quickest way to set up Exim so any message sent to a non-
342        existing user would bounce back with a different message, based
343        on the name of non-existing user?
344 <LI><A NAME="TOC124" HREF="FAQ.html#SEC124">Q0430</A>: I am building some largish mailing lists with Majordomo, and was
345        wondering if it worth leaving the actually list expansion to the
346        <B>aliasfile</B> :include: mechanism or should I consider using the <B>forwardfile</B>
347        transport? Is there any real difference in terms of facilities and/or
348        performance, and are the expansions basically the same code anyway?
349 <LI><A NAME="TOC125" HREF="FAQ.html#SEC125">Q0431</A>: What do I need to do to make Exim handle <B>/usr/ucb/vacation</B> processing
350        automatically, so that people could just create a .<B>vacation.msg</B> file in
351        their home directory and not have to edit their <B>.forward</B> file?
352 <LI><A NAME="TOC126" HREF="FAQ.html#SEC126">Q0432</A>: I want to use a default entry in my alias file, but it picks up the
353        local parts that the aliases generate. For example, if the alias file
354        is
355 <LI><A NAME="TOC127" HREF="FAQ.html#SEC127">Q0433</A>: I have some obsolete domains which people have been warned not to use
356        any more. How can I arrange to delete any mail that is sent to them?
357 <LI><A NAME="TOC128" HREF="FAQ.html#SEC128">Q0434</A>: How can I arrange that mail addressed to <B><B>anything@something.mydomain.com</B></B>
358        gets delivered to <B><B>something@mydomain.com</B>?</B>
359 <LI><A NAME="TOC129" HREF="FAQ.html#SEC129">Q0435</A>: I can't get a regular expression to work in this <TT>local_parts</TT> option on
360        one of my directors:
361 <LI><A NAME="TOC130" HREF="FAQ.html#SEC130">Q0436</A>: How can I arrange for all addresses in a group of domains <B>*.example.com</B>
362        to share the same alias file? I have a number of such groups.
363 <LI><A NAME="TOC131" HREF="FAQ.html#SEC131">Q0437</A>: When Exim tries to read <B><B>/usr/lib/majordomo/lists/lists.aliases</B></B> it is
364        giving "Permission denied", but that file is world-readable!
365 <LI><A NAME="TOC132" HREF="FAQ.html#SEC132">Q0438</A>: Some of our users have no home directories; the field in the password
366        file contains <B>/no/home/dir</B>. This causes the error "failed to stat
367        <B>/no/home/dir</B> (No such file or directory)" when Exim tries to look for a
368        <B>.forward</B> file, and the delivery is deferred.
369 <LI><A NAME="TOC133" HREF="FAQ.html#SEC133">Q0439</A>: How can I disable Exim's de-duplication features? I want it to do two
370        deliveries if two different aliases expand to the same address.
371 <LI><A NAME="TOC134" HREF="FAQ.html#SEC134">Q0440</A>: I set up an <B>aliasfile</B> director using MySQL, but it doesn't use the new
372        addresses. This it my director:
373 <LI><A NAME="TOC135" HREF="FAQ.html#SEC135">Q0441</A>: I received a message with a Subject: line that contained a non-printing
374        character (a carriage return). This messed up my filter file. Is there a
375        way to get round it?
376 <LI><A NAME="TOC136" HREF="FAQ.html#SEC136">Q0442</A>: My users' mailboxes are distributed between several servers according to
377        the first letter of the user name. All the servers receive incoming mail
378        at random. I would like to have the same configuration file for all the
379        servers, which does local delivery for the mailboxes it holds, and sends
380        other addresses to the correct other server. Is this possible?
381 <LI><A NAME="TOC137" HREF="FAQ.html#SEC137">Q0443</A>: I want to search for '$' in the subject line, but I can't seem to get
382        the syntax. The obvious choice, '\$' doesn't work. Any help?
383 <LI><A NAME="TOC138" HREF="FAQ.html#SEC138">Q0444</A>: One of the things I want to set up is for <B>anything@onedomain</B> to forward
384        to <B><B>anything@anotherdomain.</B></B> I tried adding <B>$local_part@anotherdomain</B> to
385        my aliases but it did not expand - it sent it to that literal address.
386 <LI><A NAME="TOC139" HREF="FAQ.html#SEC139">Q0445</A>: How can I have an address looked up in two different alias files, and
387        delivered to all the addresses that are found?
388 <LI><A NAME="TOC140" HREF="FAQ.html#SEC140">Q0446</A>: I've converted from Sendmail, and I notice that Exim doesn't make use
389        of the "owner-" entries in my alias file to change the sender address in
390        outgoing messages to a mailing list.
391 </UL>
392
393 <A NAME="TOC141" HREF="FAQ.html#SEC141">5. DELIVERY</A>
394 <UL>
395 <LI><A NAME="TOC142" HREF="FAQ.html#SEC142">Q0501</A>: What does the error "Neither the <I>xxx</I> director nor the <I>yyy</I> transport set
396        a uid for local delivery of..." mean?
397 <LI><A NAME="TOC143" HREF="FAQ.html#SEC143">Q0502</A>: Exim won't deliver to a host with no MX record.
398 <LI><A NAME="TOC144" HREF="FAQ.html#SEC144">Q0503</A>: How should Exim be configured when it is acting as a temporary storage
399        system for a domain on a dial-up host?
400 <LI><A NAME="TOC145" HREF="FAQ.html#SEC145">Q0504</A>: I would like to deliver mail addressed to a given domain normally, but
401        also to generate a message to the envelope sender.
402 <LI><A NAME="TOC146" HREF="FAQ.html#SEC146">Q0505</A>: Exim keeps crashing with segmentation errors (signal 11 or 139) during
403        delivery. This seems to happen when it is about to contact a remote
404        host or when a delivery is deferred.
405 <LI><A NAME="TOC147" HREF="FAQ.html#SEC147">Q0506</A>: Whenever Exim tries to do a local delivery, it gives a permission denied
406        error for the <B>.forward</B> file, like this:
407 <LI><A NAME="TOC148" HREF="FAQ.html#SEC148">Q0507</A>: I have installed Exim, but now I can't mail to root any more. Why is
408        this?
409 <LI><A NAME="TOC149" HREF="FAQ.html#SEC149">Q0508</A>: How can I stop undeliverable bounce messages (e.g. to routeable, but
410        undeliverable, spammer senders) from clogging up the queue for days?
411 <LI><A NAME="TOC150" HREF="FAQ.html#SEC150">Q0509</A>: How can mails that are being routed through directors other than
412        localuser be delivered under the uid of the recipient?
413 <LI><A NAME="TOC151" HREF="FAQ.html#SEC151">Q0510</A>: I want to use MMDF-style mailboxes. How can I get Exim to append the
414        ctrl-A characters that separate indvidual emails?
415 <LI><A NAME="TOC152" HREF="FAQ.html#SEC152">Q0511</A>: I have an ISDN connection and would like a way of running the queue
416        automatically when it is up.
417 <LI><A NAME="TOC153" HREF="FAQ.html#SEC153">Q0512</A>: If a user's mailbox is over quota, is there a way for me to set it up so
418        that the mail bounces to the sender and is NOT stored in the mail queue?
419 <LI><A NAME="TOC154" HREF="FAQ.html#SEC154">Q0513</A>: I'm using tmail to do local deliveries, but when I turned on the
420        <TT>use_crlf</TT> option on the pipe transport (tmail prefers \r\n terminations)
421        message bodies started to vanish.
422 <LI><A NAME="TOC155" HREF="FAQ.html#SEC155">Q0514</A>: What does the message "Unable to get root to set uid and gid
423        for local delivery to <I>xxx</I>: uid=<I>yyy</I> euid=<I>zzz</I>" mean?
424 <LI><A NAME="TOC156" HREF="FAQ.html#SEC156">Q0515</A>: I upgraded to 2.04 and now my Envelope-To: header for my virtual domains
425        is gone. Any idea how to get it back?
426 <LI><A NAME="TOC157" HREF="FAQ.html#SEC157">Q0516</A>: The Exim log records the arrival of a message, and then "Completed",
427        without logging any deliveries. What's going on?
428 <LI><A NAME="TOC158" HREF="FAQ.html#SEC158">Q0517</A>: When I activate "return receipt" for example in Netscape Mailbox
429        sending options, then I get an error message from Exim... something
430        like "not supported". Can I activate delivery confirmations?
431 <LI><A NAME="TOC159" HREF="FAQ.html#SEC159">Q0518</A>: When I dial up to collect mail from my ISP, only the first 10 messages
432        get delivered immediately; the remainder just sit on the queue until a
433        queue runner process finds them.
434 <LI><A NAME="TOC160" HREF="FAQ.html#SEC160">Q0519</A>: My ISP's mail server is rejecting bounce messages from Exim, complaining
435        that they have no sender. The SMTP trace does indeed show that the
436        sender address is "&#60;&#62;". Why is the Sender on the bounce message empty?
437 <LI><A NAME="TOC161" HREF="FAQ.html#SEC161">Q0520</A>: What does the message "retry time not reached [for any host]" on the log
438        mean? Why won't Exim try to deliver the message?
439 <LI><A NAME="TOC162" HREF="FAQ.html#SEC162">Q0521</A>: RFC 1985 specifies that the SMTP command "ETRN <B>host.domain"</B> causes all
440        mail queued for that host, no matter what domain it's for, to be
441        dequeued. Why doesn't Exim support this?
442 <LI><A NAME="TOC163" HREF="FAQ.html#SEC163">Q0522</A>: If email has been deferred to a member on a local mailing list
443        (implemented through forward files), and one of our ETRN clients is on
444        this mailing list, the <B>-R</B> won't "flush" the mailing list message for
445        that client.
446 <LI><A NAME="TOC164" HREF="FAQ.html#SEC164">Q0523</A>: Exim seems to be sending the same message twice, according to the log,
447        although there is a difference in capitalization of the local part of
448        the address.
449 <LI><A NAME="TOC165" HREF="FAQ.html#SEC165">Q0524</A>: How can I force the next retry time for a host to be now?
450 <LI><A NAME="TOC166" HREF="FAQ.html#SEC166">Q0525</A>: I set up "|/bin/grep Subject|/usr/bin/smbclient <B>-M</B> &#60;netbiosname&#62;" as an
451        alias but it doesn't work.
452 <LI><A NAME="TOC167" HREF="FAQ.html#SEC167">Q0526</A>: Why does the pipe transport add a line starting with "&#62;From" to
453        messages?
454 <LI><A NAME="TOC168" HREF="FAQ.html#SEC168">Q0527</A>: I have set <TT>fallback_hosts</TT> on my smtp transport, but after the error
455        <B><B>"sem@chat.ru</B></B> cannot be resolved at this time" Exim isn't using them.
456 <LI><A NAME="TOC169" HREF="FAQ.html#SEC169">Q0528</A>: After the holidays my ISP has always hundreds of e-mails waiting for me.
457        These are forced down Exim's throat in one go. Exim spawns a lot of
458        kids, but is there some limit to the number of processes it creates?
459 <LI><A NAME="TOC170" HREF="FAQ.html#SEC170">Q0529</A>: When a message in the queue got to 12h old, Exim wrote 'retry timeout
460        exceeded' and removed <EM>all</EM> messages in the queue to this host - even
461        recent messages. How I can avoid this behaviour? I only want to remove
462        messages that have exceeded the maximum retry time.
463 <LI><A NAME="TOC171" HREF="FAQ.html#SEC171">Q0530</A>: Can Exim add a Content-Length: header to messages it delivers?
464 <LI><A NAME="TOC172" HREF="FAQ.html#SEC172">Q0531</A>: Exim seems to be trying to deliver a message every 10 minutes, though
465        the retry rules specify longer times after a while, because it is
466        writing a log entry every time, like this:
467 <LI><A NAME="TOC173" HREF="FAQ.html#SEC173">Q0532</A>: I am trying to set exim up to have a automatic failover if it sees that
468        the system that it is sending all mail to is down.
469 <LI><A NAME="TOC174" HREF="FAQ.html#SEC174">Q0533</A>: I can't get Exim to deliver over NFS. I get the error "fcntl() failed:
470        No locks available", though the lock daemon is running on the NFS server
471        and other hosts are able to access it.
472 <LI><A NAME="TOC175" HREF="FAQ.html#SEC175">Q0534</A>: Why does Exim bounce messages without even attempting delivery, giving
473        the error "retry time not reached for any host after a long failure
474        period"?
475 <LI><A NAME="TOC176" HREF="FAQ.html#SEC176">Q0535</A>: My <B>.forward</B> file is "|/usr/bin/procmail <B>-f-"</B> and mail gets delivered,
476        but there was a bounce to the sender, sending him the output of procmail.
477        How can I prevent this?
478 <LI><A NAME="TOC177" HREF="FAQ.html#SEC177">Q0536</A>: Can I write an ordinary file when I running a perl script as a transport
479        filter for <TT>remote_smtp</TT> and <TT>address_pipe</TT> transports?
480 <LI><A NAME="TOC178" HREF="FAQ.html#SEC178">Q0537</A>: I have some mails on my queues that are sticking around longer than
481        the retry time indicates they should. They are all getting frozen
482        because some remote admin has set their MX record to 127.0.0.1.
483 <LI><A NAME="TOC179" HREF="FAQ.html#SEC179">Q0538</A>: My <B>/var/spool/mail</B> has grown drastically. Is there any possibility of
484        using two files in <B>exim.cfg</B> ?
485 <LI><A NAME="TOC180" HREF="FAQ.html#SEC180">Q0539</A>: Sendmail has a program called smrsh that restricts what binaries
486        can be run from sendmail aliases. Is there someting like this in Exim ?
487 <LI><A NAME="TOC181" HREF="FAQ.html#SEC181">Q0540</A>: I wish to have large emails go out one at a time.
488 </UL>
489
490 <A NAME="TOC182" HREF="FAQ.html#SEC182">6. UUCP</A>
491 <UL>
492 <LI><A NAME="TOC183" HREF="FAQ.html#SEC183">Q0601</A>: The MX records for some UUCP domains point to my local host. How do I
493        get it to pass the messages on to UUCP?
494 <LI><A NAME="TOC184" HREF="FAQ.html#SEC184">Q0602</A>: How can I get Exim to handle "bang path" addresses?
495 <LI><A NAME="TOC185" HREF="FAQ.html#SEC185">Q0603</A>: We see something strange on our system in regards to mail comming in via
496        rmail from a UUCP link. The sender is being set to mailmaster instead of
497        the real sender, and a Sender: header is being added to the message.
498 </UL>
499
500 <A NAME="TOC186" HREF="FAQ.html#SEC186">7. PERFORMANCE</A>
501 <UL>
502 <LI><A NAME="TOC187" HREF="FAQ.html#SEC187">Q0701</A>: I'm running a large mail server. Should I set <TT>split_spool_directory</TT> to
503        improve performance?
504 <LI><A NAME="TOC188" HREF="FAQ.html#SEC188">Q0702</A>: How well does Exim scale?
505 <LI><A NAME="TOC189" HREF="FAQ.html#SEC189">Q0703</A>: We have a large password file. Can Exim use alternative lookups during
506        delivery to speed things up?
507 <LI><A NAME="TOC190" HREF="FAQ.html#SEC190">Q0704</A>: I just wondered if it might be helpful to put the hints database on a
508        RAM disk during regular operation. Did anybody try that yet?
509 </UL>
510
511 <A NAME="TOC191" HREF="FAQ.html#SEC191">8. POLICY CONTROLS</A>
512 <UL>
513 <LI><A NAME="TOC192" HREF="FAQ.html#SEC192">Q0801</A>: How do I block unwanted messages from outside my host?
514 <LI><A NAME="TOC193" HREF="FAQ.html#SEC193">Q0802</A>: I don't want to block spam entirely; how can I inspect each message
515        before deciding whether to deliver it or not?
516 <LI><A NAME="TOC194" HREF="FAQ.html#SEC194">Q0803</A>: How can I test that my spam blocks are working?
517 <LI><A NAME="TOC195" HREF="FAQ.html#SEC195">Q0804</A>: How can I test that Exim is correctly configured to use the Realtime
518        Blocking List (RBL)?
519 <LI><A NAME="TOC196" HREF="FAQ.html#SEC196">Q0805</A>: How can I use <B>tcpwrappers</B> in conjunction with Exim?
520 <LI><A NAME="TOC197" HREF="FAQ.html#SEC197">Q0806</A>: How can I get POP-auth-before-relay support in Exim?
521 <LI><A NAME="TOC198" HREF="FAQ.html#SEC198">Q0807</A>: I have one or two cases where my machine correctly rejects messages, but
522        the remote machine is quite persistent, and keeps trying over and over.
523 <LI><A NAME="TOC199" HREF="FAQ.html#SEC199">Q0808</A>: I am seeing the error "no valid sender in message headers: return path
524        is &#60;&#62;" in the reject log. Isn't &#60;&#62; a valid return path for error
525        messages?
526 <LI><A NAME="TOC200" HREF="FAQ.html#SEC200">Q0809</A>: Let's say that we want to run a mail server that does not care if you
527        have proper reverse DNS. If you include <TT>host_reject</TT> lines in your
528        config file, Exim will always reject connections from such hosts. How
529        can this be avoided?
530 <LI><A NAME="TOC201" HREF="FAQ.html#SEC201">Q0810</A>: Is there a way to prevent lookups in the RBL for local hosts?
531 <LI><A NAME="TOC202" HREF="FAQ.html#SEC202">Q0811</A>: How can I set up the <TT>sender_reject</TT> option in my config file so I can
532        reject mail by matching regular expressions?
533 <LI><A NAME="TOC203" HREF="FAQ.html#SEC203">Q0812</A>: Normally <TT>sender_reject_recipients</TT> works fine, but addresses that have
534        some uppercase letters in them seem to come through.
535 <LI><A NAME="TOC204" HREF="FAQ.html#SEC204">Q0813</A>: I want to accept some sender addresses, even though they do not verify.
536        There doesn't seem to be an option for verification exceptions, so how
537        can I do this?
538 <LI><A NAME="TOC205" HREF="FAQ.html#SEC205">Q0814</A>: We are being plagued by forged mail coming from a number of different
539        hosts and sender addresses. The guy however leaves a fingerprint. The
540        first received line always contains 'Received: from baby'. What is the
541        best suggested way for eliminiating him from our systems?
542 <LI><A NAME="TOC206" HREF="FAQ.html#SEC206">Q0815</A>: I have set <TT>host_accept_relay</TT>, but my host still refuses to relay from
543        matching hosts.
544 <LI><A NAME="TOC207" HREF="FAQ.html#SEC207">Q0816</A>: How can I run customized verification checks on incoming addresses?
545 <LI><A NAME="TOC208" HREF="FAQ.html#SEC208">Q0817</A>: Does Exim apply RBL checks to error messages, those with an envelope
546        sender of "&#60;&#62;" ?
547 <LI><A NAME="TOC209" HREF="FAQ.html#SEC209">Q0818</A>: I want to be able to set up a list, similar to <TT>sender_reject_recipients</TT>,
548        but with a user-defined message. I believe I have to use a director for
549        this.
550 <LI><A NAME="TOC210" HREF="FAQ.html#SEC210">Q0819</A>: I want to reject certain sender-recipient combinations, with a specific
551        message for each such combination.
552 <LI><A NAME="TOC211" HREF="FAQ.html#SEC211">Q0820</A>: Will Exim allow me to create a file of regexs and match incoming
553        external email to the list - and if a match is found file the offending
554        message into a special location? Also is it possible to make exim only
555        filter parts of an incoming email - e.g. ignore large MIME attachments
556        for example and only process text/plain?
557 <LI><A NAME="TOC212" HREF="FAQ.html#SEC212">Q0821</A>: I've hacked sendmail to make an ioctl call at the time of the SMTP RCPT
558        command, to check if a user has exceeded their email quota. If they have
559        I issue a temporary failure and a message - can I do this with Exim?
560 <LI><A NAME="TOC213" HREF="FAQ.html#SEC213">Q0822</A>: I'm looking for a rule to reject special unknown recipients.
561 <LI><A NAME="TOC214" HREF="FAQ.html#SEC214">Q0823</A>: I'd like to pass all messages through a virus-scanning system before
562        delivery. Can Exim do this?
563 <LI><A NAME="TOC215" HREF="FAQ.html#SEC215">Q0824</A>: How can I accomplish this: a message sent from any host must either be
564        sending to a domain in a list (a dbm file) or the sender's address
565        domain must be in the list.
566 <LI><A NAME="TOC216" HREF="FAQ.html#SEC216">Q0825</A>: I've set <TT>relay_domains</TT> and <TT>sender_address_relay</TT>, but if <B>user@mydomain</B>
567        tries sending to an arbitrary domain, Exim rejects it.
568 <LI><A NAME="TOC217" HREF="FAQ.html#SEC217">Q0826</A>: I set <TT>sender_reject_recipients</TT>, but Exim is not rejecting those
569        recipients.
570 <LI><A NAME="TOC218" HREF="FAQ.html#SEC218">Q0827</A>: I can't find an option to deny "RCPT TO:" addresses.
571 <LI><A NAME="TOC219" HREF="FAQ.html#SEC219">Q0828</A>: My problem is that Exim replaces <B>$local_part</B> with an empty string in the
572        system filtering. What's wrong or what did I miss?
573 <LI><A NAME="TOC220" HREF="FAQ.html#SEC220">Q0829</A>: Using <B>$recipients</B> in a system filter gives me another problem: how can
574        I do a string lookup if <B>$recipients</B> is a list of addresses?
575 <LI><A NAME="TOC221" HREF="FAQ.html#SEC221">Q0830</A>: Is there a way to configure Exim to reject mail to a certain local host?
576 <LI><A NAME="TOC222" HREF="FAQ.html#SEC222">Q0831</A>: Exim sometimes rejects messages with bad senders after the DATA and
577        sometimes after the MAIL command. What is the difference?
578 <LI><A NAME="TOC223" HREF="FAQ.html#SEC223">Q0832</A>: How can I get Exim to remove attachments from messages?
579 <LI><A NAME="TOC224" HREF="FAQ.html#SEC224">Q0833</A>: I ran a relay test against my host and it failed with an address
580        containing a %, though I don't have <TT>percent_hack_domains</TT> set. Is Exim
581        broken? This is what the tester said:
582 <LI><A NAME="TOC225" HREF="FAQ.html#SEC225">Q0834</A>: How can I arrange for each user to have a file listing the only sender
583        addresses from which she will accept mail? I want to do this so my
584        family members don't get any spam (or other inappropriate mail).
585 <LI><A NAME="TOC226" HREF="FAQ.html#SEC226">Q0835</A>: I have the POP-auth-before-relay support in, but I see that Exim still
586        does an RBL lookup before checking the POP authorisation file. How can I
587        prevent it doing an RBL check if the caller is authorized by virtue of a
588        recent POP authentication?
589 <LI><A NAME="TOC227" HREF="FAQ.html#SEC227">Q0836</A>: When using Nessus on a system that runs exim, a number of security
590        issues are raised. Nessus complains that exim answers to EXPN and/or
591        VRFY; sometimes it even complains that exim allows relaying.
592 <LI><A NAME="TOC228" HREF="FAQ.html#SEC228">Q0837</A>: Could anyone points me to right rules to prevent sending/receiving
593        messages to/for domains which have one MX to localhost or only have
594        address 127.0.0.1 ?
595 <LI><A NAME="TOC229" HREF="FAQ.html#SEC229">Q0838</A>: How can I lock out domains that do not have any MX records?
596 <LI><A NAME="TOC230" HREF="FAQ.html#SEC230">Q0839</A>: I would like to have a per-user limit for the maximum size of messages
597        that can be sent.
598 <LI><A NAME="TOC231" HREF="FAQ.html#SEC231">Q0840</A>: I have set up a DBM (or cdb, or lsearch, or MySQL or whatever) file
599        containing a list of IP addresses for the hosts I want to allow to
600        relay, but when I set <TT>host_accept_relay</TT> to do a lookup on that data, it
601        doesn't work.
602 </UL>
603
604 <A NAME="TOC232" HREF="FAQ.html#SEC232">9. MAJORDOMO</A>
605 <UL>
606 <LI><A NAME="TOC233" HREF="FAQ.html#SEC233">Q0901</A>: How do I set up Majordomo to work with Exim?
607 <LI><A NAME="TOC234" HREF="FAQ.html#SEC234">Q0902</A>: I have set <B>$mailer</B> in <B>majordomo.cf,</B> but it still isn't setting the
608        sender correctly in the messages it sends.
609 <LI><A NAME="TOC235" HREF="FAQ.html#SEC235">Q0903</A>: I'm trying to set up majordomo, but I'm getting a "wrong mode" error
610        when I try to send it mail. The panic log entry reads:
611 <LI><A NAME="TOC236" HREF="FAQ.html#SEC236">Q0904</A>: I'm getting return code 9 from <B><B>/home/majordomo/majordomo-1.94.4/wrapper</B></B>
612        when it is passed a message from Exim.
613 <LI><A NAME="TOC237" HREF="FAQ.html#SEC237">Q0905</A>: Exim is complaining about an invalid command line when Majordomo tries
614        to send it a message for delivery.
615 </UL>
616
617 <A NAME="TOC238" HREF="FAQ.html#SEC238">10. REWRITING ADDRESSES</A>
618 <UL>
619 <LI><A NAME="TOC239" HREF="FAQ.html#SEC239">Q1001</A>: How can I get Exim to strip the hostname from the sender's address?
620 <LI><A NAME="TOC240" HREF="FAQ.html#SEC240">Q1002</A>: I have Exim configured to remove the hostname portion of the domain on
621        outgoing mail, and yet the hostname is present when the mail gets
622        delivered.
623 <LI><A NAME="TOC241" HREF="FAQ.html#SEC241">Q1003</A>: I want to rewrite local addresses in mail that goes to the outside
624        world, but not for messages that remain within the local intranet.
625 <LI><A NAME="TOC242" HREF="FAQ.html#SEC242">Q1004</A>: I'm using this rewriting rule to change login names into "friendly"
626        names, but if mail comes in for an upper case login name, it doesn't
627        get rewritten.
628 <LI><A NAME="TOC243" HREF="FAQ.html#SEC243">Q1005</A>: Is it possible to completely fail a message if the rewrite rules fail?
629 <LI><A NAME="TOC244" HREF="FAQ.html#SEC244">Q1006</A>: I'm using <B>$domain</B> as the key for a lookup in a rewriting rule, but its
630        contents are not being lowercased. Aren't domains supposed to be handled
631        caselessly?
632 <LI><A NAME="TOC245" HREF="FAQ.html#SEC245">Q1007</A>: I want to rewrite local sender addresses depending on the domain of the
633        recipient.
634 </UL>
635
636 <A NAME="TOC246" HREF="FAQ.html#SEC246">11. HEADERS</A>
637 <UL>
638 <LI><A NAME="TOC247" HREF="FAQ.html#SEC247">Q1101</A>: I would like add some custom headers to selected outgoing mail based on
639        a specific domain and the subject line.
640 <LI><A NAME="TOC248" HREF="FAQ.html#SEC248">Q1102</A>: Is it possible to have Exim add a header to only certain <TT>local_parts</TT> of
641        outgoing mail?
642 <LI><A NAME="TOC249" HREF="FAQ.html#SEC249">Q1103</A>: How can I remove some part of the Received: header?
643 <LI><A NAME="TOC250" HREF="FAQ.html#SEC250">Q1104</A>: How I can insert the PGP header line using exim filters?
644 <LI><A NAME="TOC251" HREF="FAQ.html#SEC251">Q1105</A>: I know I can use a system filter to replace certain headers in messages,
645        but how can I add text to existing headers? I want to add [SPAM] to
646        the subject line of messages that appear to be spam.
647 </UL>
648
649 <A NAME="TOC252" HREF="FAQ.html#SEC252">12. FETCHMAIL</A>
650 <UL>
651 <LI><A NAME="TOC253" HREF="FAQ.html#SEC253">Q1201</A>: When I run fetchmail, I get the error "SMTP listener doesn't like
652        recipient address <B><I>xxx</I>@localhost</B>".
653 <LI><A NAME="TOC254" HREF="FAQ.html#SEC254">Q1202</A>: Fetchmail is passing on bounce messages to Exim with the sender address
654        set to <B><B>&#60;@some.domain</B>&#62;</B> which causes Exim to complain, because there is no
655        local part.
656 <LI><A NAME="TOC255" HREF="FAQ.html#SEC255">Q1203</A>: I'm currently using Exim with fetchmail and I'd like to use the RBL on
657        Exim, but will it work? Do I need to configure fetchmail any particular
658        way? As far as Exim knows, all mail is coming from 127.0.01. Will it
659        check the source address against RBL? Or will it check the From: header?
660 </UL>
661
662 <A NAME="TOC256" HREF="FAQ.html#SEC256">13. PERL</A>
663 <UL>
664 <LI><A NAME="TOC257" HREF="FAQ.html#SEC257">Q1301</A>: Exim built with Perl support exits with the error message <B>"./exim:</B> can't
665        load library <B>'libperl.so'".</B>
666 <LI><A NAME="TOC258" HREF="FAQ.html#SEC258">Q1302</A>: Exim built with Perl support exits with several error messages of the
667        form "undefined reference to `PL_stack_sp'".
668 </UL>
669
670 <A NAME="TOC259" HREF="FAQ.html#SEC259">14. DIAL-UP</A>
671 <UL>
672 <LI><A NAME="TOC260" HREF="FAQ.html#SEC260">Q1401</A>: How can I arrange for mail to other hosts on my local network to be
673        delivered when I'm not connected to the Internet?
674 <LI><A NAME="TOC261" HREF="FAQ.html#SEC261">Q1402</A>: I have a dial-up machine, and I use the <TT>queue_smtp_domains</TT> option so
675        that remote mail only goes out when I do a queue run. However, any email
676        I send with an address <B><B>&#60;anything&#62;@aol.com</B></B> is returned within about 15
677        minutes saying 'retry time exceeded', and all addresses are affected.
678 <LI><A NAME="TOC262" HREF="FAQ.html#SEC262">Q1403</A>: How should Exim be configured when it is acting as a temporary storage
679        system for a domain on a dial-up host?
680 <LI><A NAME="TOC263" HREF="FAQ.html#SEC263">Q1404</A>: I have <TT>queue_remote_domains</TT> or <TT>queue_smtp_domains</TT> set, and use <B>-qf</B> to
681        force delivery of waiting mail when I dial in. How can I arrange for any
682        new messages that arrive while I'm connected to be delivered immediately?
683 </UL>
684
685 <A NAME="TOC264" HREF="FAQ.html#SEC264">15. MODIFYING MESSAGE BODIES</A>
686 <UL>
687 <LI><A NAME="TOC265" HREF="FAQ.html#SEC265">Q1501</A>: How can I add a disclaimer or an advertisement to a message?
688 <LI><A NAME="TOC266" HREF="FAQ.html#SEC266">Q1502</A>: How can I remove attachments from messages?
689 </UL>
690
691 <A NAME="TOC267" HREF="FAQ.html#SEC267">20. MILLENNIUM</A>
692 <UL>
693 <LI><A NAME="TOC268" HREF="FAQ.html#SEC268">Q2000</A>: Are there any Y2K issues with Exim?
694 </UL>
695
696 <A NAME="TOC269" HREF="FAQ.html#SEC269">50. MISCELLANEOUS</A>
697 <UL>
698 <LI><A NAME="TOC270" HREF="FAQ.html#SEC270">Q5001</A>: What does the error "Unable to get interface configuration: 22 Invalid
699        argument" mean?
700 <LI><A NAME="TOC271" HREF="FAQ.html#SEC271">Q5002</A>: How can I arrange to allow a limited set of users to perform a limited
701        set of Exim administration functions? I don't want to put them all in
702        the exim group.
703 <LI><A NAME="TOC272" HREF="FAQ.html#SEC272">Q5003</A>: How can I test for a message's size being greater or less than a given
704        value in an expansion string?
705 <LI><A NAME="TOC273" HREF="FAQ.html#SEC273">Q5004</A>: I want to "tail" the Exim log, but I have a number of other logs I also
706        want to "tail", and the number of tailing windows is getting to be a
707        nuisance.
708 <LI><A NAME="TOC274" HREF="FAQ.html#SEC274">Q5005</A>: I would like to have Exim log information written to syslog.
709 <LI><A NAME="TOC275" HREF="FAQ.html#SEC275">Q5006</A>: What does the error "Failed to create spool file" mean?
710 <LI><A NAME="TOC276" HREF="FAQ.html#SEC276">Q5007</A>: Exim keeps crashing with segmentation errors (signal 11 or 139).
711 <LI><A NAME="TOC277" HREF="FAQ.html#SEC277">Q5008</A>: Exim's databases keep getting corrupted.
712 <LI><A NAME="TOC278" HREF="FAQ.html#SEC278">Q5009</A>: I've been using an autoreply director to try and mimic a bounce message,
713        but I can't get it to have an envelope from of &#60;&#62;.
714 <LI><A NAME="TOC279" HREF="FAQ.html#SEC279">Q5010</A>: I see entries in the log that mention two different IP addresses for the
715        same connection. Why is this? For example:
716 <LI><A NAME="TOC280" HREF="FAQ.html#SEC280">Q5011</A>: How can I persuade Exim to accept ETRN commands without the leading
717        # character?
718 <LI><A NAME="TOC281" HREF="FAQ.html#SEC281">Q5012</A>: I've recently noticed that emails I send with a Bcc: line are being
719        delivered to their final destination with the Bcc: line still present.
720 <LI><A NAME="TOC282" HREF="FAQ.html#SEC282">Q5013</A>: I used gv <B>v3.5.8</B> (ghostview) to try printing <B>spec.ps.</B> After every
721        printed page, the printer ejects a blank sheet. Is this something to do
722        with using "letter" rather than A4 paper?
723 <LI><A NAME="TOC283" HREF="FAQ.html#SEC283">Q5014</A>: I would like to have a separate queue per domain for hosts which dial
724        in to collect their mail.
725 <LI><A NAME="TOC284" HREF="FAQ.html#SEC284">Q5015</A>: A short time after I start Exim I see a &#60;defunct&#62; zombie process. What
726        is causing this?
727 <LI><A NAME="TOC285" HREF="FAQ.html#SEC285">Q5016</A>: On a reboot, or a restart of the mail system, I see the message "Mailer
728        daemons: exim abandoned: unknown, malformed, or incomplete option
729        <B>-bz</B> sendmail". What does this mean?
730 <LI><A NAME="TOC286" HREF="FAQ.html#SEC286">Q5017</A>: I would like to restrict e-mail usage for some users to the local
731        machine, ideally on a group basis.
732 <LI><A NAME="TOC287" HREF="FAQ.html#SEC287">Q5018</A>: Whenever exim restarts it takes up to 3-5 minutes to start responding on
733        the SMTP port. Why is this?
734 <LI><A NAME="TOC288" HREF="FAQ.html#SEC288">Q5019</A>: Why aren't there any man pages for Exim? I don't always carry my printed
735        documentation.
736 <LI><A NAME="TOC289" HREF="FAQ.html#SEC289">Q5020</A>: When I send a message using the <B>-t</B> command line option, Exim sends only
737        to the addresses within the message, not to those on the command line.
738 <LI><A NAME="TOC290" HREF="FAQ.html#SEC290">Q5021</A>: If I set up, for example, 
739           <TT>local_domains = *customer.com</TT>, then it matches
740        <B>"customer.com"</B> and <B>"abc.customer.com"</B> as required, but it also matches
741        <B>"noncustomer.com",</B> which is wrong. How can I get round this?
742 <LI><A NAME="TOC291" HREF="FAQ.html#SEC291">Q5022</A>: I want to match all local domains of the form <B>*.oyoy.org</B> but want a few
743        exceptions. For instance I don't want <B>foo.oyoy.org</B> or <B>bar.oyoy.org</B> to be
744        treated as local. What is the best way to do this?
745 <LI><A NAME="TOC292" HREF="FAQ.html#SEC292">Q5023</A>: I can't seem to find a pre-built version of Exim anywhere. The machine
746        is a Sparc 5 running Solaris 2.6.
747 <LI><A NAME="TOC293" HREF="FAQ.html#SEC293">Q5024</A>: Is there a Windows NT version of Exim available?
748 <LI><A NAME="TOC294" HREF="FAQ.html#SEC294">Q5025</A>: Does Exim support Delivery Status Notificaion (DSN), Message Status
749        Notification (MSN), or any other form of delivery acknowledgement?
750 <LI><A NAME="TOC295" HREF="FAQ.html#SEC295">Q5026</A>: What does "Exim" stand for?
751 <LI><A NAME="TOC296" HREF="FAQ.html#SEC296">Q5027</A>: What does the log message "no immediate delivery: more than 10 messages
752        received in one connection" mean?
753 <LI><A NAME="TOC297" HREF="FAQ.html#SEC297">Q5028</A>: Although I haven't set <TT>check_spool_space</TT>, Exim is still checking the
754        amount of space on the spool for incoming SMTP messages that use the
755        SIZE option. Can I suppress this?
756 <LI><A NAME="TOC298" HREF="FAQ.html#SEC298">Q5029</A>: I just noticed log entries that start off "&#60;= &#60;&#62;". Am I correct in
757        assuming that the "&#60;&#62;" indicates that the envelope did not contain any
758        "From" data?
759 <LI><A NAME="TOC299" HREF="FAQ.html#SEC299">Q5030</A>: I've received a message which does not have my address in the To:
760        line. It is a spam message with the same address in both the From: and
761        the To: headers. How can this happen, and why doesn't Exim reject it?
762 <LI><A NAME="TOC300" HREF="FAQ.html#SEC300">Q5031</A>: Can (or will) Exim ever handle a message delivery purely in memory,
763        that is, it is handled without it ever hitting the disc?
764 <LI><A NAME="TOC301" HREF="FAQ.html#SEC301">Q5032</A>: If I am using dbm files for data that Exim reads, can I rebuild them
765        on the fly, or do I need to restart Exim every time I make a change?
766 <LI><A NAME="TOC302" HREF="FAQ.html#SEC302">Q5033</A>: What are the main differences between using an Exim filter and using
767        procmail?
768 <LI><A NAME="TOC303" HREF="FAQ.html#SEC303">Q5034</A>: I need an option that is the opposite of <B>-bpa,</B> that is, a listing of
769        those addresses generated from a top-level address that have not yet
770        been delivered.
771 <LI><A NAME="TOC304" HREF="FAQ.html#SEC304">Q5035</A>: I am getting complaints from a customer who uses my EXIM server for
772        relaying that they are being blocked with a "Too many connections"
773        error.
774 <LI><A NAME="TOC305" HREF="FAQ.html#SEC305">Q5036</A>: When I try "exim <B>-bf"</B> to test a system filter, I received the following
775        error message: "Filter error: unavailable filtering command "fail" near
776        line 8 of filter file".
777 <LI><A NAME="TOC306" HREF="FAQ.html#SEC306">Q5037</A>: How can I make Exim receive incoming mail, queue it, but NOT attempt to
778        deliver it? I want to be in this state while moving some mailboxes.
779 <LI><A NAME="TOC307" HREF="FAQ.html#SEC307">Q5038</A>: What does the rejection message "reject all recipients: 3 times bad
780        sender" mean?
781 <LI><A NAME="TOC308" HREF="FAQ.html#SEC308">Q5039</A>: The menu in Eximon isn't working. It displays, but I can't select
782        anything from it.
783 <LI><A NAME="TOC309" HREF="FAQ.html#SEC309">Q5040</A>: What does "ridiculously long message header" in an error report mean?
784 <LI><A NAME="TOC310" HREF="FAQ.html#SEC310">Q5041</A>: What does Exim use for POP as a default?  Do I have to install anything
785        else?
786 <LI><A NAME="TOC311" HREF="FAQ.html#SEC311">Q5042</A>: I see that Exim doesn't support SSL. Can it be made to work with stunnel?
787 <LI><A NAME="TOC312" HREF="FAQ.html#SEC312">Q5043</A>: Is there an easy way of removing all queued messages at once in a safe
788        way?
789 <LI><A NAME="TOC313" HREF="FAQ.html#SEC313">Q5044</A>: What is the best way to provide backup MX for clients?
790 <LI><A NAME="TOC314" HREF="FAQ.html#SEC314">Q5045</A>: Why does Exim do "ident" callbacks by default? Isn't this just a waste
791        of resources? I've been told this is an ancient way of authentication.
792        Is it obsolete?
793 <LI><A NAME="TOC315" HREF="FAQ.html#SEC315">Q5046</A>: I often have the problem that a message gets stuck in the mailq and I
794        want it to be bounced to a certain address.
795 <LI><A NAME="TOC316" HREF="FAQ.html#SEC316">Q5047</A>: What precautions should I take when editing <B>exim.conf?</B>
796 <LI><A NAME="TOC317" HREF="FAQ.html#SEC317">Q5048</A>: Is exim able to use RFC 2645, On-demand Mail Relay (ODMR)?
797 <LI><A NAME="TOC318" HREF="FAQ.html#SEC318">Q5049</A>: I want to send every bounced mail that is received by my server, as
798        "headers-only" to the sysadmin. How can I do this?
799 <LI><A NAME="TOC319" HREF="FAQ.html#SEC319">Q5050</A>: What POP3 daemon should I use with Exim? I want something with
800        configurable authentication mechanisms.
801 <LI><A NAME="TOC320" HREF="FAQ.html#SEC320">Q5051</A>: Is there any way I can send bounces to the postmaster, and nobody else?
802        Basically, I want to recieve them, and I don't want the reply/from
803        person to get them. If I think they need it I will forward it myself.
804 </UL>
805
806 <A NAME="TOC321" HREF="FAQ.html#SEC321">93. HP-UX</A>
807 <UL>
808 <LI><A NAME="TOC322" HREF="FAQ.html#SEC322">Q9301</A>: I'm trying to compile on an HP machine and I don't have gcc there. So I
809        put <TT>CC=cc</TT> in the <B>Local/Makefile</B>, but I got this error:
810 </UL>
811
812 <A NAME="TOC323" HREF="FAQ.html#SEC323">94. BSDI</A>
813 <UL>
814 <LI><A NAME="TOC324" HREF="FAQ.html#SEC324">Q9401</A>: On BSDI 4.0, Exim built with Perl support exits with the error message
815 </UL>
816
817 <A NAME="TOC325" HREF="FAQ.html#SEC325">95. IRIX</A>
818 <UL>
819 <LI><A NAME="TOC326" HREF="FAQ.html#SEC326">Q9501</A>: I'm running IRIX 6.2 with a number of alias IP addresses set up, but
820        Exim doesn't seem to recognize them as local addresses.
821 <LI><A NAME="TOC327" HREF="FAQ.html#SEC327">Q9502</A>: The IP addresses for incoming calls are all being given as
822        255.255.255.255 or 0.0.0.0.
823 </UL>
824
825 <A NAME="TOC328" HREF="FAQ.html#SEC328">96. LINUX</A>
826 <UL>
827 <LI><A NAME="TOC329" HREF="FAQ.html#SEC329">Q9601</A>: Exim is mysteriously crashing, usually when forking to send a delivery
828        error message.
829 <LI><A NAME="TOC330" HREF="FAQ.html#SEC330">Q9602</A>: Exim has created a directory called <B>build-Linux-libc5-i386</B> but is
830        trying to reference <B>build-Linux-libc5-i386-linux</B> while building.
831 <LI><A NAME="TOC331" HREF="FAQ.html#SEC331">Q9603</A>: I want to use logrotate which is standard with <B>RH5.2</B> Linux to rotate
832        my mail logs. Anyone worked out the logrotate config file that will
833        do this?
834 <LI><A NAME="TOC332" HREF="FAQ.html#SEC332">Q9604</A>: I'm seeing the message "<B>inetd</B>[334]: imap/tcp server failing (looping),
835        service terminated" on a RedHat 5.2 system, causing imap connections to
836        be refused. The imapd in use is Washington Uni vers 12.250. Could this
837        be anything to do with Exim?
838 <LI><A NAME="TOC333" HREF="FAQ.html#SEC333">Q9605</A>: I get the "too many open files" error especially when a lot of messages
839        land for majordomo at the same time.
840 <LI><A NAME="TOC334" HREF="FAQ.html#SEC334">Q9606</A>: I'm having a problem with an Exim RPM.
841 <LI><A NAME="TOC335" HREF="FAQ.html#SEC335">Q9607</A>: I installed debian 2.2 linux on a small 325mb 486 laptop. When I try
842        to test the Mail program, I get the following error: "Failed to open
843        configuration file <B><B>/etc/exim.conf</B>".</B>
844 <LI><A NAME="TOC336" HREF="FAQ.html#SEC336">Q9608</A>: I'm getting the error <B>"db.h:</B> No such file or directory" when I try to
845        build Exim under RedHat 7.0.
846 </UL>
847
848 <A NAME="TOC337" HREF="FAQ.html#SEC337">97. SUN SYSTEMS</A>
849 <UL>
850 <LI><A NAME="TOC338" HREF="FAQ.html#SEC338">Q9701</A>: Exim builds fine with gcc on SunOS 4 but crashes inside <B>sscanf()</B>.
851 <LI><A NAME="TOC339" HREF="FAQ.html#SEC339">Q9702</A>: How can I get rid of spurious ^M characters in messages sent from
852        CDE <B>dtmail</B>?
853 <LI><A NAME="TOC340" HREF="FAQ.html#SEC340">Q9703</A>: On SunOS 4 Exim crashes when looking up domains in the DNS that have
854        more than 10 A records.
855 <LI><A NAME="TOC341" HREF="FAQ.html#SEC341">Q9704</A>: The menu in Eximon isn't working on my Sun system.
856 <LI><A NAME="TOC342" HREF="FAQ.html#SEC342">Q9705</A>: I am experiencing mailbox locking problems with Sun's <B>mailtool</B> used
857        over a network.
858 <LI><A NAME="TOC343" HREF="FAQ.html#SEC343">Q9706</A>: Exim has been crashing on my Solaris x86 system, apparently while
859        running DBM functions.
860 <LI><A NAME="TOC344" HREF="FAQ.html#SEC344">Q9707</A>: The exiwhat utility isn't working for me on a Solaris 2 system.
861 <LI><A NAME="TOC345" HREF="FAQ.html#SEC345">Q9708</A>: How do I stop Sun's <B>dtcm</B> from hanging?
862 <LI><A NAME="TOC346" HREF="FAQ.html#SEC346">Q9709</A>: I want Exim to use only the resolver (i.e. ignore <B>/etc/hosts</B>), but don't
863        want to alter the <B>nsswitch.conf</B> file in Solaris 2.
864 </UL>
865
866 <A NAME="TOC347" HREF="FAQ.html#SEC347">98. COOKBOOK</A>
867 <UL>
868 <LI><A NAME="TOC348" HREF="FAQ.html#SEC348">Q9801</A>: How do I configure Exim as part of TPC <B>(<A HREF="http://www.tpc.int">http://www.tpc.int</A>)?</B>
869 <LI><A NAME="TOC349" HREF="FAQ.html#SEC349">Q9802</A>: How do I configure Exim so that it sends mail to the outside world only
870        from a restricted list of our local users?
871 <LI><A NAME="TOC350" HREF="FAQ.html#SEC350">Q9803</A>: How do I configure Exim to run with SmartList?
872 <LI><A NAME="TOC351" HREF="FAQ.html#SEC351">Q9804</A>: How do I configure Exim to minic PP's "tripnote" facility?
873 <LI><A NAME="TOC352" HREF="FAQ.html#SEC352">Q9805</A>: How do I configure Exim to handle local parts with extensions?
874 <LI><A NAME="TOC353" HREF="FAQ.html#SEC353">Q9806</A>: How do I configure Exim so that only a restricted list of users can
875        receive mail from external domains?
876 <LI><A NAME="TOC354" HREF="FAQ.html#SEC354">Q9807</A>: I have <B><B>someuser@mydomain.com</B></B> that I only want certain users to be able
877        to mail to. How do I accomplish this?
878 <LI><A NAME="TOC355" HREF="FAQ.html#SEC355">Q9808</A>: A site for which I provide secondary MX is down for some time. Is there
879        a way to run the queue for that destination separately from the main
880        queue?
881 <LI><A NAME="TOC356" HREF="FAQ.html#SEC356">Q9809</A>: How do I implement VERP (Variable Envelope Return Paths) in Exim?
882 <LI><A NAME="TOC357" HREF="FAQ.html#SEC357">Q9810</A>: I'd like to make a copy of all outgoing messages to a local mailbox. Is
883        there a solution for this using an Exim filter?
884 <LI><A NAME="TOC358" HREF="FAQ.html#SEC358">Q9811</A>: I want to make a copy of outgoing messages to a specific file for each
885        user in a specific directory, using a "save" command in a system filter.
886        How can I arrange for Exim to write to these files under the correct
887        UID/GID?
888 <LI><A NAME="TOC359" HREF="FAQ.html#SEC359">Q9812</A>: How can I keep an archive of all mail for some specific local email
889        addresses?
890 <LI><A NAME="TOC360" HREF="FAQ.html#SEC360">Q9813</A>: How can I configure Exim to provide a vacation message when there are
891        no local users on my mail hub?
892 <LI><A NAME="TOC361" HREF="FAQ.html#SEC361">Q9814</A>: We want to be able to temporarily lock out a user by disabling the
893        password and moving the home directory to another place. How can we
894        arrange to reject mail for users in this state?
895 <LI><A NAME="TOC362" HREF="FAQ.html#SEC362">Q9815</A>: I need an alias, say "fakeaddress" that should receive a message,
896        strip all reply-to: headers present, substitute another one pointing to
897        "otheraddress" and forward a message to "realaddress".
898 <LI><A NAME="TOC363" HREF="FAQ.html#SEC363">Q9816</A>: How can I set up Exim to work with Listar?
899 <LI><A NAME="TOC364" HREF="FAQ.html#SEC364">Q9817</A>: I need to take copies of all incoming and outgoing mail for certain
900        users. For each user there may be a different monitoring address.
901 <LI><A NAME="TOC365" HREF="FAQ.html#SEC365">Q9818</A>: How can I add a disclaimer to the end of every message?
902 <LI><A NAME="TOC366" HREF="FAQ.html#SEC366">Q9819</A>: I would like to append a simple advertisement text to all outgoing
903        and local mails.
904 <LI><A NAME="TOC367" HREF="FAQ.html#SEC367">Q9820</A>: How can I configure Exim so that all mails adressed to
905        <B><B>something@username.domain.net</B></B> get delivered to <B>/var/spool/mail/username</B>?
906 <LI><A NAME="TOC368" HREF="FAQ.html#SEC368">Q9821</A>: How do I get exim not to add a Sender: header to locally originated
907        mail?
908 <LI><A NAME="TOC369" HREF="FAQ.html#SEC369">Q9822</A>: How can I get Exim to work with mailman?
909 <LI><A NAME="TOC370" HREF="FAQ.html#SEC370">Q9823</A>: Is there any way to have messages sent to a specific local address
910        delayed by - say - 24 hours?
911 <LI><A NAME="TOC371" HREF="FAQ.html#SEC371">Q9824</A>: I have a mailing list exploder on one host, and three other hosts where
912        I want to do the actual deliveries from. How can I get Exim to split
913        a message into groups of recipients between the three hosts?
914 </UL>
915
916 <A NAME="TOC372" HREF="FAQ.html#SEC372">99. LIST OF SAMPLE CONFIGURATIONS</A>
917 <UL>
918 </UL>
919 <BR><H2><A NAME="SEC1" HREF="FAQ.html#TOC1">0. DEBUGGING
920
921 </A></H2>
922 <A NAME="SEC2" HREF="FAQ.html#TOC2">Q0001</A>: Exim is crashing. What is wrong?
923
924
925 <P>
926 A0001: Exim should never crash. The author is always keen to know about
927        crashes, so that they can be diagnosed and fixed. However, before you
928        start sending email, please check that you are running the latest
929        release of Exim, in case the problem has already been fixed. The
930        techniques described below can also be useful in trying to pin down
931        exactly which circumstances caused the crash and what Exim was trying to
932        do at the time. If the crash is reproducable (by a particular message,
933        say) keep a copy of that message. If there is a core file (in Exim's
934        spool directory), see if you can get any information from it.
935
936 </P>
937 <P>
938        One thing that has caused crashes in the past has been incorrectly
939        installed DB libraries. In particular, if you are running any version of
940        Berkeley db, it is best to set <TT>USE_DB=yes</TT> in <B>Local/Makefile</B> before
941        building Exim. This then avoids the use of the "ndbm compatibility
942        interface" via the <B>ndbm.h</B> include file, which has been found to be
943        incorrect on some systems. If you have already built Exim, you can just
944        edit <B>Local/Makefile</B> and run <B>make</B> again to rebuild. Before restarting
945        Exim, delete any existing database files in the <B>spool/db</B> directory.
946
947 </P>
948 <A NAME="SEC3" HREF="FAQ.html#TOC3">Q0002</A>: Exim is not working. What is wrong? How can I check what it is doing?
949
950
951 <P>
952 A0002: Exactly how is it not working? Check the more specific questions in the
953        other sections of this FAQ. Some general techniques for debugging are:
954
955 </P>
956 <P>
957        1. Look for information in Exim's log files. These are in the "log"
958           directory in Exim's spool directory, unless you have configured a
959           different path for them. Serious operational problems are reported
960           in paniclog.
961
962 </P>
963 <P>
964        2. If the problem involves the delivery of one or more messages, try
965           forcing a delivery with the <B>-d</B> option, to cause Exim to output
966           debugging information. For example:
967
968 </P>
969 <PRE>
970             exim -d -M 0z6CXU-0005RR-00</PRE>
971 <P>
972           On its own, <B>-d</B> produces a small amount of information. Following it
973           with a number increases the amount given: <B>-d9</B> gives the maximum
974           amount of general information; <B>-d10</B> gives in addition details of the
975           interpretation of filter files, and <B>-d11</B> or higher also turns on the
976           debugging option for DNS lookups. The output is written to the
977           standard error stream.
978
979 </P>
980 <P>
981        3. If the problem involves incoming SMTP mail, try using the <B>-bh</B> option
982           to simulate an incoming connection from a specific host, for example:
983
984 </P>
985 <PRE>
986             exim -bh 10.9.8.7</PRE>
987 <P>
988           This goes through the motions of an SMTP session, without actually
989           accepting a message. Information about various policy checks is
990           output. You will need to know how to pretend to be an SMTP client.
991
992 </P>
993 <P>
994        4. If the problem involves lack of recognition or incorrect handling
995           of local addresses, try using the <B>-bt</B> option with debugging turned
996           on, to see how Exim is handling the address. For example,
997
998 </P>
999 <PRE>
1000             exim -d2 -bt z6abc</PRE>
1001 <P>
1002           will show you how it would handle the local part "z6abc". Increase
1003           the debug level to <B>-d9</B> for more information.
1004
1005 </P>
1006 <A NAME="SEC4" HREF="FAQ.html#TOC4">Q0003</A>: What does the error "Child process of <TT>address_pipe</TT> transport returned
1007        69 from command <I>xxx</I>" mean?
1008
1009
1010 <P>
1011 A0003: The most common meaning of exit code 69 is "unavailable", and this often
1012        means that when Exim tried to exec the command <I>xxx</I>, it failed. One
1013        cause of this might be incorrect permissions on the file containing the
1014        command. See also 
1015         <A HREF="FAQ.html#SEC34">Q0033</A>.
1016
1017 </P>
1018 <A NAME="SEC5" HREF="FAQ.html#TOC5">Q0004</A>: My virtual domain setup isn't working. How can I debug it?
1019
1020
1021 <P>
1022 A0004: You can use an exim command with <B>-d</B> (or <B>-d2,</B> <B>-d3</B> ... <B>-d9)</B> to get it to
1023        show you how it is processing addresses. You don't actually need to send
1024        a message; use the <B>-bt</B> option like this:
1025
1026 </P>
1027 <PRE>
1028          exim -d2 -bt localpart@virtualhost</PRE>
1029 <P>
1030        This will show you which directors it is using. If the problem appears
1031        to be with the expansion of an option setting, you can use the
1032        <TT>debug_print</TT> option on a director (or router) to get Exim to output the
1033        expanded string values as it goes along.
1034
1035 </P>
1036 <A NAME="SEC6" HREF="FAQ.html#TOC6">Q0005</A>: Why is Exim giving "421 Unexpected log failure, please try later" when
1037        receiving an SMTP message with a large number of recipients?
1038
1039
1040 <P>
1041 A0005: You are verifying recipients, and your configuration is one that does a
1042        different lookup of some sort for each recipient. Exim keeps lookup
1043        files open, in case there are several lookups in the same file. Versions
1044        of Exim prior to 2.10 did not limit the number of open files used for
1045        this purpose, and your operating system's maximum per process has been
1046        reached. Exim is trying to log the failure to open a file, but cannot
1047        open the log file, for the same reason. If upgrading Exim is not
1048        immediately possible, you might be able to increase your operating
1049        system's maximum number of open files per process.
1050
1051 </P>
1052 <A NAME="SEC7" HREF="FAQ.html#TOC7">Q0006</A>: Why is Exim not rejecting incoming messages addressed to non-existent
1053        users at SMTP time?
1054
1055
1056 <P>
1057 A0006: Have you remembered to set <TT>receiver_verify</TT>? It is not the default.
1058
1059 </P>
1060 <A NAME="SEC8" HREF="FAQ.html#TOC8">Q0007</A>: I've put an entry for <B>*.my.domain</B> in a DBM lookup file, but it isn't
1061        getting recognized.
1062
1063
1064 <P>
1065 A0007: You need to request "partial matching" by setting the search type to
1066        "partial-dbm" in order for this to work.
1067
1068 </P>
1069 <A NAME="SEC9" HREF="FAQ.html#TOC9">Q0008</A>: I've put the entry <B><B>*@domain.com</B></B> in a lookup database, but it isn't
1070        working. The expansion I'm using is:
1071
1072
1073 <PRE>
1074          ${lookup{${lc:$sender_address}}dbm{/the/file} ...</PRE>
1075 <P>
1076 A0008: As no sender address will ever be <B><B>*@domain.com</B></B> this will indeed have
1077        no effect as it stands. You need to tell Exim if you want it to look for
1078        defaults after the normal lookup has failed. In this case, change the
1079        search type from "dbm" to "dbm*@". See the section on "Default values in
1080        single-key lookups" in the chapter entitled "File and database lookups".
1081
1082 </P>
1083 <A NAME="SEC10" HREF="FAQ.html#TOC10">Q0009</A>: Is there a way to print recognized local domains?
1084
1085
1086 <P>
1087 A0009: If you run "exim <B>-bP</B> <TT>local_domains</TT>" it will output the string that is
1088        set, but it won't print the contents of any files that are referenced.
1089
1090 </P>
1091 <A NAME="SEC11" HREF="FAQ.html#TOC11">Q0010</A>: If I run <B>"./exim</B> <B>-d9</B> <B>-bt</B> <B>user@domain</B>" all seems well, but when I send a
1092        message from my User Agent, it does not arrive at its destination.
1093
1094
1095 <P>
1096 A0010: Try sending a message directly to Exim by typing this:
1097
1098 </P>
1099 <PRE>
1100          exim -d9 user@domain
1101          &#60;some message, could be empty&#62;
1102          .</PRE>
1103 <P>
1104        If the message gets delivered to a remote host, but never arrives at its
1105        final destination, then the problem is at the remote host. If, however,
1106        the message gets through correctly, then the problem may be between your
1107        User Agent and Exim. Try setting Exim's <TT>log_arguments</TT> option, to see
1108        with which arguments the UA is calling Exim.
1109
1110 </P>
1111 <A NAME="SEC12" HREF="FAQ.html#TOC12">Q0011</A>: I am getting this message in mainlog every so often: "no immediate
1112        delivery: too many connections (19, max 0)". What am I missing?
1113
1114
1115 <P>
1116 A0011: A current release of Exim. :-)  The message you are getting is the wrong
1117        message. What it should be saying is "too many messages received in one
1118        SMTP connection" (see next question). This bug was fixed in release
1119        2.051.
1120
1121 </P>
1122 <A NAME="SEC13" HREF="FAQ.html#TOC13">Q0012</A>: What does "no immediate delivery: too many messages received in one SMTP
1123        connection" mean?
1124
1125
1126 <P>
1127 A0012: An SMTP client may send any number of messages down a single SMTP
1128        connection to a server. Initially, an Exim server starts up a delivery
1129        process as soon as a message is received. However, in order not to start
1130        up too many processes when lots of messages are arriving (typically
1131        after a period of downtime), it stops doing immediate delivery after a
1132        certain number of messages have arrived down the same connection. The
1133        threshold is set by <TT>smtp_accept_queue_per_connection</TT>, and the default
1134        value is 10. On large systems, the value should be increased. If you are
1135        running a dial-in host and expecting to get all your mail down a single
1136        SMTP connection, then you can disable the limit altogether by setting
1137        the value to zero.
1138
1139 </P>
1140 <A NAME="SEC14" HREF="FAQ.html#TOC14">Q0013</A>: Exim puts "for &#60;address&#62;" in the Received: headers of some, but not all,
1141        messages. Is this a bug?
1142
1143
1144 <P>
1145 A0013: No. It is deliberate. Exim inserts a "for" phrase only if the incoming
1146        message has precisely one recipient. If there is more than one
1147        recipient, nothing is inserted. The reason for this is that not all
1148        recipients appear in the To: or Cc: headers, and it is considered a
1149        breach of privacy to expose such recipients to the others. A common
1150        case is when a message has come from a mailing list.
1151
1152 </P>
1153 <A NAME="SEC15" HREF="FAQ.html#TOC15">Q0014</A>: Instead of <TT>exim_dbmbuild</TT>, I'm using a homegrown program to build DBM
1154        (or cdb) files, but Exim doesn't seem to be able to use them.
1155
1156
1157 <P>
1158 A0014: Exim expects there to be a binary zero value on the end of each key used
1159        in a DBM file if you use the "dbm" lookup type, but not for the "dbmnz"
1160        lookup type or for the keys of a cdb file. Check that you haven't
1161        slipped up in this regard.
1162
1163 </P>
1164 <A NAME="SEC16" HREF="FAQ.html#TOC16">Q0015</A>: Exim is unable to route to any remote domains. It doesn't seen to be
1165        able to access the DNS.
1166
1167
1168 <P>
1169 A0015: Try running "exim <B>-d11</B> <B>-bt</B> &#60;remote address&#62;". The <B>-d11</B> will make it show
1170        the resolver queries it is building and the results of its DNS queries.
1171        If it appears unable to contact any nameservers, check the contents and
1172        permissions of <B><B>/etc/resolv.conf</B>.</B>
1173
1174 </P>
1175 <A NAME="SEC17" HREF="FAQ.html#TOC17">Q0016</A>: I'm using ETRN to run a script that checks things and doesn't always
1176        end up running "exim <B><B>-R".</B></B> However, after it has run once, subsequent
1177        attempts fail with "458 Already processing".
1178
1179
1180 <P>
1181 A0016: Set <TT>no_smtp_etrn_serialize</TT>.
1182
1183 </P>
1184 <A NAME="SEC18" HREF="FAQ.html#TOC18">Q0017</A>: What does the error message "transport <TT>system_aliases</TT>: cannot find
1185        transport driver "<B>aliasfile</B>" in line 92" mean?
1186
1187
1188 <P>
1189 A0017: "<B>aliasfile</B>" is a director, not a transport. You have put a configuration
1190        for a director into the transports section of the configuration file.
1191
1192 </P>
1193 <A NAME="SEC19" HREF="FAQ.html#TOC19">Q0018</A>: Exim is timing out after receiving and responding to the DATA command
1194        from one particular host, and yet the client host also claims to be
1195        timing out. This seems to affect only certain messages.
1196
1197
1198 <P>
1199 A0018: (A) This problem has been seen with a network that was dropping all
1200        packets over a certain size, which mean that the first part of the SMTP
1201        transaction worked, but when the body of a large message started
1202        flowing, the main data bits never got through the network. See also
1203        
1204         <A HREF="FAQ.html#SEC22">Q0021</A>.
1205
1206 </P>
1207 <P>
1208        (B) This can also happen if a machine has a broken TCP stack and won't
1209        reassemble fragmented datagrams.
1210
1211 </P>
1212 <P>
1213        (C) A very few ISDN lines have been seen which failed when certain data
1214        patterns were sent through them, and replacing the routers at both end
1215        of the link did not fix things. One of them was triggered by more than 4
1216        X's in a row in the data.
1217
1218 </P>
1219 <A NAME="SEC20" HREF="FAQ.html#TOC20">Q0019</A>: What does the message "Socket bind() to port 25 for address (any)
1220        failed: address already in use" mean?
1221
1222
1223 <P>
1224 A0019: You are trying to run an Exim daemon when there is one already running -
1225        or maybe some other MTA is running, or perhaps you have an SMTP line in
1226        <B><B>/etc/inetd.conf</B></B> which is causing <B>inetd</B> to listen on port 25.
1227
1228 </P>
1229 <A NAME="SEC21" HREF="FAQ.html#TOC21">Q0020</A>: I've set <TT>headers_check_syntax</TT>, but this causes Exim to complain about
1230        headers like "To: Work: Jim <B>&#60;jims@email</B>&#62;, Home: Bob <B>&#60;bobs@email</B>&#62;" which
1231        look all right to me. Is this a bug?
1232
1233
1234 <P>
1235 A0020: No. Header lines such as From:, To:, <B>etc.,</B> which contain addresses, are
1236        structured, and have to be in a specific format which is defined in RFC
1237        822. Unquoted colons are not allowed in the "phrase" part of an email
1238        address (they are OK in other headers such as Subject:). The correct
1239        form for that header is
1240
1241 </P>
1242 <PRE>
1243          To: "Work: Jim" &#60;jims@email&#62;, "Home: Bob" &#60;bobs@email&#62;</PRE>
1244 <P>
1245        You will sometimes see unquoted colons in To: and Cc: headers, but only
1246        in connection with name lists (called "groups"), for example:
1247
1248 </P>
1249 <PRE>
1250          To: My friends: X &#60;x@y.x&#62;, Y &#60;y@w.z&#62;;,
1251              My enemies: A &#60;a@b.c&#62;, B &#60;b@c.d&#62;;</PRE>
1252 <P>
1253        Each list must be terminated by a semicolon, as shown.
1254
1255 </P>
1256 <A NAME="SEC22" HREF="FAQ.html#TOC22">Q0021</A>: Whenever Exim tries to deliver a specific message to a particular
1257        server, it fails, giving the error "Remote end closed connection after
1258        data" or "Broken pipe" or a timeout. What's going on?
1259
1260
1261 <P>
1262 A0021: "Broken pipe" is the error you get on some OS when the far end just
1263        drops the connection. The alternative is "connection reset by peer".
1264
1265 </P>
1266 <P>
1267        (A) There are some firewalls that fall over on \0 characters in the
1268        mail. Have a look, e.g. with hexdump <B>-c</B> mymail | tail to see if your
1269        mail contains any binary zero characters.
1270
1271 </P>
1272 <P>
1273        (B) There are broken SMTP servers around that just drop the connection
1274        after the data has been sent if they don't like the message for some
1275        reason (e.g. it is too big) instead of sending a 5xx error code. Have
1276        you tried sending a small message to the same address?
1277
1278 </P>
1279 <P>
1280        It has been reported that some releases of Novell servers running NIMS
1281        are unable to handle lines longer than 1024 characters, and just close
1282        the connection. This is an example of this behaviour.
1283
1284 </P>
1285 <P>
1286        (C) If the problem occurs right at the start of the mail, then it could
1287        be a network problem with mishandling of large packets. Many emails are
1288        small and thus appear to propagate correctly, but big emails will
1289        generate big IP datagrams.
1290
1291 </P>
1292 <P>
1293        There have been problems when something in the middle of the network
1294        mishandles large packets due to IP tunnelling. In a tunnelled link, your
1295        IP datagrams gets wrapped in a larger datagram and sent over a network.
1296        This is how virtual private networks (VPNs), and some ISP transit
1297        circuits work. Since the datagrams going over the tunnel require a
1298        larger packet size, the tunnel needs a bigger maximum transfer unit
1299        (MTU) in the network handling the tunnelled packets. However, MTUs
1300        are often fixed, so the tunnel will try to fragment the packets.
1301
1302 </P>
1303 <P>
1304        If the systems outside the tunnel are using MTU path discovery, (most
1305        Sun Sparc Solaris machines do by default), and set the DF (don't
1306        fragment) bit because they don't send packets larger than their <EM>local</EM>
1307        MTU, then ICMP control messages will be sent by the routers at the
1308        ends of the tunnel to tell them to reduce their MTU, since the tunnel
1309        can't fragment the data, and has to throw it away. If this mechanism
1310        stops working, e.g. a firewall blocks ICMP, then your host never
1311        knows it has hit the maximum path MTU, but it has received no ACK on
1312        the packet either, so it continues to resend the same packet and the
1313        connection stalls, eventually timing out.
1314
1315 </P>
1316 <P>
1317        You can test the link using pings of large packets and see what works:
1318
1319 </P>
1320 <PRE>
1321          ping -s host 2048</PRE>
1322 <P>
1323        Try reducing the MTU on the sending host:
1324
1325 </P>
1326 <PRE>
1327          ifconfig le0 mtu 1300</PRE>
1328 <P>
1329        Alternatively, you can reduce the size of the buffer Exim uses for SMTP
1330        output by putting something like
1331
1332 </P>
1333 <PRE>
1334          DELIVER_OUT_BUFFER_SIZE=512</PRE>
1335 <P>
1336        in your <B>Local/Makefile</B> and rebuilding Exim (the default is 8192).
1337
1338 </P>
1339 <A NAME="SEC23" HREF="FAQ.html#TOC23">Q0022</A>: Why do messages not get delivered down the same connection when I do
1340        something like: exim <B>-v</B> <B>-R</B> <B>@aol.com</B> ? For other domains, I do this and
1341        I see the appropriate "waiting for passed connections to get used"
1342        messages.
1343
1344
1345 <P>
1346 A0022: Recall that Exim does not keep separate queues for each domain, but
1347        operates in a distributed fashion. Messages get into its "waiting for
1348        host x" hints database only when a delivery has been tried, and has had
1349        a temporary error. Here are some possibilities:
1350
1351 </P>
1352 <P>
1353        (1) The messages to <B>aol.com</B> got put in your queue, but no previous
1354        delivery attempt occured before you did the <B><B>-R.</B></B> This might have been
1355        because of your settings of <TT>queue_only_load</TT>, <TT>smtp_accept_queue</TT>, or any
1356        other option that caused no immediate delivery attempt on arrival. If
1357        this is the case, you can try using <B>-qqR</B> instead of <B><B>-R.</B></B>
1358
1359 </P>
1360 <P>
1361        (2) You have set <TT>batch_max</TT> on the smtp transport, and that limit was
1362        reached. This would show as a sequence of n messages down one
1363        connection, then another n down a new connection, etc.
1364
1365 </P>
1366 <P>
1367        (3) Exim tried to pass on the SMTP connection to another message, but
1368        that message was in the process of being delivered to <B>aol.com</B> by some
1369        other process (typically, a normal queue runner). This will break the
1370        sequence, though the other delivery should pass its connection on to
1371        other messages if there are any.
1372
1373 </P>
1374 <P>
1375        (4) The folk at <B>aol.com</B> changed the MX records so the host names have
1376        changed - or a new host has been added. I don't know how likely this is.
1377
1378 </P>
1379 <P>
1380        (5) Exim is not performing as it should in this regard, for some reason.
1381        Next time you have mail queued up for <B>aol.com,</B> try running
1382
1383 </P>
1384 <PRE>
1385          exim_dumpdb /var/spool/exim wait-remote_smtp</PRE>
1386 <P>
1387        to see if those messages are listed among those waiting for the relevant
1388        <B>aol.com</B> hosts.
1389
1390 </P>
1391 <A NAME="SEC24" HREF="FAQ.html#TOC24">Q0023</A>: What does the error "SEGV while reading ... from dbm file: record
1392        assumed not to exist" mean?
1393
1394
1395 <P>
1396 A0023: A crash is occuring when Exim calls your DBM library in order to read a
1397        record from one of its hints files. This kind of problem can be related
1398        to incorrectly installed DBM libraries. If you are using Slackware 3.6,
1399        the problem is that libgdbm is incorrectly installed on that system, and
1400        you will need to re-install it from source.
1401
1402 </P>
1403 <A NAME="SEC25" HREF="FAQ.html#TOC25">Q0024</A>: There seems to be a problem in the string expansion code: it doesn't
1404        recognize references to headers such as <B><B>${h_to}.</B></B>
1405
1406
1407 <P>
1408 A0024: The only valid syntax for header references is (for example) <B>$h_to:</B>
1409        because header names are permitted by RFC 822 to contain a very wide
1410        range of characters. A colon (or white space) is required as the
1411        terminator.
1412
1413 </P>
1414 <A NAME="SEC26" HREF="FAQ.html#TOC26">Q0025</A>: Exim is timing out after sending the a message's data to one particular
1415        host, and yet the remote host also claims to be timing out. This seems
1416        to affect only certain messages.
1417
1418
1419 <P>
1420 A0025: See 
1421         <A HREF="FAQ.html#SEC19">Q0018</A>.
1422
1423 </P>
1424 <A NAME="SEC27" HREF="FAQ.html#TOC27">Q0026</A>: When the Exim daemon forks a copy of itself to handle an incoming SMTP
1425        request, the forked copy seems to go around in circles  for a
1426        significant (up to 5 minutes, so far) amount of time before deciding to
1427        accept the message.
1428
1429
1430 <P>
1431 A0026: These kinds of delay are usually caused by some kind of network problem
1432        that affects outgoing calls made by Exim at the start of an incoming
1433        message. Configuration options that cause outgoing calls are:
1434
1435 </P>
1436 <P>
1437        (1) <TT>rfc1413_query_hosts</TT> and <TT>rfc1413_query_timeout</TT> (for ident calls);
1438            firewalls sometimes block ident calls, which can lead to this
1439            problem.
1440
1441 </P>
1442 <P>
1443        (2) <TT>rbl_domains</TT> and <TT>rbl_hosts</TT>.
1444
1445 </P>
1446 <P>
1447        (3) <TT>host_lookup</TT> and any other options that require the remote host's
1448            name to be looked up from its IP address.
1449
1450 </P>
1451 <P>
1452        (4) <TT>sender_verify_hosts_callback</TT> and <TT>sender_verify_callback_domains</TT>.
1453
1454 </P>
1455 <P>
1456        You can use the <B>-bh</B> option to get more information about what is
1457        happening at the start of a connection.
1458
1459 </P>
1460 <A NAME="SEC28" HREF="FAQ.html#TOC28">Q0027</A>: What does "failed to create child process to send failure message" mean?
1461        This is a busy mail server with <TT>smtp_accept_max</TT> set to 500, but this
1462        problem started to occur at about 300 incoming connections.
1463
1464
1465 <P>
1466 A0027: Some message delivery failed, and when Exim wanted to send a bounce
1467        message, it was unable to create a process in which to do so. Probably
1468        the limit on the maximum number of simultaneously active processes has
1469        been reached. Most OS have some means of increasing this limit, and in
1470        some operating systems there is also a limit per uid which can be
1471        varied.
1472
1473 </P>
1474 <A NAME="SEC29" HREF="FAQ.html#TOC29">Q0028</A>: What does "&#60;message filter&#62; transporting defer (-1): No transport set
1475        by director" in a log line mean?
1476
1477
1478 <P>
1479 A0028: Your system filter contains a "save" command, but you have not set
1480        <TT>message_filter_file_transport</TT>.
1481
1482 </P>
1483 <A NAME="SEC30" HREF="FAQ.html#TOC30">Q0029</A>: Why is Exim refusing to relay, saying "failed to find host name from IP
1484        address" when I have the sender's IP address in <TT>host_accept_relay</TT>? My
1485        configuration contains this:
1486
1487
1488 <PRE>
1489          host_accept_relay = "lsearch;/etc/mail/relaydomains:192.168.96.0/24"</PRE>
1490 <P>
1491 A0029: When checking <TT>host_accept_relay</TT>, the items are tested in left-to-right
1492        order. The first item in your list is a lookup on the incoming host's
1493        name, so Exim has to determine the name from the incoming IP address in
1494        order to perform the test. If it can't find the host name, it can't do
1495        the check, so it gives up. The solution is to put all explicit IP
1496        addresses first in the list. You would have discovered what was going
1497        on if you had run a test such as
1498
1499 </P>
1500 <PRE>
1501          exim -bh 192.168.96.131</PRE>
1502 <A NAME="SEC31" HREF="FAQ.html#TOC31">Q0030</A>: When I run "exim <B>-bd</B> <B>-q10m"</B> I get "PANIC LOG: exec of exim <B>-q</B> failed".
1503
1504
1505 <P>
1506 A0030: This probably means that Exim doesn't know its own path so it can't
1507        re-exec itself to do the first queue run. Check the output of
1508
1509 </P>
1510 <PRE>
1511          exim -bP exim_path</PRE>
1512 <A NAME="SEC32" HREF="FAQ.html#TOC32">Q0031</A>: Why do connections to my machine's SMTP port take a long time to respond
1513        with the banner, when connections to other ports respond instantly?
1514
1515
1516 <P>
1517 A0031: See 
1518         <A HREF="FAQ.html#SEC27">Q0026</A>.
1519
1520 </P>
1521 <A NAME="SEC33" HREF="FAQ.html#TOC33">Q0032</A>: I can't seem to get a pipe command to run when I include a <B>${if</B>
1522        expansion in it. This fails:
1523
1524
1525 <PRE>
1526          command = "perl -T /usr/local/rt/bin/rtmux.pl \
1527                       rt-mailgate helpdesk \
1528                       ${if eq {$local_part}{rt} {correspond}{action}}"</PRE>
1529 <P>
1530 A0032: You need some internal quoting in there. Exim expands each individual
1531        argument separately. Because you have (necessarily) got spaces in your
1532        <B>${if</B> item, you have to quote that argument. Try
1533
1534 </P>
1535 <PRE>
1536          command = "perl -T /usr/local/rt/bin/rtmux.pl \
1537                       rt-mailgate helpdesk \
1538                       \"${if eq {$local_part}{rt} {correspond}{action}}\""</PRE>
1539 <A NAME="SEC34" HREF="FAQ.html#TOC34">Q0033</A>: I'm trying to get Exim to connect an alias to a pipe, but it always
1540        gives error code 69, with the comment "(could mean service or program
1541        unavailable)".
1542
1543
1544 <P>
1545 A0033: If your alias entry looks like this:
1546
1547 </P>
1548 <PRE>
1549          alias:  |"/some/command some parameters"</PRE>
1550 <P>
1551        change it to look like this:
1552
1553 </P>
1554 <PRE>
1555          alias:  "|/some/command some parameters"</PRE>
1556 <A NAME="SEC35" HREF="FAQ.html#TOC35">Q0034</A>: I'm having a problem with an Exim RPM.
1557
1558
1559 <P>
1560 A0034: See 
1561         <A HREF="FAQ.html#SEC334">Q9606</A>.
1562
1563 </P>
1564 <A NAME="SEC36" HREF="FAQ.html#TOC36">Q0035</A>: What does the error "Spool file is locked" mean?
1565
1566
1567 <P>
1568 A0035: This is not an error[*]. All it means is that when an Exim delivery
1569        process (probably started by a queue runner process) looked at a message
1570        in order to start delivering it, it found that another Exim process was
1571        already busy delivering it. On a busy system this is quite a common
1572        occurrence. If you set <TT>log_level</TT> less than 5, these messages are omitted
1573        from the log.
1574
1575 </P>
1576 <P>
1577        [*] The only time when this message might indicate a problem is if it is
1578        repeated for the same message for a very long time - say more than a few
1579        hours. That would suggest that the process that is delivering the
1580        message has somehow got stuck.
1581
1582 </P>
1583 <A NAME="SEC37" HREF="FAQ.html#TOC37">Q0036</A>: Exim is reporting IP addresses as 0.0.0.0 or 255.255.255.255 instead of
1584        their correct values. What's going on?
1585
1586
1587 <P>
1588 A0036: You are using a version of Exim built with gcc on an IRIX box.
1589        See 
1590         <A HREF="FAQ.html#SEC327">Q9502</A>.
1591
1592 </P>
1593 <A NAME="SEC38" HREF="FAQ.html#TOC38">Q0037</A>: I can't seem to figure out why PAM support doesn't work correctly.
1594
1595
1596 <P>
1597 A0037: There is a problem using PAM on Linux with shadow passwords when the
1598        calling program is not running as root. Exim is normally running as the
1599        Exim user when authenticating a remote host. I don't know of an easy
1600        resolution to this.
1601
1602 </P>
1603 <A NAME="SEC39" HREF="FAQ.html#TOC39">Q0038</A>: I'm trying to use a query-style lookup for hosts that are allowed to
1604        relay, but it is giving really weird errors.
1605
1606
1607 <P>
1608 A0038: Does your query contain a colon character? Remember that
1609        <TT>host_accept_relay</TT> operates on a colon-separated list, so you need to
1610        double any colons in the query. This applies even if the query is
1611        defined as a macro.
1612
1613 </P>
1614 <A NAME="SEC40" HREF="FAQ.html#TOC40">Q0039</A>: Exim is rejecting calls from hosts that have more than one IP address,
1615        for no apparent reason.
1616
1617
1618 <P>
1619 A0039: You are using Solaris 7 or earlier, and have "nis dns files" in
1620        <B><B>/etc/nsswitch.conf</B>.</B> Change this to "dns nis files" to avoid hitting Sun
1621        bug 1154236 (a bad interaction between NIS and the DNS).
1622
1623 </P>
1624 <A NAME="SEC41" HREF="FAQ.html#TOC41">Q0040</A>: Exim is failing to find the MySQL library, even though is it present
1625        within <B><B>$LD_LIBRARY_PATH.</B></B> I'm getting this error:
1626
1627
1628 <PRE>
1629          /usr/local/bin/exim: fatal: libmysqlclient.so.6: open failed:
1630          No such file or directory</PRE>
1631 <P>
1632 A0040: Exim is suid, and LD_LIBRARY_PATH is ignored for suid binaries on a
1633        Solaris (and other?) systems. What you should be doing is adding
1634        <B>-R/local/lib/mysql</B> to the same place in the compilation that you added
1635        <B><B>-L/local/lib/mysql.</B></B> This lets the binary know where to look without
1636        needing a path variable.
1637
1638 </P>
1639 <A NAME="SEC42" HREF="FAQ.html#TOC42">Q0041</A>: I have a collection of Exim processes that have been around for days,
1640        and are apparently stuck while trying to deliver to remote hosts. This
1641        is causing the messages they are handling to get stuck.
1642
1643
1644 <P>
1645 A0041: There appears to be a problem in the connect() function in some
1646        operating systems, such that it does not time out as it should. Setting
1647        <TT>connect_timeout</TT> in the smtp transport causes Exim to apply its own
1648        timeout, and this seems to overcome this problem. In Exim 3.15 the
1649        default was changed from zero (rely on system's timeout) to 5 minutes,
1650        which is the value recommended in the RFCs.
1651
1652 </P>
1653 <A NAME="SEC43" HREF="FAQ.html#TOC43">Q0042</A>: I have a message in the spool which couldn't be delivered because of a
1654        timeout from the remote smtp server. When I try to deliver this message
1655        in eximon, I get "Spool file is locked". How can I deliver the message?
1656
1657
1658 <P>
1659 A0042: Find the Exim proccess that is stuck, and kill it. You may be able to
1660        use exiwhat to do this, but if it is stuck in connect() it may not
1661        respond, and you will have to identify it some other way. Now read
1662        
1663         <A HREF="FAQ.html#SEC42">Q0041</A> about why this might have happened.
1664
1665 </P>
1666 <P>
1667        If you have a suitable debugger on your system, you may be able to find
1668        out more information before killing the process. For example, if you
1669        have gdb you can connect it to the process by running this command as
1670        root:
1671
1672 </P>
1673 <PRE>
1674          gdb exim &#60;process-id&#62;</PRE>
1675 <P>
1676        At the gdb prompt, give the "bt" (backtrace) command, to display the
1677        stack contents. This should tell you the name of the function in which
1678        the process is stuck. If this is connect(), then you do have the 
1679         <A HREF="FAQ.html#SEC42">Q0041</A>
1680        problem.
1681
1682 </P>
1683 <A NAME="SEC44" HREF="FAQ.html#TOC44">Q0043</A>: What does the error "lookup of host <B>"xx<EM>.xx</EM><EM>.xx</EM>"</B> failed in <I>yyy</I>y router"
1684        mean? Any suggestions to stop this these sort of errors from being
1685        frozen would be muchly appreciated.
1686
1687
1688 <P>
1689 A0043: You configured a <B>domainlist</B> router to send the message to <B>xx<EM>.xx</EM><EM>.xx</EM>.</B> When
1690        it tried to look up the IP address for that host, the lookup failed
1691        with a permanent error. As this is a manual routing, this is a
1692        considered to be a serious error which the postmaster needs to know
1693        about (maybe you have a typo in your file), and there is little point
1694        in keeping on trying. So it freezes the message.
1695
1696 </P>
1697 <P>
1698        1. Don't set up routes to non-existent hosts.
1699
1700 </P>
1701 <P>
1702        2. If you must set up routes to non-existent hosts, and don't want
1703        freezing, set the <TT>host_find_failed</TT> option on the router to do something
1704        other than freeze.
1705
1706 </P>
1707 <A NAME="SEC45" HREF="FAQ.html#TOC45">Q0044</A>: My filter isn't working. How can I test it?
1708
1709
1710 <P>
1711 A0044: Use the <B>-bf</B> option (-bF for a system filter) to test the basic operation
1712        of your filter. If you also turn on debugging at level 10 (-d10) it will
1713        output information as the filter runs.
1714
1715 </P>
1716 <A NAME="SEC46" HREF="FAQ.html#TOC46">Q0045</A>: Exim works fine on one host, but when I copied the binary to another
1717        identical host, it stopped working (it could not resolve DNS names).
1718
1719
1720 <P>
1721 A0045: Is the new host running exactly the same operating system? Most
1722        importantly, are the versions of the dynamically loaded libraries
1723        (files with names like <B>libsocket.so.1)</B> the same on both systems? If not,
1724        that is probably the cause of the problem. Either arrange for the
1725        libraries to be the same, or rebuild Exim from source on the new host.
1726
1727 </P>
1728 <A NAME="SEC47" HREF="FAQ.html#TOC47">Q0046</A>: Once in a while, a user will send a message and immediatly get a
1729        response back "No Transport Provider"  If they choose "Send Again",
1730        sometimes it works, sometimes it doesn't.
1731
1732
1733 <P>
1734 A0046: This problem has been seen on Debian Linux 2.1 systems. The best advice
1735        seems to be to upgrade your server to a later Debian release and a later
1736        Exim release, and maybe also upgrade the hardware.
1737
1738 </P>
1739 <A NAME="SEC48" HREF="FAQ.html#TOC48">Q0047</A>: I set <TT>host_accept_relay</TT> to do a lookup in a file of IP addresses, but it
1740        doesn't work.
1741
1742
1743 <P>
1744 A0047: Did you remember to put `net-' at the start of the the search type? If
1745        you set something like this:
1746
1747 </P>
1748 <PRE>
1749          host_accept_relay = lsearch;/some/file</PRE>
1750 <P>
1751        it searches the file for the host <EM>name</EM>. You need to set
1752
1753 </P>
1754 <PRE>
1755          host_accept_relay = net-lsearch;/some/file</PRE>
1756 <P>
1757        to make it use the IP address as the key to the lookup.
1758
1759 </P>
1760 <BR><H2><A NAME="SEC49" HREF="FAQ.html#TOC49">1. BUILDING EXIM
1761
1762 </A></H2>
1763 <A NAME="SEC50" HREF="FAQ.html#TOC50">Q0101</A>: I get the error "conflicting types" when Exim is building the libident
1764        library.
1765
1766
1767 <P>
1768 A0101: The problem is that libident assumes "struct timeval" refers to
1769        <TT>DST_NONE</TT>, and so it tries to avoid using this structure when <TT>DST_NONE</TT>
1770        isn't defined. Unfortunately it doesn't make this change everywhere it
1771        should, and so it blows up. The problem has been seen on NetBSD and
1772        some versions of the Linux C library. An easy, albeit not particularly
1773        neat, fix is to add <B><TT>-DDST_NONE</TT></B> to <TT>LIBIDENTCFLAGS</TT> for systems that are
1774        afflicted like this - there's not a lot else you can do without
1775        modifying libident. The value of <TT>DST_NONE</TT> is never used, so defining it
1776        to be empty should be harmless.
1777
1778 </P>
1779 <A NAME="SEC51" HREF="FAQ.html#TOC51">Q0102</A>: When I ran <B>make</B> I got the error "undefined reference to <TT>dbopen</TT>".
1780
1781
1782 <P>
1783 A0102: Either:
1784
1785 </P>
1786 <P>
1787        (A) This means you (or the default configuration for your operating
1788            system) have configured Exim to use Berkeley DB version 1<B><EM>.xx</EM></B>
1789            and it has not been given access to the DB library (where <TT>dbopen</TT>
1790            should be found). You may need something like <TT>DBMLIB=-ldb</TT> in
1791            <B>Local/Makefile</B>. Berkeley DB is one of several alternative DBM
1792            libraries that Exim can make use of. For a discussion of DBM issues,
1793            see the file <B>doc/dbm.discuss.txt</B> in the Exim distribution.
1794
1795 </P>
1796 <P>
1797        (B) You are running on a version of Linux which has a problem in its
1798            libraries. This effect isn't fully understood. It has been seen with
1799            the libraries used in Caldera OpenLinux Base 1.1.
1800
1801 </P>
1802 <A NAME="SEC52" HREF="FAQ.html#TOC52">Q0103</A>: I can't get Exim to compile with Berkeley DB version 2.x.
1803
1804
1805 <P>
1806 A0103: Have you set <TT>USE_DB=yes</TT> in <B>Local/Makefile</B>? This causes Exim to use the
1807        native interface to the DBM library instead of the compatibility
1808        interface, which needs a header called <B>ndbm.h</B> that may not exist on your
1809        system.
1810
1811 </P>
1812 <A NAME="SEC53" HREF="FAQ.html#TOC53">Q0104</A>: I'm getting an "undefined symbol" error for <TT>hosts_ctl</TT> when I try to
1813        build Exim. (On some systems this error is "undefined reference to
1814        'hosts_ctl'".)
1815
1816
1817 <P>
1818 A0104: You should either remove the definition of USE_TCP_WRAPPERS or add
1819        <B>-lwrap</B> to your <TT>EXTRALIBS</TT> setting in <B>Local/Makefile</B>.
1820
1821 </P>
1822 <A NAME="SEC54" HREF="FAQ.html#TOC54">Q0105</A>: I'm about to upgrade to a new Exim release. Do I need to ensure the
1823        spool is empty, or take any other special action?
1824
1825
1826 <P>
1827 A0105: If you are changing to release 3.00 or later from a release prior to
1828        3.00, you will probably need to make changes to the runtime
1829        configuration file. See <B>README.UPDATING</B> for details. Otherwise, you
1830        do not need to take special action. New releases are made backwards
1831        compatible with old spool files and "hints" databases so that upgrading
1832        can be done on a running system. All that should be necessary is to
1833        install a new binary and then HUP the daemon if you are running one.
1834
1835 </P>
1836 <A NAME="SEC55" HREF="FAQ.html#TOC55">Q0106</A>: What does the error "<B>install-info</B>: command not found" mean?
1837
1838
1839 <P>
1840 A0106: You have set INFO_DIRECTORY in your <B>Local/Makefile</B>, and Exim is trying
1841        to install the Texinfo documentation, but cannot find the command called
1842        <B>install-info</B>. If you have a version of Texinfo prior to 3.9, you
1843        should upgrade. Otherwise, check your installation of Texinfo to see why
1844        the <B>install-info</B> command is not available.
1845
1846 </P>
1847 <A NAME="SEC56" HREF="FAQ.html#TOC56">Q0107</A>: Exim doesn't seem to be recognizing my operating system type correctly,
1848        and so is failing to build.
1849
1850
1851 <P>
1852 A0107: Run the command "scripts/os-type <B><B>-generic".</B></B> The output should be one of
1853        the known OS types, and should correspond to your operating system. You
1854        can see which OS are supported by obeying "ls OS/Makefile-*" and looking
1855        at the file name suffixes.
1856
1857 </P>
1858 <P>
1859        If there is a discrepancy, it means that the script is failing to
1860        interpret the output from the "uname" command correctly, or that the
1861        output is wrong. Meanwhile, you can build Exim by obeying
1862
1863 </P>
1864 <PRE>
1865          EXIM_OSTYPE=xxxx make</PRE>
1866 <P>
1867        instead of just <B>make</B>, provided you are running a Bourne-compatible
1868        shell, or otherwise by setting EXIM_OSTYPE correctly in your
1869        environment. It is probably best to start again from a clean
1870        distribution, to avoid any wreckage left over from the failed attempt.
1871
1872 </P>
1873 <A NAME="SEC57" HREF="FAQ.html#TOC57">Q0108</A>: I am getting an error "`exim' undeclared here" when I compile, in the
1874        <B>globals.c</B> module.
1875
1876
1877 <P>
1878 A0108: You have set EXIM_UID = exim in your <B>Local/Makefile</B>. Unfortunately,
1879        named uids are not permitted here; you must give a numerical uid.
1880        However, in the runtime configure file names are permitted.
1881
1882 </P>
1883 <A NAME="SEC58" HREF="FAQ.html#TOC58">Q0109</A>: Exim fails to build, complaining about the absence of the "killpg"
1884        function.
1885
1886
1887 <P>
1888 A0109: This function should be present in all modern flavours of Unix. If you
1889        are using an older version, you should be able to get round the problem
1890        by inserting
1891
1892 </P>
1893 <PRE>
1894          #define killpg(pgid,sig)   kill(-(pgid),sig)</PRE>
1895 <P>
1896        into the file called <B>OS/os.h<I>-xx</I>x,</B> where <I>xxx</I> identifies your operating
1897        system, and is the output of the command "scripts/os-type <B><B>-generic".</B></B>
1898
1899 </P>
1900 <A NAME="SEC59" HREF="FAQ.html#TOC59">Q0110</A>: I'm getting an unresolved symbol <TT>ldap_is_ldap_url</TT> when trying to build
1901        Exim.
1902
1903
1904 <P>
1905 A0110: You must have specified <TT>LOOKUP_LDAP=yes</TT> in the configuration. Have you
1906        remembered to set <B>-lldap</B> somewhere (e.g. in LOOKUP_LIBS)? You need that
1907        in order to get the LDAP library scanned when linking.
1908
1909 </P>
1910 <A NAME="SEC60" HREF="FAQ.html#TOC60">Q0111</A>: I'm getting an unresolved symbol <TT>mysql_close</TT> when trying to build Exim.
1911
1912
1913 <P>
1914 A0111: You must have specified <TT>LOOKUP_MYSQL=yes</TT> in the configuration. Have you
1915        remembered to set <B>-lmysqlclient</B> somewhere (e.g. in LOOKUP_LIBS)? You
1916        need that in order to get the MySQL library scanned when linking.
1917
1918 </P>
1919 <A NAME="SEC61" HREF="FAQ.html#TOC61">Q0112</A>: I'm trying to build Exim with PAM support. I have included <B>-lpam</B> in
1920        <TT>EXTRALIBS</TT>, but I'm still getting a linking error:
1921
1922
1923 <PRE>
1924          /lib/libpam.so: undefined reference to `dlerror'
1925          /lib/libpam.so: undefined reference to `dlclose'
1926          /lib/libpam.so: undefined reference to `dlopen'
1927          /lib/libpam.so: undefined reference to `dlsym'</PRE>
1928 <P>
1929 A0112: Add <B>-ldl</B> to <TT>EXTRALIBS</TT>. In some systems these dynamic loading functions
1930        are in their own library.
1931
1932 </P>
1933 <A NAME="SEC62" HREF="FAQ.html#TOC62">Q0113</A>: I'm getting the error <B>"db.h:</B> No such file or directory" when I try to
1934        build Exim.
1935
1936
1937 <P>
1938 A0113: This problem has been seen with RedHat 7.0, but could also happen in
1939        other environments. If your system is using the DB3 DBM library, you
1940        need to install the DB3 development package in order to build Exim.
1941        The package is called something like <B>db3-devel-3.1.14-16.i386.rpm</B> for
1942        Linux systems, but you should check which version of DB3 you have
1943        installed.
1944
1945 </P>
1946 <A NAME="SEC63" HREF="FAQ.html#TOC63">Q0114</A>: I'm getting the error "/usr/bin/ld: cannot find <B>-ldb1"</B> when I try to
1947        build Exim.
1948
1949
1950 <P>
1951 A0114: This is probably the same problem as 
1952         <A HREF="FAQ.html#SEC62">Q0113</A>.
1953
1954 </P>
1955 <BR><H2><A NAME="SEC64" HREF="FAQ.html#TOC64">2. MAILBOX LOCKING
1956
1957 </A></H2>
1958 <A NAME="SEC65" HREF="FAQ.html#TOC65">Q0201</A>: Why do I get the error "Permission denied: creating lock file hitching
1959        post" when Exim tries to do a local delivery?
1960
1961
1962 <P>
1963 A0201: Your configuration specifies that local mailboxes are all held in
1964        single directory, via configuration lines like these (taken from the
1965        default configuration):
1966
1967 </P>
1968 <PRE>
1969          local_delivery:
1970            driver = appendfile
1971            file = /var/mail/$local_part</PRE>
1972 <P>
1973        and the permissions on the directory probably look like this:
1974
1975 </P>
1976 <PRE>
1977          drwxrwxr-x   3 root     mail         512 Jul  9 13:48 /var/mail/</PRE>
1978 <P>
1979        Using the default configuration, Exim runs as the local user when doing
1980        a local delivery, and it uses a lock file to prevent any other process
1981        from updating the mailbox while it is writing to it. With those
1982        permissions the delivery process, running as the user, is unable to
1983        create a lock file in the <B>/var/mail</B> directory. There are two solutions
1984        to this problem:
1985
1986 </P>
1987 <P>
1988        (A) Set the "write" and "sticky bit" permissions on the directory, so
1989            that it looks like this:
1990
1991 </P>
1992 <PRE>
1993              drwxrwxrwt   3 root     mail         512 Jul  9 13:48 /var/mail/</PRE>
1994 <P>
1995            The "w" allows any user to create new files in the directory, but
1996            the "t" bit means that only the creator of a file is able to remove
1997            it. This is the same setting as is normally used with the <B>/tmp</B>
1998            directory.
1999
2000 </P>
2001 <P>
2002        (B) Arrange to run the <TT>local_delivery</TT> transport under a specific group
2003            by changing the configuration to read
2004
2005 </P>
2006 <PRE>
2007              local_delivery:
2008                driver = appendfile
2009                file = /var/mail/${local_part}
2010                group = mail</PRE>
2011 <P>
2012            The delivery process still runs under the user's uid, but with the
2013            group set to "mail". The group permission on the directory allows
2014            the process to create and remove the lock file.
2015
2016 </P>
2017 <P>
2018            The choice between (A) and (B) is up to the administrator. If the
2019            second solution is used, users can empty their mailboxes by updating
2020            them, but cannot delete them.
2021
2022 </P>
2023 <P>
2024        If your problem involves mail to root, see also 
2025         <A HREF="FAQ.html#SEC148">Q0507</A>.
2026
2027 </P>
2028 <A NAME="SEC66" HREF="FAQ.html#TOC66">Q0202</A>: I am experiencing mailbox locking problems with Sun's <B>mailtool</B> used
2029        over a network.
2030
2031
2032 <P>
2033 A0202: See 
2034         <A HREF="FAQ.html#SEC342">A9705</A> in the Sun-specific section below.
2035
2036 </P>
2037 <BR><H2><A NAME="SEC67" HREF="FAQ.html#TOC67">3. ROUTING
2038
2039 </A></H2>
2040 <A NAME="SEC68" HREF="FAQ.html#TOC68">Q0301</A>: What do "lowest numbered MX record points to local host" and "remote
2041        host address is the local host" mean?
2042
2043
2044 <P>
2045 A0301: They mean exactly what they say. Exim has tried to route a domain that
2046        it thinks is not local, and when it looked it up in the DNS, either the
2047        lowest numbered MX record pointed at the local host, or there were no
2048        MX records, and the address record for the domain pointed to an IP
2049        address that belongs to the local host.
2050
2051 </P>
2052 <P>
2053        (A) If the domain is meant to be handled as a local domain, then there
2054            is a problem with the setting of the <TT>local_domains</TT> configuration
2055            option. If you have not set this, then only the name of the local
2056            host is treated as a local domain. If, for example, your host is
2057            called <B>myhost.mydomain.com</B> and you want it to handle mail for the
2058            domain <B>mydomain.com</B> as well as for its own name, you must set
2059
2060 </P>
2061 <PRE>
2062              local_domains = myhost.mydomain.com:mydomain.com</PRE>
2063 <P>
2064            or, if you want to be more general, you could use
2065
2066 </P>
2067 <PRE>
2068              local_domains = *.mydomain.com:mydomain.com</PRE>
2069 <P>
2070            If you have a large number of individual local domains, you should
2071            investigate storing them in a file and setting <TT>local_domains</TT> to do a
2072            lookup.
2073
2074 </P>
2075 <P>
2076            All the domains in <TT>local_domains</TT> are treated as synonymous by
2077            default. If you want to specify different handling for different
2078            domains, you can either use <TT>domains</TT> options, to restrict certain
2079            directors to certain domains, or use the <B>$domain</B> expansion variable
2080            in director options to vary the value according to the domain, for
2081            example, setting the name of an alias file to <B>/etc/aliases/$domain</B>.
2082
2083 </P>
2084 <P>
2085        (B) If the domain is one for which the local host is providing a
2086            forwarding service (called "mail hubbing"), possibly as part of a
2087            firewall, then you need to set up a router to tell Exim where to
2088            send messages addressed to this domain, since the DNS directs them
2089            to the local host. The routers section of your configuration file
2090            should look something like this:
2091
2092 </P>
2093 <PRE>
2094              hubbed_hosts:
2095                driver = domainlist
2096                transport = remote_smtp
2097                route_list = see discussion below</PRE>
2098 <PRE>
2099              other_hosts:
2100                driver = lookuphost
2101                transport = remote_smtp</PRE>
2102 <P>
2103            Note that the <B>domainlist</B> router must come first so that it can pick
2104            off a hubbed host before it gets to the <B>lookuphost</B> router. The
2105            contents of the <TT>route_list</TT> option depend on how many hosts you are
2106            hubbing for, and how their names are related to the domain name.
2107            Suppose the local host is a firewall, and all the domains in
2108            <B>*.foo.bar</B> have MX records pointing to it, and each domain
2109            corresponds to a host of the same name. Then the setting could be
2110
2111 </P>
2112 <PRE>
2113              route_list = "*.foo.bar $domain byname"</PRE>
2114 <P>
2115            If there isn't a convenient relationship between the domain names
2116            and the host names, then you either have to list each domain
2117            separately, or use a lookup expansion to look up the host from the
2118            domain, or put the routing information in a file and use the
2119            <TT>route_file</TT> option.
2120
2121 </P>
2122 <P>
2123        (C) If neither (A) nor (B) is the case, then the lowest numbered MX
2124            record or the address record for the domain should not be pointing
2125            to your host. You should arrange to get the DNS mended.
2126
2127 </P>
2128 <P>
2129            There has been a rash of instances of domains being deliberately set
2130            up with MX records pointing to "localhost", which causes this
2131            behaviour. By default, Exim defers delivery and freezes the message.
2132            You can change what Exim does by setting the generic "self" option
2133            on the router, for example, to make it bounce such domains. If you
2134            are running a release later than 3.16, you can use the option
2135            called <TT>ignore_target_hosts</TT> instead, to get it to pretend such hosts
2136            do not exist.
2137
2138 </P>
2139 <A NAME="SEC69" HREF="FAQ.html#TOC69">Q0302</A>: How do I configure Exim to send all non-local mail to a gateway host?
2140
2141
2142 <P>
2143 A0302: Replace the <B>lookuphost</B> router in the default configuration with the
2144        following:
2145
2146 </P>
2147 <PRE>
2148          send_to_gateway:
2149            driver = domainlist
2150            transport = remote_smtp
2151            route_list = * gate.way.host byname</PRE>
2152 <P>
2153        This uses gethostbyname() to find the gateway's IP address. You could
2154        alternatively have "bydns" to do a DNS lookup with MX handling, in which
2155        case <B>"gate.way.host"</B> is really being treated as a mail domain name
2156        rather than a host name. If there are several hosts you can send to,
2157        you can specify them as a colon-separated list. See also 
2158         <A HREF="FAQ.html#SEC92">Q0325</A> and 
2159         <A HREF="FAQ.html#SEC96">Q0402</A>.
2160
2161 </P>
2162 <A NAME="SEC70" HREF="FAQ.html#TOC70">Q0303</A>: How do I configure Exim to send all non-local mail to a central server
2163        if it cannot be immediately delivered by my host? I don't want to have
2164        queued mail waiting on my host.
2165
2166
2167 <P>
2168 A0303: Add to the <TT>remote_smtp</TT> transport the following:
2169
2170 </P>
2171 <PRE>
2172          fallback_hosts = central.server.name(s)</PRE>
2173 <P>
2174        If there are several names, they must be separated by colons.
2175
2176 </P>
2177 <A NAME="SEC71" HREF="FAQ.html#TOC71">Q0304</A>: How can I arrange for messages submitted by (for example) Majordomo to
2178        be routed specially?
2179
2180
2181 <P>
2182 A0304: See 
2183         <A HREF="FAQ.html#SEC98">A0404</A>.
2184
2185 </P>
2186 <A NAME="SEC72" HREF="FAQ.html#TOC72">Q0305</A>: How do I arrange for all incoming email for <B><B>*@some.domain</B></B> to go into one
2187        pop3 mail account? The customer doesn't want to add a list of specific
2188        local parts to the system.
2189
2190
2191 <P>
2192 A0305: Set up a special transport that writes to the mailbox like this:
2193
2194 </P>
2195 <PRE>
2196          special_transport:
2197            driver = appendfile
2198            file = /pop/mailbox
2199            envelope_to_add
2200            return_path_add
2201            delivery_date_add
2202            user = exim</PRE>
2203 <P>
2204        The file will be written as the user "exim". Then arrange to route all
2205        mail for that domain to that transport, with a router like this:
2206
2207 </P>
2208 <PRE>
2209          special_router:
2210            driver = domainlist
2211            transport = special_transport
2212            route_list = some.domain</PRE>
2213 <P>
2214        Alternatively, you could make <B>some.domain</B> a local domain, and use a
2215        <B>smartuser</B> director instead.
2216
2217 </P>
2218 <A NAME="SEC73" HREF="FAQ.html#TOC73">Q0306</A>: The <TT>route_list</TT> setting 
2219          <TT>^foo$:^bar$  $domain  byname</TT> in a <B>domainlist</B>
2220        router does not work.
2221
2222
2223 <P>
2224 A0306: The first thing in a <TT>route_list</TT> item is a single pattern, not a list of
2225        patterns. You need to write that as 
2226          <TT>^(foo|bar)$  $domain  byname</TT>.
2227        Alternatively, you could use several items and write
2228
2229 </P>
2230 <PRE>
2231          route_list = "foo $domain byname; bar $domain byname"</PRE>
2232 <P>
2233        Note the semicolon separator. This is because the second thing in each
2234        item <EM>can</EM> be a list - of hosts.
2235
2236 </P>
2237 <A NAME="SEC74" HREF="FAQ.html#TOC74">Q0307</A>: I'm getting "permission denied" when Exim attempts to check a
2238        <TT>require_files</TT> option.
2239
2240
2241 <P>
2242 A0307: See 
2243         <A HREF="FAQ.html#SEC104">A0410</A> below.
2244
2245 </P>
2246 <A NAME="SEC75" HREF="FAQ.html#TOC75">Q0308</A>: I have a domain for which some local parts must be delivered locally,
2247        but the remainder are to be treated like any other remote addresses.
2248
2249
2250 <P>
2251 A0308: The way to do this is not to include the domain in <TT>local_domains</TT>, so
2252        that addresses initially get passed to the routers. The first router
2253        should be definied like this:
2254
2255 </P>
2256 <PRE>
2257          special_local:
2258            driver = domainlist
2259            local_parts = whatever...
2260            domains = whatever...
2261            route_list = * localhost byname
2262            self = local</PRE>
2263 <P>
2264        That will pick off those addresses with matching local parts and
2265        domains, and hand them to the directors, because of the <TT>self = local</TT>
2266        setting. Any other addresses will fall through to the other routers and
2267        be handled as normal remote addresses.
2268
2269 </P>
2270 <A NAME="SEC76" HREF="FAQ.html#TOC76">Q0309</A>: For certain domains, I don't want Exim to use MX records. Instead, I
2271        want it just to look up the hosts' A records. I tried using a negative
2272        entry in <TT>mx_domains</TT> in the smtp router, but it didn't work.
2273
2274
2275 <P>
2276 A0309: The <TT>mx_domains</TT> option specifies domains for which there <EM>must</EM> be an MX
2277        record (an A record isn't good enough). Consequently, a negative item in
2278        it doesn't do what you want - any domain matching is is not required to
2279        have an MX record, but it doesn't stop Exim from using MX records for
2280        any that do have them. You can achieve what you want using either a
2281        <B>lookuphost</B> or a <B>domainlist</B> router:
2282
2283 </P>
2284 <P>
2285        (A) Using <B>lookuphost</B>:
2286
2287 </P>
2288 <PRE>
2289          special_domains:
2290            driver = lookuphost
2291            transport = remote_smtp
2292            domains = list:of:domains:you:want:to:do:this:for
2293            gethostbyname</PRE>
2294 <P>
2295        (B) Using <B>domainlist</B>:
2296
2297 </P>
2298 <PRE>
2299          special_domains:
2300            driver = domainlist
2301            transport = remote_smtp
2302            domains = list:of:domains:you:want:to:do:this:for
2303            route_list = * * byname</PRE>
2304 <P>
2305        If the list of domains is actually a lookup in a file, you can dispense
2306        with <TT>domains</TT> in the <B>domainlist</B> case, and put the lookup into the
2307        <TT>route_list</TT> option.
2308
2309 </P>
2310 <A NAME="SEC77" HREF="FAQ.html#TOC77">Q0310</A>: How can I configure Exim on a firewall machine so that if mail arrives
2311        addressed to a domain whose MX points to the firewall, it is forwarded
2312        to the internal mail server, without having to have a list of all the
2313        domains involved?
2314
2315
2316 <P>
2317 A0310: As your first router, have the standard <B>lookuphost</B> router from the
2318        default configuration, with the added options
2319
2320 </P>
2321 <PRE>
2322          no_more
2323          self = pass</PRE>
2324 <P>
2325        This will handle all domains whose lowest numbered MX records do <EM>not</EM>
2326        point to your host. Because of the <TT>no_more</TT> setting, if it encounters
2327        an unknown domain, routing will fail. However, if it hits a domain whose
2328        lowest numbered MX points to your host, the "self" option comes into
2329        play, and overrides <TT>no_more</TT>. The "pass" setting causes it to pass
2330        the address on to the next router. (The default causes it to generate an
2331        error.)
2332
2333 </P>
2334 <P>
2335        As your second (and last) router, set up a <B>domainlist</B> router that sends
2336        everything to your internal mail server. That is, use an option of the
2337        form
2338
2339 </P>
2340 <PRE>
2341          route_list = * internal.server byname</PRE>
2342 <A NAME="SEC78" HREF="FAQ.html#TOC78">Q0311</A>: How can I arrange that messages larger than some limit are handled by
2343        a special router?
2344
2345
2346 <P>
2347 A0311: If you are using Exim 2.10 or greater, you can use a <TT>condition</TT> option
2348        on the router of the form
2349
2350 </P>
2351 <PRE>
2352          condition = ${if &#62;{$message_size}{100K}{yes}{no}}</PRE>
2353 <P>
2354        Earlier versions of Exim do not have numerical comparison operators,
2355        though you can use tricks like
2356
2357 </P>
2358 <PRE>
2359          condition = ${if eq {${substr_5:$message_size}}{}{no}{yes}}</PRE>
2360 <A NAME="SEC79" HREF="FAQ.html#TOC79">Q0312</A>: If a DNS lookup returns no MX records why doesn't Exim just bin the
2361        message?
2362
2363
2364 <P>
2365 A0312: If a DNS lookup returns no MXs, Exim looks for an A record, in
2366        accordance with the rules that are defined in the RFCs. If you want to
2367        break the rules, you can set <TT>mx_domains</TT> in the <B>lookuphost</B> router, but
2368        you will cut yourself off from those sites (and there still seem to be
2369        plenty) who do not set up MX records.
2370
2371 </P>
2372 <A NAME="SEC80" HREF="FAQ.html#TOC80">Q0313</A>: When a DNS lookup for MX records fails to complete, why doesn't Exim
2373        send the messsage to the host defined by the A record?
2374
2375
2376 <P>
2377 A0313: The RFCs are quite clear on this. Only if it is known that there are no
2378        MX records is an MTA allowed to make use of the A record. When an MX
2379        lookup fails to complete, Exim does not know whether there are any MX
2380        records or not. There seem to be some nameservers (or some
2381        configurations of some nameservers) that give a "server fail" error when
2382        asked for a non-existent MX record. Exim uses standard resolver calls,
2383        which unfortunately do not distinguish between this case and a timeout,
2384        so all Exim can do is try again later.
2385
2386 </P>
2387 <A NAME="SEC81" HREF="FAQ.html#TOC81">Q0314</A>: Can you specify a list of domains to explicitly reject?
2388
2389
2390 <P>
2391 A0314: Use a router like this:
2392
2393 </P>
2394 <PRE>
2395          reject_domains:
2396            driver = domainlist
2397            self = fail_hard
2398            domains = list:of:domains:to:reject
2399            route_list = * localhost byname</PRE>
2400 <A NAME="SEC82" HREF="FAQ.html#TOC82">Q0315</A>: Is it possible to use a conditional expression for the host item in a
2401        <TT>route_list</TT> for the <B>domainlist</B> router? I tried the following, but it
2402        doesn't work:
2403
2404
2405 <PRE>
2406          route_list = * ${if match{$header_from:}{.*\\.usa\\.net\\$} \
2407                       {&#60;smarthost1&#62;}{&#60;smarthost2&#62;} bydns_a</PRE>
2408 <P>
2409 A0315: The problem is that the second item in the <TT>route_list</TT> contains white
2410        space, which means that it gets terminated prematurely. To avoid this,
2411        you must put the second item in quotes:
2412
2413 </P>
2414 <PRE>
2415          route_list = * "${if match{$header_from:}{.*\\.usa\\.net\\$} \
2416                       {&#60;smarthost1&#62;}{&#60;smarthost2&#62;}}" bydns_a</PRE>
2417 <A NAME="SEC83" HREF="FAQ.html#TOC83">Q0316</A>: I send all external mail to a smart host, but this means that bad
2418        addresses also get passed to the smart host. Can I avoid this?
2419
2420
2421 <P>
2422 A0316: If you are receiving the mail via SMTP, then you can use verification to
2423        weed out the bad addresses. Set <TT>no_verify</TT> on the router which sends
2424        everything to your smart host, and insert a new router with <TT>verify_only</TT>
2425        that does general routing using DNS lookups (e.g. the default <B>lookuphost</B>
2426        router), or any other verification you want. Then set <TT>receiver_verify</TT>
2427        so that addresses are accepted only if they verify successfully.
2428
2429 </P>
2430 <A NAME="SEC84" HREF="FAQ.html#TOC84">Q0317</A>: I have a dial-up machine, and I use the <TT>queue_smtp</TT> option so that remote
2431        mail only goes out when I do a queue run. However, any email I send with
2432        an address <B><B>&#60;anything&#62;@aol.com</B></B> is returned within about 15 mins saying
2433        'retry time exceeded', and all addresses are affected.
2434
2435
2436 <P>
2437 A0317: See 
2438         <A HREF="FAQ.html#SEC260">Q1401</A>.
2439
2440 </P>
2441 <A NAME="SEC85" HREF="FAQ.html#TOC85">Q0318</A>: How can I route mail for user <B>X@local</B> to a smarthost if X doesn't exist
2442        on the local host?
2443
2444
2445 <P>
2446 A0318: See 
2447         <A HREF="FAQ.html#SEC122">A0428</A>.
2448
2449 </P>
2450 <A NAME="SEC86" HREF="FAQ.html#TOC86">Q0319</A>: How can I arrange to do my own qualification of non-fully-qualified
2451        domains, and then pass them on to the next router?
2452
2453
2454 <P>
2455 A0319: If you have some list of domains that you want to qualify, you can do
2456        this using a <B>domainlist</B> router. For example,
2457
2458 </P>
2459 <PRE>
2460          qualify:
2461            driver = domainlist
2462            route_list = *.a.b  $domain.c.com</PRE>
2463 <P>
2464        adds <B>".c.com"</B> to any domain that matches <B>"*.a.b".</B> In the absence of any
2465        options in the route item, the new domain is passed to the next router.
2466
2467 </P>
2468 <P>
2469        If you want to do this in conjunction with a <B>lookuphost</B> router, the
2470        <TT>widen_domains</TT> option of that router may be another way of achieving what
2471        you want.
2472
2473 </P>
2474 <A NAME="SEC87" HREF="FAQ.html#TOC87">Q0320</A>: Every system has a "nobody" account under which httpd etc run. I would
2475        like to know how to restrict mail which comes from that account to users
2476        on that host only.
2477
2478
2479 <P>
2480 A0320: Set up a router with <B><B>senders=nobody@your.domain</B></B> which routes all
2481        mail to a local transport that delivers it to <B>/dev/null</B> (or to a pipe
2482        that bounces with an error message, or whatever). That would catch all
2483        mail to non-local domains.
2484
2485 </P>
2486 <A NAME="SEC88" HREF="FAQ.html#TOC88">Q0321</A>: I have a really annoying intermittent problem where attempts to mail to
2487        valid sites are rejected with "unknown mail domain". This only happens a
2488        few times a day and there is no particular pattern to the sites it
2489        rejects.  If I try to lookup the same domain a few minutes later then it
2490        is OK.
2491
2492
2493 <P>
2494 A0321: (A) Have you linked Exim against the newest DNS resolver library that
2495        comes with Bind? If you are using SunOS4 that may be your problem, as
2496        the resolver that comes with that OS is known to be buggy and to give
2497        intermittent false negatives.
2498
2499 </P>
2500 <P>
2501        (B) Effects like this are sometimes seen if a domain's nameservers get
2502        out of step with each other.
2503
2504 </P>
2505 <A NAME="SEC89" HREF="FAQ.html#TOC89">Q0322</A>: I'd like route all mail with unresolved addresses to a relay machine.
2506
2507
2508 <P>
2509 A0322: Set <TT>pass_on_timeout</TT> on your <B>lookuphost</B> router, and add below it a
2510        <B>domainlist</B> router that routes everything to the relay.
2511
2512 </P>
2513 <A NAME="SEC90" HREF="FAQ.html#TOC90">Q0323</A>: I would like to forward all incoming email for a particular domain to
2514        another machine via SMTP. Whereabouts would I configure that?
2515
2516
2517 <P>
2518 A0323: First, do not list the domain in <TT>local_domains</TT>. Instead, list it in
2519        <TT>relay_domains</TT>. Then, if the domain's lowest numbered MX record points to
2520        your host, set up a <B>domainlist</B> router before your normal <B>lookuphost</B>
2521        router, in order to route the domain to the specific host.
2522
2523 </P>
2524 <A NAME="SEC91" HREF="FAQ.html#TOC91">Q0324</A>: Why does Exim say "all relevant MX records point to non-existent hosts"
2525        when MX records point to IP addresses?
2526
2527
2528 <P>
2529 A0324: MX records cannot point to IP addresses. They are defined to point to
2530        host names, so Exim always interprets them that way. (An IP address is a
2531        syntactically valid host name.) The DNS for the domain you are having
2532        problems with is misconfigured.
2533
2534 </P>
2535 <P>
2536        However, it appears that more and more DNS zones are breaking the rules
2537        and putting IP addresses on the RHS of MX records. Exim follows the
2538        rules and rejects this, but other MTAs do support it, so <TT>allow_mx_to_ip</TT>
2539        was regretfully added at release 3.14 to permit this heinous activity.
2540
2541 </P>
2542 <A NAME="SEC92" HREF="FAQ.html#TOC92">Q0325</A>: How can I arrange for mail on my local network to be delivered directly
2543        to the relevant hosts, but all other mail to be sent to my ISP's mail
2544        server? The local hosts are all DNS-registered and behave like normal
2545        Internet hosts.
2546
2547
2548 <P>
2549 A0325: Set up a first router to pick off all the domains for your local
2550        network. There are several ways you might do this. For example
2551
2552 </P>
2553 <PRE>
2554          local:
2555            driver = lookuphost
2556            transport = remote_smtp
2557            domains = lsearch;/etc/local_domains.list</PRE>
2558 <P>
2559        This does a perfectly conventional DNS routing operation, but only for
2560        your local domains. Follow this with a "smarthost" router:
2561
2562 </P>
2563 <PRE>
2564          internet:
2565            driver = domainlist
2566            transport = remote_smtp
2567            route_list = * mail.isp.net bydns_a</PRE>
2568 <P>
2569        This sends anything else to the smart host.
2570
2571 </P>
2572 <A NAME="SEC93" HREF="FAQ.html#TOC93">Q0326</A>: What I'd like to do is have alternative smarthosts, where the one to be
2573        used is determined by which ISP I'm connected to.
2574
2575
2576 <P>
2577 A0326: The simplest way to do this is to use a lookup in a <B>domainlist</B> router.
2578        For example:
2579
2580 </P>
2581 <PRE>
2582          smarthost:
2583            driver = domainlist
2584            transport = remote_smtp
2585            route_list = * ${lookup{smart}lsearch{/etc/smarthost}{$value}} byname</PRE>
2586 <P>
2587        where you arrange for the name (or IP address) of the relevant smart
2588        host to be placed in <B>/etc/smarthost</B> when you connect, in the form
2589
2590 </P>
2591 <PRE>
2592          smart: smart.host.name.or.ip</PRE>
2593 <P>
2594        By keeping the data out of the main configuration file, you avoid having
2595        to HUP the daemon when it changes.
2596
2597 </P>
2598 <BR><H2><A NAME="SEC94" HREF="FAQ.html#TOC94">4. DIRECTING
2599
2600 </A></H2>
2601 <A NAME="SEC95" HREF="FAQ.html#TOC95">Q0401</A>: I need to have any mail for <B>virt.dom.ain</B> that <EM>doesn't</EM> match one of the
2602        aliases in <B><B>/usr/lib/aliases.virt</B></B> delivered to a particular address, for
2603        example, <B><B>postmaster@virt.dom.ain.</B></B>
2604
2605
2606 <P>
2607 A0401: Adding an asterisk to a search type causes Exim to look up "*" when the
2608        normal lookup fails. So if your director is something like this:
2609
2610 </P>
2611 <PRE>
2612          virtual:
2613            driver = aliasfile
2614            domains = virt.dom.ain
2615            file = /usr/lib/aliases.virt
2616            search_type = lsearch
2617            no_more</PRE>
2618 <P>
2619        you should change "lsearch" to "lsearch*", and put this in the alias
2620        file:
2621
2622 </P>
2623 <PRE>
2624          *: postmaster@virt.dom.ain</PRE>
2625 <P>
2626        This solution has the feature that if there are several unknown
2627        addresses in the same message, only one copy gets sent to the
2628        postmaster, because of Exim's normal de-duplication rules.
2629
2630 </P>
2631 <P>
2632        You can get separate deliveries for each unknown address only if you can
2633        direct them to a specific transport, by using a <B>smartuser</B> director like
2634        this:
2635
2636 </P>
2637 <PRE>
2638          virtual:
2639            driver = aliasfile
2640            domains = virt.dom.ain
2641            file = /usr/lib/aliases.virt
2642            search_type = lsearch</PRE>
2643 <PRE>
2644          default_virtual:
2645            driver = smartuser
2646            domains = virt.dom.ain
2647            transport = special_delivery
2648            new_address = postmaster@virt.dom.ain
2649            no_more</PRE>
2650 <P>
2651        If an address in the virtual domain is not matched by the normal alias
2652        lookup, then it gets picked up by the <B>smartuser</B> and passed to the
2653        transport with a new address. There is no checking for duplicates, so
2654        if there is more than one address that passes through this mechanism,
2655        multiple copies get delivered. In order to distinguish them, the
2656        <TT>envelope_to_add</TT> option can be set on the transport, to cause the
2657        insertion of an Envelope-To: header containing the original recipient
2658        address.
2659
2660 </P>
2661 <A NAME="SEC96" HREF="FAQ.html#TOC96">Q0402</A>: How do I configure Exim to send all messages to a central server?
2662
2663
2664 <P>
2665 A0402: This implies that you are not doing any local deliveries at all. Set
2666
2667 </P>
2668 <PRE>
2669          local_domains =</PRE>
2670 <P>
2671        in the configuration file. This specifies that there are no local
2672        domains (by default your host name is set up as a local domain). Then
2673        all addresses are non-local - 
2674         <A HREF="FAQ.html#SEC69">A0302</A> tells you how to deal with them.
2675
2676 </P>
2677 <A NAME="SEC97" HREF="FAQ.html#TOC97">Q0403</A>: How do I configure Exim to send messages for unknown local users to a
2678        central server?
2679
2680
2681 <P>
2682 A0403: At the end of the directors section of the configuration, insert the
2683        following director:
2684
2685 </P>
2686 <PRE>
2687          unknown:
2688            driver = smartuser
2689            transport = unknown_transport</PRE>
2690 <P>
2691        You should add <TT>no_verify</TT> to this if you are verifying addresses;
2692        without it, all local parts will verify as valid in the local domain.
2693        Then somewhere in the transports section of the configuration insert
2694
2695 </P>
2696 <PRE>
2697          unknown_transport:
2698            driver = smtp
2699            hosts = server.host.name</PRE>
2700 <P>
2701        A colon-separated list of hosts may be given. They are tried in order.
2702        By default, the IP address of any host is found by looking in the DNS
2703        and doing MX processing (so really it is a domain list rather than a
2704        host list). If you don't want MX processing, set the "gethostbyname"
2705        option:
2706
2707 </P>
2708 <PRE>
2709          unknown_transport:
2710            driver = smtp
2711            hosts = server.host.name
2712            gethostbyname</PRE>
2713 <P>
2714        This calls the gethostbyname() function to find IP addresses. Depending
2715        on your operating system and configuration, this usually consults
2716        <B>/etc/hosts</B> and possibly other sources of information, as well as, or
2717        instead of, the DNS.
2718
2719 </P>
2720 <P>
2721        If you want to change the recipient address when doing this, you can use
2722        the <TT>new_address</TT> option on the <B>smartuser</B> director. For example, if the
2723        address is <B><B>user@foo.bar.com</B></B> and the setting is
2724
2725 </P>
2726 <PRE>
2727            new_address = $local_part@bar.com</PRE>
2728 <P>
2729        The message is sent to the server with the envelope recipient changed to
2730        <B><B>user@bar.com.</B></B> However, this does not make any changes to the message's
2731        headers.
2732
2733 </P>
2734 <A NAME="SEC98" HREF="FAQ.html#TOC98">Q0404</A>: How can I arrange for messages submitted by (for example) Majordomo to
2735        be handled specially?
2736
2737
2738 <P>
2739 A0404: You can use the <TT>condition</TT> option on a director or router, with a
2740        setting such as
2741
2742 </P>
2743 <PRE>
2744          condition = ${if and {{eq {$sender_host_address}{}} \
2745                      {eq {$sender_ident}{majordom}}} {yes}{no}}</PRE>
2746 <P>
2747        This first tests for a locally-submitted message, by ensuring there is
2748        no sending host address, and then it checks the identity of the user
2749        that ran the submitting process.
2750
2751 </P>
2752 <A NAME="SEC99" HREF="FAQ.html#TOC99">Q0405</A>: On a host that accepts mail for several domains, do I have to use fully
2753        qualified names in <B>/etc/aliases</B> or do I have to set up an alias file for
2754        each domain?
2755
2756
2757 <P>
2758 A0405: You can do it either way. If you use a single file, you must set
2759        <TT>include_domain</TT> on the <B>aliasfile</B> director. If you use a separate file
2760        for each domain you can use a single director with an option such as
2761
2762 </P>
2763 <PRE>
2764          file = /etc/aliases/$domain</PRE>
2765 <P>
2766        (as in C007), or you can have several different directors, each one with
2767
2768 </P>
2769 <PRE>
2770          domains = domain1:domain2:...</PRE>
2771 <P>
2772        so that each one processes certain domains only. That way you could have
2773        several domains sharing an alias file. All of this assumes that you want
2774        have different aliases for each domain. If all the domain names are in
2775        effect just synonyms, you don't need to do anything other than ensure
2776        they all match something in <TT>local_domains</TT>.
2777
2778 </P>
2779 <A NAME="SEC100" HREF="FAQ.html#TOC100">Q0406</A>: Some of my users are using the <B>.forward</B> to pipe to a shell command which
2780        appends to the user's INBOX. How can I forbid this?
2781
2782
2783 <P>
2784 A0406: If you allow your users to run shells in pipes, you cannot control which
2785        commands they run or which files they write to. However, you should point
2786        out to them that writing to an INBOX by arbitrary commands is not
2787        interlocked with the MTA and MUAs, and is liable to mess up the contents
2788        of the file.
2789
2790 </P>
2791 <P>
2792        If a user simply wants to choose a specific file for the delivery of
2793        messages, this can be done by putting a file name in a <B>.forward</B> file
2794        rather than using a pipe, or by using the "save" command in an Exim
2795        filter file.
2796
2797 </P>
2798 <P>
2799        You can set <TT>forbid_pipe</TT> on the <B>forwardfile</B> director, but that will
2800        prevent them from running any pipe commands at all. Alternatively, you
2801        can restrict which commands they may run in their pipes by setting the
2802        <TT>allow_commands</TT> and/or <TT>restrict_to_path</TT> options in the <TT>address_pipe</TT>
2803        transport.
2804
2805 </P>
2806 <A NAME="SEC101" HREF="FAQ.html#TOC101">Q0407</A>: How can I arrange for a default value when using a query-style lookup
2807        such as LDAP or NIS+ to handle aliases?
2808
2809
2810 <P>
2811 A0407: Using the queries option for the <B>aliasfile</B> driver should do what you
2812        want. You can supply a second query which gets obeyed when the first
2813        query fails. For example,
2814
2815 </P>
2816 <PRE>
2817        queries = "\
2818          ldap:://x.y.z/l=yvr?aliasaddress?sub?(&(mail=$local_part@$domain)):\
2819          ldap:://x.y.z/l=yvr?aliasaddress?sub?(&(mail=default@$domain))"</PRE>
2820 <A NAME="SEC102" HREF="FAQ.html#TOC102">Q0408</A>: If I don't fully qualify the addresses in a virtual domain's alias file
2821        then mail to aliases which also match the local domain get delivered to
2822        the local domain.
2823
2824
2825 <P>
2826        For example, if the alias file for <B>foobar.com</B> is
2827
2828 </P>
2829 <PRE>
2830          foo: joe@some.place.com
2831          postmaster: foo</PRE>
2832 <P>
2833        then mail sent to <B><B>postmaster@foobar.com</B></B> is not delivered to
2834        <B><B>joe@some.place.com</B></B> but instead goes to <B><B>foo@localdomain.com.</B></B>
2835
2836 </P>
2837 <P>
2838 A0408: Set the <TT>qualify_preserve_domain</TT> option on the <B>aliasfile</B> director.
2839
2840 </P>
2841 <A NAME="SEC103" HREF="FAQ.html#TOC103">Q0409</A>: We've got users who chmod their home to 750, and home is NFS-mounted
2842        without root privilege, so Exim cannot access <B>~user/.forward.</B>
2843
2844
2845 <P>
2846 A0409: Set the seteuid option on the <B>forwardfile</B> director so that Exim
2847        "becomes" the user before trying to read the file. However, if your
2848        operating system does not support the seteuid() function, you cannot do
2849        this. In that circumstance, if you cannot persuade your users to make
2850        their <B>.forward</B> files world readable, you can set the <TT>ignore_eacces</TT>
2851        option, which causes Exim to ignore unreadable files.
2852
2853 </P>
2854 <A NAME="SEC104" HREF="FAQ.html#TOC104">Q0410</A>: I'm getting "permission denied" when Exim tries to check a for the
2855        existence of a user's <B>.procmailrc</B> file using <TT>require_files</TT>.
2856
2857
2858 <P>
2859 A0410: Exim is running under its own uid (or root if there isn't an Exim uid)
2860        when it checks <TT>require_files</TT>. You can cause it to change to a specific
2861        uid by putting an item not containing any / characters at the start of
2862        the <TT>require_files</TT> list. In this case you probably want a director along
2863        these lines:
2864
2865 </P>
2866 <PRE>
2867          procmail:
2868            driver = localuser
2869            require_files = $local_part:$home/.procmailrc
2870            transport = procmail_pipe</PRE>
2871 <A NAME="SEC105" HREF="FAQ.html#TOC105">Q0411</A>: How can I deliver mail into different directories for each virtual
2872        domain, doing user lookups not against <B>/etc/passwd</B> but against
2873        <B><B>/etc/passwd.domain</B>?</B>
2874
2875
2876 <P>
2877 A0411: See configuration sample C009.
2878
2879 </P>
2880 <A NAME="SEC106" HREF="FAQ.html#TOC106">Q0412</A>: I want mail for <EM>any</EM> local part at certain virtual domains to go
2881        to a single address for each domain.
2882
2883
2884 <P>
2885 A0412: One way to to this is
2886
2887 </P>
2888 <PRE>
2889          virtual:
2890            driver = smartuser
2891            domains = lsearch;/etc/virtual
2892            new_address = ${lookup{$domain}lsearch{/etc/virtual}{$value}fail}</PRE>
2893 <P>
2894        The <B>/etc/virtual</B> file contains a list of domains and the addresses to
2895        which their mail should be sent. For example:
2896
2897 </P>
2898 <PRE>
2899           domain1:  postmaster@some.where.else
2900           domain2:  joe@xyz.plc
2901           etc.</PRE>
2902 <P>
2903        If the number of domains is large, using a DBM or cdb file would be more
2904        efficient.
2905
2906 </P>
2907 <A NAME="SEC107" HREF="FAQ.html#TOC107">Q0413</A>: How can I make Exim look in the alias NIS map instead of <B>/etc/aliases</B>?
2908
2909
2910 <P>
2911 A0413: The default configuration does not use NIS (many hosts don't run it).
2912        You should change the <TT>system_aliases</TT> director to
2913
2914 </P>
2915 <PRE>
2916          system_aliases:
2917            driver = aliasfile
2918            file = mail.aliases
2919            search_type = nis</PRE>
2920 <P>
2921        If you want to use <B>/etc/aliases</B> as well as NIS, put this director (with
2922        a different name) before or after the default one, depending on which
2923        data source you want to take precedence.
2924
2925 </P>
2926 <A NAME="SEC108" HREF="FAQ.html#TOC108">Q0414</A>: What does the error message "error in forward file (filtering not
2927        enabled): missing or malformed local part ..." mean?
2928
2929
2930 <P>
2931 A0414: If you are trying to use an Exim filter, you have forgotten to enable
2932        the facility, which is disabled by default. In the <B>forwardfile</B> director
2933        (in the Exim configuration file) you need to set
2934
2935 </P>
2936 <PRE>
2937          filter = true</PRE>
2938 <P>
2939        to allow a <B>.forward</B> file to be used as an Exim filter. If you are not
2940        trying to use an Exim filter, then you have put a malformed address in
2941        the <B>.forward</B> file.
2942
2943 </P>
2944 <A NAME="SEC109" HREF="FAQ.html#TOC109">Q0415</A>: Exim isn't recognizing certain forms of local address.
2945
2946
2947 <P>
2948 A0415: (A) Try using the <B>-bt</B> option with debugging turned on, to see how Exim
2949        is handling the addresses. For example,
2950
2951 </P>
2952 <PRE>
2953          exim -d2 -bt z6abc</PRE>
2954 <P>
2955        will show you how it would handle the local part "z6abc". Increase the
2956        debug level to <B>-d9</B> for more information.
2957
2958 </P>
2959 <P>
2960        (B) If the local user names contain capital letters, that is probably
2961        the cause of your problem. Setting up such user names is a bad idea.
2962        By default, everything is lowercased before the final delivery for the
2963        sake of alias matching and user name matching, because people who type
2964        email addresses often get the case wrong. You can stop this by setting
2965
2966 </P>
2967 <PRE>
2968          locally_caseless = false</PRE>
2969 <P>
2970        but then incoming addresses are recognized only in the correct case.
2971        See 
2972         <A HREF="FAQ.html#SEC118">Q0424</A> for a way round this.
2973
2974 </P>
2975 <A NAME="SEC110" HREF="FAQ.html#TOC110">Q0416</A>: I have a domain for which some local parts must be delivered locally,
2976        but the remainder are to be treated like any other remote addresses.
2977
2978
2979 <P>
2980 A0416: See 
2981         <A HREF="FAQ.html#SEC75">A0308</A>.
2982
2983 </P>
2984 <A NAME="SEC111" HREF="FAQ.html#TOC111">Q0417</A>: What I really need is the ability to obtain the result of a pipe
2985        command so that I can filter externally and redirect internally. Is
2986        this possible?
2987
2988
2989 <P>
2990 A0417: This is not possible. The result of a pipe command is not available to
2991        a filter, because it doesn't run any deliveries while filtering. It just
2992        sets up deliveries. They all happen later. If you want to run pipes
2993        and examine their results, you need to set up a single delivery to a
2994        delivery agent such as procmail which provides this kind of facility.
2995
2996 </P>
2997 <A NAME="SEC112" HREF="FAQ.html#TOC112">Q0418</A>: When I set a suffix on one of my directors, it doesn't get stripped when
2998        checking the <TT>local_parts</TT> option. Why is this?
2999
3000
3001 <P>
3002 A0418: The test on local parts and domains is done early on, and only if they
3003        match is supplementary processing such as prefix and suffix recognition
3004        done. There is a section of the manual called "Skipping directors" which
3005        gives details. If you want to ignore a prefix or suffix in the initial
3006        test of the local part, you can do so by replacing <TT>local_parts</TT> with a
3007        setting of the <TT>condition</TT> option. For example, suppose you wanted to
3008        look up the basic local part in a file, and run the director if it is
3009        found:
3010
3011 </P>
3012 <PRE>
3013          condition = ${if lookup{\
3014            ${if match{$local_part}{^(.*)-request}{$1}{$local_part}}\
3015            }lsearch{/some/file}{yes}}</PRE>
3016 <P>
3017        The key that is looked up is the second line, which uses a regular
3018        expression to strip "-request" from the local part if it is present.
3019
3020 </P>
3021 <A NAME="SEC113" HREF="FAQ.html#TOC113">Q0419</A>: Why will Exim deliver a message locally to any username that is longer
3022        than 8 characters as long as the first 8 characters match one of the
3023        local usernames?
3024
3025
3026 <P>
3027 A0419: The problem is in your operating system. Exim just calls the getpwnam()
3028        function to test a local part for being a local login name. It does not
3029        presume to guess the maximum length of user name for the underlying
3030        operating system. Many operating systems correctly reject names that are
3031        longer than the maximum length; yours is apparently deficient in this
3032        regard. To cope with such systems, Exim has an option called
3033        <TT>max_user_name_length</TT> which you can set to the maximum allowed length.
3034
3035 </P>
3036 <A NAME="SEC114" HREF="FAQ.html#TOC114">Q0420</A>: Why am I seeing the error "bad mode (100664) for <B><B>/home/test/.forward</B></B>
3037        (userforward director)"? I've looked through the documentation but can't
3038        see anything to suggest that exim has to do anything other than read the
3039        <B>.forward</B> file.
3040
3041
3042 <P>
3043 A0420: For security, Exim checks for mode bits that shouldn't be set, by
3044        default 022. You can change this by setting the "modemask" option of the
3045        <B>forwardfile</B> director.
3046
3047 </P>
3048 <A NAME="SEC115" HREF="FAQ.html#TOC115">Q0421</A>: How can I arrange that messages larger than some limit are handled by
3049        a special director?
3050
3051
3052 <P>
3053 A0421: See 
3054         <A HREF="FAQ.html#SEC78">A0311</A>.
3055
3056 </P>
3057 <A NAME="SEC116" HREF="FAQ.html#TOC116">Q0422</A>: When a user's <B>.forward</B> file is syntactially invalid, Exim defers
3058        delivery of all messages to that user, which sometimes include the
3059        user's own test messages. Can it be told to ignore the <B>.forward</B> file
3060        and/or inform the user of the error?
3061
3062
3063 <P>
3064 A0422: Setting <TT>skip_syntax_errors</TT> on the <B>forwardfile</B> director causes syntax
3065        errors to be skipped. When dealing with users' <B>.forward</B> files it is best
3066        to combine this with a setting of <TT>syntax_errors_to</TT> in order to send
3067        a message about the error to the user. However, to avoid an infinite
3068        cascade of messages, you have to be able to send to an address that
3069        bypasses <B>.forward</B> file processing. This can be done by including a
3070        director like this one
3071
3072 </P>
3073 <PRE>
3074          real_localuser:
3075            driver = localuser
3076            transport = local_delivery
3077            prefix = real-</PRE>
3078 <P>
3079        <EM>before</EM> the <B>forwardfile</B> director. This will do an ordinary local
3080        delivery without <B>.forward</B> processing, if the local part is prefixed by
3081        "real-". You can then set something like the following options on the
3082        <B>forwardfile</B> director:
3083
3084 </P>
3085 <PRE>
3086          skip_syntax_errors
3087          syntax_errors_to = real-$local_part@$domain
3088          syntax_errors_text = "\
3089            This is an automatically generated message. An error has been \
3090            found\nin your .forward file. Details of the error are reported \
3091            below. While\nthis error persists, messages addressed to you will \
3092            get delivered into\nyour normal mailbox and you will receive a \
3093            copy of this message for\neach one."</PRE>
3094 <P>
3095        A final tidying setting to go with this is a rewriting rule that changes
3096        "real-username" into just "username" in the headers of the message:
3097
3098 </P>
3099 <PRE>
3100          ^real-([^@]+)@your\.dom\.ain$    $1@your.dom.ain   h</PRE>
3101 <P>
3102        This means that users won't ever see the "real-" prefix, unless they
3103        look at the Envelope-To header.
3104
3105 </P>
3106 <A NAME="SEC117" HREF="FAQ.html#TOC117">Q0423</A>: I have some users on my system with upper case letters in their login
3107        names, but these are not recognized.
3108
3109
3110 <P>
3111 A0423: See 
3112         <A HREF="FAQ.html#SEC118">A0424</A>.
3113
3114 </P>
3115 <A NAME="SEC118" HREF="FAQ.html#TOC118">Q0424</A>: I have unset <TT>locally_caseless</TT> because my users have upper case letters
3116        in their login names, but incoming mail now has to use the correct case.
3117        Can I relax this somehow?
3118
3119
3120 <P>
3121 A0424: If you really have to live with caseful user names but want incoming
3122        local parts to be caseless, then you have to maintain a file, indexed by
3123        the lower case forms, that gives the correct case for each login, like
3124        this:
3125
3126 </P>
3127 <PRE>
3128          admin:    Admin
3129          steven:   Steven
3130          mcdonald: McDonald
3131          lamanch:  LaManche
3132          ...</PRE>
3133 <P>
3134        and at the start of your directors, put one like this:
3135
3136 </P>
3137 <PRE>
3138          set_case_director:
3139            driver = smartuser
3140            new_address = ${lookup{${lc:$local_part}}lsearch{/the/file}\
3141                          {$value@$domain}fail}</PRE>
3142 <P>
3143        For efficiency, you should also set the <TT>new_director</TT> option to cause
3144        processing of the changed address to begin at the next director. If you
3145        are otherwise using the default configuration, then the setting would be
3146
3147 </P>
3148 <PRE>
3149          new_director = system_aliases</PRE>
3150 <P>
3151        If there are lots of users, then a DBM or cdb file would be more
3152        efficient than lsearch. If you are handling several domains, then you
3153        will have to extend this configuration to cope appropriately.
3154
3155 </P>
3156 <A NAME="SEC119" HREF="FAQ.html#TOC119">Q0425</A>: I want to look up local users in an SQL database instead of looking in
3157        the passwd file.
3158
3159
3160 <P>
3161 A0425: From release 3.03, Exim contains support for calling MySQL, and from
3162        release 3.14 there is support for PostgreSQL.
3163
3164 </P>
3165 <P>
3166        You must consider what will happen if your database is down. All local
3167        mail delivery will be delayed until it comes up again. Whether this
3168        matters is of course something for you to decide. If the database is
3169        down a lot and it does matter, then consider some scheme of extracting
3170        a list of users from the database at regular intervals, and getting Exim
3171        to work off that. This is also likely to be more efficient.
3172
3173 </P>
3174 <A NAME="SEC120" HREF="FAQ.html#TOC120">Q0426</A>: Is it possible for Exim to use a SQL database like MySQL for its lists
3175        of virtual domains and explicit aliases?
3176
3177
3178 <P>
3179 A0426: See 
3180         <A HREF="FAQ.html#SEC119">A0425</A>.
3181
3182 </P>
3183 <A NAME="SEC121" HREF="FAQ.html#TOC121">Q0427</A>: Can I use my existing alias files and forward files as well as procmail
3184        and effectively drop in exim in place of Sendmail ?
3185
3186
3187 <P>
3188 A0427: Yes, as long as your alias/forward files don't assume that pipes are
3189        going to run under a shell. If they do, you either have to change them,
3190        or configure Exim to use a shell (which it doesn't by default).
3191
3192 </P>
3193 <A NAME="SEC122" HREF="FAQ.html#TOC122">Q0428</A>: How can I route mail for user <B>X@local</B> to a smarthost if X doesn't exist
3194        on the local host?
3195
3196
3197 <P>
3198 A0428: This is the same question as 
3199         <A HREF="FAQ.html#SEC96">Q0402</A>. The duplication is a bug in the FAQ.
3200
3201 </P>
3202 <A NAME="SEC123" HREF="FAQ.html#TOC123">Q0429</A>: What is quickest way to set up Exim so any message sent to a non-
3203        existing user would bounce back with a different message, based
3204        on the name of non-existing user?
3205
3206
3207 <P>
3208 A0429: See the example in the section of the manual entitled "System-wide
3209        automatic processing".
3210
3211 </P>
3212 <A NAME="SEC124" HREF="FAQ.html#TOC124">Q0430</A>: I am building some largish mailing lists with Majordomo, and was
3213        wondering if it worth leaving the actually list expansion to the
3214        <B>aliasfile</B> :include: mechanism or should I consider using the <B>forwardfile</B>
3215        transport? Is there any real difference in terms of facilities and/or
3216        performance, and are the expansions basically the same code anyway?
3217
3218
3219 <P>
3220 A0430: The code that pulls out individual addresses from a list is the same in
3221        both cases, so it's really just a matter of which is the most convenient
3222        for you.
3223
3224 </P>
3225 <A NAME="SEC125" HREF="FAQ.html#TOC125">Q0431</A>: What do I need to do to make Exim handle <B>/usr/ucb/vacation</B> processing
3226        automatically, so that people could just create a .<B>vacation.msg</B> file in
3227        their home directory and not have to edit their <B>.forward</B> file?
3228
3229
3230 <P>
3231 A0431: Add a new director like this, immediately before the normal localuser
3232        director:
3233
3234 </P>
3235 <PRE>
3236          vacation:
3237            driver = localuser
3238            require_files = .vacation.msg
3239            transport = vacation_transport
3240            unseen</PRE>
3241 <P>
3242        and a matching new transport like this:
3243
3244 </P>
3245 <PRE>
3246          vacation_transport:
3247            driver = pipe
3248            command = "/usr/ucb/vacation \"$local_part\""</PRE>
3249 <P>
3250        However, some versions of <B>/usr/ucb/vacation</B> do not work properly unless
3251        the DBM file(s) it uses are created in advance - it won't create them
3252        itself. You also need a way of removing them when the vacation is over.
3253
3254 </P>
3255 <P>
3256        Another possibility is to use a fixed filter file which is run whenever
3257        .<B>vacation.msg</B> exists, for example:
3258
3259 </P>
3260 <PRE>
3261          vacation:
3262            driver = forwardfile
3263            check_localuser
3264            require_files = $home/.vacation.msg
3265            file = /some/central/filter
3266            filter</PRE>
3267 <P>
3268        The filter file should use the "if personal" check before sending mail,
3269        to avoid generating automatic responses to mailing lists. If sending a
3270        message is all that it does, this doesn't count as a "significant"
3271        delivery, so the message goes on to be delivered as normal.
3272
3273 </P>
3274 <P>
3275        Yet another possibility is to make use of Exim's autoreply transport.
3276        See C033.
3277
3278 </P>
3279 <A NAME="SEC126" HREF="FAQ.html#TOC126">Q0432</A>: I want to use a default entry in my alias file, but it picks up the
3280        local parts that the aliases generate. For example, if the alias file
3281        is
3282
3283
3284 <PRE>
3285          luke.skywalker: luke
3286          ls: luke
3287          *: postmaster</PRE>
3288 <P>
3289        then messages addressed to <B>luke.skywalker</B> end up at postmaster.
3290
3291 </P>
3292 <P>
3293 A0432: (A) If you know for certain that no alias in your alias file ever
3294        generates another alias that is in the same file, then the most
3295        efficient solution is to put
3296
3297 </P>
3298 <PRE>
3299          new_director = name-of-following-director</PRE>
3300 <P>
3301        in your <B>aliasfile</B> director. This stops Exim from processing the
3302        generated names as aliases the second time.
3303
3304 </P>
3305 <P>
3306        (B) If you can't give that guarantee, then you have to put dummy entries
3307        in the alias file for all your local parts, for example:
3308
3309 </P>
3310 <PRE>
3311          luke: luke</PRE>
3312 <P>
3313        (C) Another possibility is to put the <B>aliasfile</B> director for these
3314        aliases <EM>after</EM> the localuser director, so that local parts get picked
3315        off first. You will need to have two <B>aliasfile</B> directors if there are
3316        some local parts (e.g. root) which you do want to handle as aliases
3317        rather than local users.
3318
3319 </P>
3320 <A NAME="SEC127" HREF="FAQ.html#TOC127">Q0433</A>: I have some obsolete domains which people have been warned not to use
3321        any more. How can I arrange to delete any mail that is sent to them?
3322
3323
3324 <P>
3325 A0433: If you are using release 3.10 or later, you can use a <B>smartuser</B> director
3326        like this:
3327
3328 </P>
3329 <PRE>
3330          obsolete:
3331          domains = lsearch;/etc/exim/obsolete.domains
3332          new_address = :blackhole:</PRE>
3333 <P>
3334        If you want to make any exceptions, for example, for mail to postmaster
3335        at those domains, you can add the line
3336
3337 </P>
3338 <PRE>
3339          local_parts = !postmaster</PRE>
3340 <P>
3341        If you are using an earlier release of Exim, you have to set up an alias
3342        file in order to use :blackhole:
3343
3344 </P>
3345 <PRE>
3346          obsolete:
3347          domains = lsearch;/etc/exim/obsolete.domains
3348          file = /blackhole/all
3349          search_type = lsearch*</PRE>
3350 <P>
3351        with the file containing
3352
3353 </P>
3354 <PRE>
3355          *:           :blackhole:</PRE>
3356 <P>
3357        and possibly a postmaster alias if you want.
3358
3359 </P>
3360 <A NAME="SEC128" HREF="FAQ.html#TOC128">Q0434</A>: How can I arrange that mail addressed to <B><B>anything@something.mydomain.com</B></B>
3361        gets delivered to <B><B>something@mydomain.com</B>?</B>
3362
3363
3364 <P>
3365 A0434: Ensure that all the relevant domains are local, by setting
3366
3367 </P>
3368 <PRE>
3369          local_domains = mydomain.com : *.mydomain.com</PRE>
3370 <P>
3371        Then set up a <B>smartuser</B> director like this:
3372
3373 </P>
3374 <PRE>
3375          user_from_domain:
3376            driver = smartuser
3377            new_address = ${if match{$domain}{^(.+)\\.mydomain.com\$}\
3378              {$1@mydomain.com}fail}</PRE>
3379 <A NAME="SEC129" HREF="FAQ.html#TOC129">Q0435</A>: I can't get a regular expression to work in this <TT>local_parts</TT> option on
3380        one of my directors:
3381
3382
3383 <PRE>
3384          local_parts = ^0740\d{6}</PRE>
3385 <P>
3386 A0435: The <TT>local_parts</TT> option is expanded before use, so that you can, for
3387        example, make it dependent on the domain. Therefore, you need to write
3388
3389 </P>
3390 <PRE>
3391          local_parts = ^0740\\d{6}</PRE>
3392 <P>
3393        so as to preserve the backslash.
3394
3395 </P>
3396 <A NAME="SEC130" HREF="FAQ.html#TOC130">Q0436</A>: How can I arrange for all addresses in a group of domains <B>*.example.com</B>
3397        to share the same alias file? I have a number of such groups.
3398
3399
3400 <P>
3401 A0436: For a single group you could just hardwire the file name into a director
3402        that had
3403
3404 </P>
3405 <PRE>
3406          domains = *.example.com</PRE>
3407 <P>
3408        set, to restrict it to the relevant domains. For a number of such groups
3409        you can create a file containing the domains, like this:
3410
3411 </P>
3412 <PRE>
3413          *.example1.com    example1.com
3414          *.example2.com    example2.com
3415          ...</PRE>
3416 <P>
3417        Arrange that the domains are treated as local by setting
3418
3419 </P>
3420 <PRE>
3421          local_domains = partial-lsearch;/that/file</PRE>
3422 <P>
3423        Then create a director like this
3424
3425 </P>
3426 <PRE>
3427          domain_aliases:
3428            driver = aliasfile
3429            domains = partial-lsearch;/that/file
3430            file = /etc/aliases.d/$domain_data
3431            search_type = lsearch*</PRE>
3432 <P>
3433        The variable <B>$domain_data</B> contains the data that was looked up when the
3434        <TT>domains</TT> option was matched, i.e. <B>"example1.com",</B> <B>"example2.com",</B> etc.
3435        in this case.
3436
3437 </P>
3438 <A NAME="SEC131" HREF="FAQ.html#TOC131">Q0437</A>: When Exim tries to read <B><B>/usr/lib/majordomo/lists/lists.aliases</B></B> it is
3439        giving "Permission denied", but that file is world-readable!
3440
3441
3442 <P>
3443 A0437: Check the permissions on the superior directories.
3444
3445 </P>
3446 <A NAME="SEC132" HREF="FAQ.html#TOC132">Q0438</A>: Some of our users have no home directories; the field in the password
3447        file contains <B>/no/home/dir</B>. This causes the error "failed to stat
3448        <B>/no/home/dir</B> (No such file or directory)" when Exim tries to look for a
3449        <B>.forward</B> file, and the delivery is deferred.
3450
3451
3452 <P>
3453 A0438: With the default configuration, you are asking Exim to check for a
3454        <B>.forward</B> file in the user's home directory. It looks up the home
3455        directory and tries to stat() it before looking for <B>.forward</B>. This is so
3456        that it can will notice a missing NFS home directory, and not treat it
3457        as if the <B>.forward</B> file did not exist. This stat() is failing when the
3458        home directory doesn't exist. What you should do is pick off these
3459        special cases before looking for <B>.forward</B> files for normal users. Place
3460        the following director before the userforward director:
3461
3462 </P>
3463 <PRE>
3464          no_home_directory_users:
3465            driver = localuser
3466            transport = local_delivery
3467            match_directory = /no/home/dir
3468            current_directory = /</PRE>
3469 <A NAME="SEC133" HREF="FAQ.html#TOC133">Q0439</A>: How can I disable Exim's de-duplication features? I want it to do two
3470        deliveries if two different aliases expand to the same address.
3471
3472
3473 <P>
3474 A0439: This is not possible. Duplication has other ramifications other than
3475        just (in)convenience. Consider:
3476
3477 </P>
3478 <P>
3479          . Message is addressed to A and to B.
3480
3481 </P>
3482 <P>
3483          . Both A and B are aliased to C.
3484
3485 </P>
3486 <P>
3487          . Without de-duplication, two deliveries to C are scheduled.
3488
3489 </P>
3490 <P>
3491          . One delivery happens, Exim records that it has delivered the message
3492            to C.
3493
3494 </P>
3495 <P>
3496          . The next delivery fails (C's mailbox is over quota, say).
3497
3498 </P>
3499 <P>
3500        Next time round, Exim wants to know if it has already delivered to C or
3501        not, before scheduling a new delivery. Has it? Obviously, if duplicate
3502        deliveries are supported, it has to remember not only that it has
3503        delivered to C but also the "history" of how that delivery happened - in
3504        effect an ancestry list back to the original envelope address. This it
3505        does not do, and changing it to work in that way would be a lot of work
3506        and a big upheaval.
3507
3508 </P>
3509 <P>
3510        The best way to get duplicate deliveries if you want them is not to use
3511        <B>aliasfile</B>, but to use <B>smartuser</B> with a transport, e.g.
3512
3513 </P>
3514 <PRE>
3515        alias_with_duplicates:
3516          driver = smartuser
3517          transport = local_delivery_for_duplicates
3518          new_address = ${lookup {$local_part} lsearch ..... etc</PRE>
3519 <P>
3520        This goes straight to the transport without generating a new address
3521        that is considered for de-duplication or re-aliasing. In effect, it is
3522        just re-writing the address on the way to the transport. You will need
3523        to specify the user under which to run the delivery, either on the
3524        transport or on the director.
3525
3526 </P>
3527 <A NAME="SEC134" HREF="FAQ.html#TOC134">Q0440</A>: I set up an <B>aliasfile</B> director using MySQL, but it doesn't use the new
3528        addresses. This it my director:
3529
3530
3531 <PRE>
3532          mysql_system_aliases:
3533            driver = aliasfile
3534            search_type = mysql
3535            query = "select userid from domain_table where \
3536              aliasid='$local_part' and domain='$domain'"
3537            transport = local_delivery</PRE>
3538 <P>
3539 A0440: The setting of "transport" is your problem. Aliasfile operates entirely
3540        differently if you give it a transport. It just verifies the incoming
3541        address by doing the query, then sends it to the transport. Take away
3542        the transport setting, and it will do normal aliasing, that is, turn one
3543        address into another which is independently processed.
3544
3545 </P>
3546 <A NAME="SEC135" HREF="FAQ.html#TOC135">Q0441</A>: I received a message with a Subject: line that contained a non-printing
3547        character (a carriage return). This messed up my filter file. Is there a
3548        way to get round it?
3549
3550
3551 <P>
3552 A0441: Instead of <B>$h_subject:</B> use <B>${escape:$h_subject:}</B>
3553
3554 </P>
3555 <A NAME="SEC136" HREF="FAQ.html#TOC136">Q0442</A>: My users' mailboxes are distributed between several servers according to
3556        the first letter of the user name. All the servers receive incoming mail
3557        at random. I would like to have the same configuration file for all the
3558        servers, which does local delivery for the mailboxes it holds, and sends
3559        other addresses to the correct other server. Is this possible?
3560
3561
3562 <P>
3563 A0442: It is easiest if you arrange for all the users to have password entries
3564        on all the servers. This means that non-existent users can be detected
3565        at the first server they reach. Set up a file containing a mapping from
3566        the first letter of the user names to the servers where their mailboxes
3567        are held. For example:
3568
3569 </P>
3570 <PRE>
3571        a: server1
3572        b: server1
3573        c: server2
3574        ...</PRE>
3575 <P>
3576        Replace the normal localuser director with these two directors:
3577
3578 </P>
3579 <PRE>
3580          localuser:
3581            driver = localuser
3582            transport = local_delivery
3583            condition = ${if eq{$primary_hostname}\
3584              {${lookup {${substr_0_1:$local_part}}\
3585              lsearch{/etc/mapfile} {$value}}}{yes}{no}}</PRE>
3586 <PRE>
3587          check_remote:
3588            driver = localuser
3589            transport = send_to_correct_host</PRE>
3590 <P>
3591        The first director succeeds only if the local part is a local user whose
3592        mailbox is listed as being on the current host. The second server runs
3593        for all other local users, directing the addresses to this transport:
3594
3595 </P>
3596 <PRE>
3597          send_to_correct_host:
3598            driver = smtp
3599            hosts = ${lookup {${substr_0_1:$local_part}}lsearch{/etc/mapfile}\
3600                    {$value}}</PRE>
3601 <P>
3602        Local parts that are not the names of local users are declined by both
3603        directors, and so they fail.
3604
3605 </P>
3606 <A NAME="SEC137" HREF="FAQ.html#TOC137">Q0443</A>: I want to search for '$' in the subject line, but I can't seem to get
3607        the syntax. The obvious choice, '\$' doesn't work. Any help?
3608
3609
3610 <P>
3611 A0443: Try one of these:
3612
3613 </P>
3614 <PRE>
3615          if $h_subject: contains \$ then ...
3616          if $h_subject: contains "\\$" then ...</PRE>
3617 <A NAME="SEC138" HREF="FAQ.html#TOC138">Q0444</A>: One of the things I want to set up is for <B>anything@onedomain</B> to forward
3618        to <B><B>anything@anotherdomain.</B></B> I tried adding <B>$local_part@anotherdomain</B> to
3619        my aliases but it did not expand - it sent it to that literal address.
3620
3621
3622 <P>
3623 A0444: If you want to do it that way, you can make it expand by setting
3624        the "expand" option on the <B>aliasfile</B> director. Another approach is to
3625        use a <B>smartuser</B> director like this:
3626
3627 </P>
3628 <PRE>
3629          forwarddomain:
3630            driver = smartuser
3631            domains = onedomain
3632            new_address = $local_part@anotherdomain</PRE>
3633 <P>
3634        <TT>new_address</TT> can, of course, be more complicated, involving lookups etc.
3635        if you have lots of different cases.
3636
3637 </P>
3638 <A NAME="SEC139" HREF="FAQ.html#TOC139">Q0445</A>: How can I have an address looked up in two different alias files, and
3639        delivered to all the addresses that are found?
3640
3641
3642 <P>
3643 A0445: It is tempting to use the "unseen" option for this (see 
3644         <A HREF="FAQ.html#SEC145">Q0504</A> for an
3645        example of the use of "unseen"). You would have two directors, the first
3646        of which has "unseen" set, so that the address is always passed on to
3647        the next director, even if the first one accepts it.
3648
3649 </P>
3650 <P>
3651        However, there is a problem with this approach. If an address is found
3652        in the first director (with unseen set) but not in the second one, it
3653        will get delivered but will also (under most normal setups) generate an
3654        "unknown user" bounce as well.
3655
3656 </P>
3657 <P>
3658        If you want an incoming address to be "properly" delivered to
3659        two different "child" addresses (or lists), "unseen" is not really the
3660        right way to do it. You don't really need two different directors. You
3661        can use a <B>smartuser</B> director with an option something like this:
3662
3663 </P>
3664 <PRE>
3665          new_address = ${lookup{$local_part}lsearch{/etc/aliases1}\
3666            {$value${lookup{$local_part}lsearch{/etc/aliases2}{,$value}}}\
3667            {${lookup{$local_part}lsearch{/etc/aliases2}{$value}fail}}}\</PRE>
3668 <P>
3669        If the first lookup succeeds, the result is its data, followed by the
3670        data from the second lookup, if any, separated by a comma. If the first
3671        lookup fails, the result is the data from the third lookup (which also
3672        looks in the second file), but if this also fails, the entire expansion
3673        is forced to fail, thereby causing the director to decline.
3674
3675 </P>
3676 <A NAME="SEC140" HREF="FAQ.html#TOC140">Q0446</A>: I've converted from Sendmail, and I notice that Exim doesn't make use
3677        of the "owner-" entries in my alias file to change the sender address in
3678        outgoing messages to a mailing list.
3679
3680
3681 <P>
3682 A0446: If you have an alias file with entries like this:
3683
3684 </P>
3685 <PRE>
3686          somelist:        a@b, c@d, ...
3687          owner-somelist:  postmaster</PRE>
3688 <P>
3689        Sendmail assumes that the second entry specifies a new sender address
3690        for the first. Exim does not make this assumption. However, you can make
3691        it take the same action, by adding
3692
3693 </P>
3694 <PRE>
3695          errors_to = owner-$local_part@whatever.domain</PRE>
3696 <P>
3697        to the configuration for your <B>aliasfile</B> director. This is fail-safe,
3698        because Exim verifies a new sender address before using it. Thus, the
3699        change of sender address occurs only when the owner entry exists.
3700
3701 </P>
3702 <BR><H2><A NAME="SEC141" HREF="FAQ.html#TOC141">5. DELIVERY
3703
3704 </A></H2>
3705 <A NAME="SEC142" HREF="FAQ.html#TOC142">Q0501</A>: What does the error "Neither the <I>xxx</I> director nor the <I>yyy</I> transport set
3706        a uid for local delivery of..." mean?
3707
3708
3709 <P>
3710 A0501: Whenever Exim does a local delivery, it runs a process under a specific
3711        user and group id (uid and gid). For deliveries into mailboxes, and to
3712        pipes and files set up by <B>.forward</B>ing, it normally picks up the uid/gid
3713        of the receiving user. However, if an address is directed to a pipe or a
3714        file by some other means, such an entry in the system alias file of the
3715        form
3716
3717 </P>
3718 <PRE>
3719          majordomo: |/local/mail/majordomo ...</PRE>
3720 <P>
3721        then Exim has to be told what uid/gid to use for the delivery. This can
3722        be done either on the director that handled the address, or on the
3723        transport that actually does the delivery. If a pipe is going to run a
3724        setuid program, then it doesn't matter what uid Exim starts it out with,
3725        and so the most straightforward thing is to put
3726
3727 </P>
3728 <PRE>
3729          user = exim</PRE>
3730 <P>
3731        on either the director or the transport. A setting on the transport
3732        overrides a setting on the director, so if the same transport is being
3733        used with several directors, you should set the user on it only if you
3734        want the same uid to be used in all cases.
3735
3736 </P>
3737 <P>
3738        In the default configuration, the transports used for file and pipe
3739        deliveries are the ones called <TT>address_file</TT> and <TT>address_pipe</TT>. You
3740        can specify different transports by setting, for example,
3741
3742 </P>
3743 <PRE>
3744          pipe_transport = special_pipe_transport</PRE>
3745 <P>
3746        on the <B>aliasfile</B> director. Then you can set up <TT>special_pipe_transport</TT>
3747
3748 </P>
3749 <PRE>
3750          special_pipe_transport:
3751            driver = pipe
3752            user = ????</PRE>
3753 <P>
3754        which will be used only for pipe deliveries from that one director.
3755        What you put for the ???? is up to you, and depends on the particular
3756        circumstances.
3757
3758 </P>
3759 <A NAME="SEC143" HREF="FAQ.html#TOC143">Q0502</A>: Exim won't deliver to a host with no MX record.
3760
3761
3762 <P>
3763 A0502: (A) Are you sure there really is no MX record? Sometimes a typo results
3764        in a malformed MX record in the zone file, in which case some nameservers
3765        give a SERVFAIL error rather than NXDOMAIN. Exim has to treat this as
3766        a temporary error, so it can't go on to look for an A record. You can
3767        check for this state using one of the DNS interrogation commands, such
3768        as "nslookup", "host", or "dig".
3769
3770 </P>
3771 <P>
3772        (B) Is there a wildcard MX record for <EM>your</EM> domain? Is the
3773        <TT>search_parents</TT> option on in your <B>lookuphost</B> router? (Prior to Exim
3774        version 1.80 this was the default; it was changed because of this
3775        problem.) If the answer to both these questions is "yes", then that is
3776        the cause of the problem. When the DNS resolver fails to find the MX
3777        record, it tries adding on your domain if <TT>search_parents</TT> is true, and
3778        thereby finds your wildcard MX record. For example:
3779
3780 </P>
3781 <P>
3782          .  There is a wildcard MX record for <B>*.a.b.c.</B>
3783
3784 </P>
3785 <P>
3786          .  There is a host called <B>x.y.z</B> that has an A record and no MX record.
3787
3788 </P>
3789 <P>
3790          .  Somebody on a machine <B>m.a.b.c</B> domain tries to mail to <B><B>user@x.y.z.</B></B>
3791
3792 </P>
3793 <P>
3794          .  Exim calls the DNS to look for an MX record for <B>x.y.z.</B>
3795
3796 </P>
3797 <P>
3798          .  The DNS doesn't find any MX record. Because <TT>search_parents</TT> is true,
3799             it then tries searching the current host's parent domain, so it
3800             looks for <B>x.y.z.a.b.c</B> and picks up the wildcard MX record.
3801
3802 </P>
3803 <P>
3804        Setting <TT>search_parents</TT> false makes this case work while retaining the
3805        wildcard MX record. However, anybody on the machine <B>m.a.b.c</B> who mails to
3806        <B><B>user@n.a</B></B> (expecting it to go to <B><B>user@n.a.b.c</B>)</B> now has a problem. The
3807        <TT>widen_domains</TT> option of the <B>lookuphost</B> router may be helpful in this
3808        circumstance.
3809
3810 </P>
3811 <A NAME="SEC144" HREF="FAQ.html#TOC144">Q0503</A>: How should Exim be configured when it is acting as a temporary storage
3812        system for a domain on a dial-up host?
3813
3814
3815 <P>
3816 A0503: See 
3817         <A HREF="FAQ.html#SEC262">Q1403</A>, 
3818         <A HREF="FAQ.html#SEC162">Q0521</A>, and 
3819         <A HREF="FAQ.html#SEC283">Q5014</A>.
3820
3821 </P>
3822 <A NAME="SEC145" HREF="FAQ.html#TOC145">Q0504</A>: I would like to deliver mail addressed to a given domain normally, but
3823        also to generate a message to the envelope sender.
3824
3825
3826 <P>
3827 A0504: If the domain is a local one, you can do this with an "unseen" <B>smartuser</B>
3828        director and an autoreply transport, along the following lines:
3829
3830 </P>
3831 <PRE>
3832          # Transport
3833          warning_t:
3834            driver        = autoreply
3835            file          = /usr/local/mail/warning.txt
3836            file_expand
3837            from          = postmaster@your.domain
3838            to            = $sender_address
3839            user          = exim
3840            subject       = Re: Your mail to $local_part@$domain</PRE>
3841 <PRE>
3842          # Director
3843          auto_warning_d:
3844            driver        = smartuser
3845            domains       = &#60;domains you want to do this for&#62;
3846            condition     = ${if eq{$sender_address}{}{no}{yes}}
3847            transport     = warning_t
3848            no_verify
3849            unseen</PRE>
3850 <P>
3851        Note the use of the <TT>condition</TT> option to avoid attempting to send a
3852        message when there is no sender (that is, when the incoming message is a
3853        delivery error report). You can of course extend this to include other
3854        conditions. If you want to log the sending of messages, you can add
3855
3856 </P>
3857 <PRE>
3858          log = /some/file</PRE>
3859 <P>
3860        to the transport and also make use of the "once" option if you want to
3861        send only one message to each sender.
3862
3863 </P>
3864 <A NAME="SEC146" HREF="FAQ.html#TOC146">Q0505</A>: Exim keeps crashing with segmentation errors (signal 11 or 139) during
3865        delivery. This seems to happen when it is about to contact a remote
3866        host or when a delivery is deferred.
3867
3868
3869 <P>
3870 A0505: This could be a problem with Exim's databases. Check that your DBM
3871        library is correctly installed. In particular, if you have installed a
3872        second DBM library onto a system that already had one, check that its
3873        version of <B>ndbm.h</B> is being seen first. For example, if the new version
3874        is in <B>/usr/local/include</B>, check that there isn't another version in
3875        <B>/usr/include</B>. If you are using Berkeley db, you can set <TT>USE_DB=yes</TT> in
3876        your <B>Local/Makefile</B> to avoid using <B>ndbm.h</B> altogether. This is
3877        particularly relevant for version 2 of Berkeley db, because no <B>ndbm.h</B>
3878        file is distributed with it.
3879
3880 </P>
3881 <A NAME="SEC147" HREF="FAQ.html#TOC147">Q0506</A>: Whenever Exim tries to do a local delivery, it gives a permission denied
3882        error for the <B>.forward</B> file, like this:
3883
3884
3885 <PRE>
3886          1998-08-10 16:55:32 0z5y2W-0000B8-00 == xxxx@yyy.zzz &#60;xxxx@yyy.zz&#62;
3887            D=userforward defer (-1): failed to open /home/xxxx/.forward
3888            (userforward director): Permission denied (euid=1234 egid=101)</PRE>
3889 <P>
3890 A0506: Have you remembered to make Exim setuid root?
3891
3892 </P>
3893 <A NAME="SEC148" HREF="FAQ.html#TOC148">Q0507</A>: I have installed Exim, but now I can't mail to root any more. Why is
3894        this?
3895
3896
3897 <P>
3898 A0507: Most people set up root as an alias for the manager of the machine. If
3899        you haven't done this, Exim will attempt to deliver to root as if it
3900        were a normal user. This isn't really a good idea because the delivery
3901        process would run as root. Exim has a trigger guard in the option
3902
3903 </P>
3904 <PRE>
3905          never_users = root</PRE>
3906 <P>
3907        in the default configuration file. This prevents it from running as root
3908        when doing any local deliveries. If you really want to run local
3909        deliveries as root, remove this line, but it would be better to create
3910        an alias for root instead.
3911
3912 </P>
3913 <A NAME="SEC149" HREF="FAQ.html#TOC149">Q0508</A>: How can I stop undeliverable bounce messages (e.g. to routeable, but
3914        undeliverable, spammer senders) from clogging up the queue for days?
3915
3916
3917 <P>
3918 A0508: Set <TT>ignore_errmsg_errors</TT> to drop them immediately, or set <TT>ignore_errmsg_</TT>
3919        <TT>errors_after</TT> to specify a (short) time to keep them for. I use 12h so
3920        that I notice them, but they go away relatively quickly.
3921
3922 </P>
3923 <A NAME="SEC150" HREF="FAQ.html#TOC150">Q0509</A>: How can mails that are being routed through directors other than
3924        localuser be delivered under the uid of the recipient?
3925
3926
3927 <P>
3928 A0509: 
3929         <A HREF="FAQ.html#SEC142">A0501</A> contains background information on this. If you are using, say, an
3930        alias file to direct messages to specific mailboxes, then you can use
3931        the "user" option on either the <B>aliasfile</B> director or the appendfile
3932        transport to set the uid. What you put in the setting depends on how
3933        the required uid is to be found. It could be looked up in a file or
3934        computed somehow from the local part, for example.
3935
3936 </P>
3937 <A NAME="SEC151" HREF="FAQ.html#TOC151">Q0510</A>: I want to use MMDF-style mailboxes. How can I get Exim to append the
3938        ctrl-A characters that separate indvidual emails?
3939
3940
3941 <P>
3942 A0510: Set the suffix option in the appendfile transport. In fact, for MMDF
3943        mailboxes you need a prefix as well as a suffix to get it working right,
3944        so your transport should contain these settings:
3945
3946 </P>
3947 <PRE>
3948          prefix = "\1\1\1\1\n"
3949          suffix = "\1\1\1\1\n"</PRE>
3950 <P>
3951        Also, you need to change the <TT>check_string</TT> and <TT>escape_string</TT> settings so
3952        that the escaping happens for lines in the message that happen to begin
3953        with the MMDF prefix or suffix string, rather than "From" (the default):
3954
3955 </P>
3956 <PRE>
3957          check_string  = "\1\1\1\1\n"
3958          escape_string = "\1\1\1\1 \n"</PRE>
3959 <P>
3960        Adding a space to the line is sufficient to prevent it being taken as a
3961        separator.
3962
3963 </P>
3964 <A NAME="SEC152" HREF="FAQ.html#TOC152">Q0511</A>: I have an ISDN connection and would like a way of running the queue
3965        automatically when it is up.
3966
3967
3968 <P>
3969 A0511: The following shell commands test for the interface being up and then
3970        run the queue:
3971
3972 </P>
3973 <PRE>
3974          ifconfig ppp0 | fgrep UP &#62;/dev/null
3975          if [ $? -eq 0 ] ; then exim -q ; fi</PRE>
3976 <P>
3977        You could put these commands into a script which runs them at regular
3978        intervals. You might want to use <B>-qq</B> instead of <B><B>-q.</B></B>
3979
3980 </P>
3981 <P>
3982        With Linux, the script <B>/etc/ppp/ip-up</B> is run after a ISDN connection
3983        or a more general PPP connection has been established. If you are using
3984        Linux, you could put the call to exim in that script.
3985
3986 </P>
3987 <A NAME="SEC153" HREF="FAQ.html#TOC153">Q0512</A>: If a user's mailbox is over quota, is there a way for me to set it up so
3988        that the mail bounces to the sender and is NOT stored in the mail queue?
3989
3990
3991 <P>
3992 A0512: In the retry section of the configuration, put
3993
3994 </P>
3995 <PRE>
3996          *@your.dom.ain        quota</PRE>
3997 <P>
3998        That is, provide no retry timings for over quota errors. They will then
3999        bounce immediately. Alternatively, you can set up retries for a short
4000        time only, or use something like this:
4001
4002 </P>
4003 <PRE>
4004          *@your.dom.ain        quota_7d
4005          *@your.dom.ain        quota       F,2h,15m; F,3d,1h</PRE>
4006 <P>
4007        which bounces immediately if the user's mailbox hasn't been read for 7
4008        days, but otherwise tries for up to 3 days after the first quota
4009        failure.
4010
4011 </P>
4012 <A NAME="SEC154" HREF="FAQ.html#TOC154">Q0513</A>: I'm using tmail to do local deliveries, but when I turned on the
4013        <TT>use_crlf</TT> option on the pipe transport (tmail prefers \r\n terminations)
4014        message bodies started to vanish.
4015
4016
4017 <P>
4018 A0513: You need to unset the prefix option, or change it so that its default
4019        \n terminator becomes \r\n. For example, the transport could be:
4020
4021 </P>
4022 <PRE>
4023          local_delivery_mbx:
4024            driver = pipe
4025            command = /usr/local/bin/tmail $local_part
4026            user = exim
4027            current_directory = /
4028            use_crlf
4029            prefix =</PRE>
4030 <P>
4031        The reason for this is as follows: tmail uses the line terminator on
4032        the first line it sees to determine whether lines are terminated by
4033        \r\n or \n. If the latter, it moans to stderr and changes subsequent
4034        \n terminators to \r\n. The default setting of the prefix option is
4035        "From ...\n", and this is unaffected by the <TT>use_crlf</TT> option. If you
4036        don't change this, tmail sees the first line terminated by \n and
4037        prepends \r to the \n terminator on all subsequent lines. However, if
4038        <TT>use_crlf</TT> is set, Exim makes all other lines \r\n terminated leading to
4039        doubled \r\r\n lines and corrupt mbx mailboxes.
4040
4041 </P>
4042 <A NAME="SEC155" HREF="FAQ.html#TOC155">Q0514</A>: What does the message "Unable to get root to set uid and gid
4043        for local delivery to <I>xxx</I>: uid=<I>yyy</I> euid=<I>zzz</I>" mean?
4044
4045
4046 <P>
4047 A0514: Have you remembered to make Exim setuid root? It needs root privilege if
4048        it is to do any local deliveries, because it does them "as the user".
4049
4050 </P>
4051 <A NAME="SEC156" HREF="FAQ.html#TOC156">Q0515</A>: I upgraded to 2.04 and now my Envelope-To: header for my virtual domains
4052        is gone. Any idea how to get it back?
4053
4054
4055 <P>
4056 A0515: Read paragraph 1 of the 1.92 information in <B>README.UPDATING.</B> Add
4057        <TT>envelope_to_add</TT> to your transports for your virtual domains. You may
4058        also want to set <TT>return_path_add</TT> and <TT>delivery_date_add</TT>.
4059
4060 </P>
4061 <A NAME="SEC157" HREF="FAQ.html#TOC157">Q0516</A>: The Exim log records the arrival of a message, and then "Completed",
4062        without logging any deliveries. What's going on?
4063
4064
4065 <P>
4066 A0516: This is unlikely in current versions of Exim, because more logging
4067        has been added. In versions before 2.053, one scenario is that the
4068        message was addressed to some user who has set up an Exim filter
4069        containing the command "seen finish", which discards a message without
4070        doing any deliveries. (In current versions of Exim this is logged as
4071        "discarded".) More information can be obtained by setting
4072
4073 </P>
4074 <PRE>
4075          log_received_recipients</PRE>
4076 <P>
4077        so that next time you can see to whom it is addressed. Another
4078        possibility, prior to version 2.053, was that the message was injected
4079        using the <B>-t</B> option, but all the addresses in the message were also on
4080        the command line. See 
4081         <A HREF="FAQ.html#SEC289">A5020</A> for more detail. Current versions of Exim
4082        generate a bounce message in this case.
4083
4084 </P>
4085 <A NAME="SEC158" HREF="FAQ.html#TOC158">Q0517</A>: When I activate "return receipt" for example in Netscape Mailbox
4086        sending options, then I get an error message from Exim... something
4087        like "not supported". Can I activate delivery confirmations?
4088
4089
4090 <P>
4091 A0517: Exim does not support any kind of delivery notification.
4092
4093 </P>
4094 <P>
4095        (A) You can configure it to recognize headers such as
4096        "Return-receipt-to:" if you wish.
4097
4098 </P>
4099 <P>
4100        (B) Some people want MSN (message status notification). Such services
4101        are implemented in MUAs, and don't impact on the MTA at all.
4102
4103 </P>
4104 <P>
4105        (C) I investigated the RFCs which describe the DSN (delivery status
4106        notification) system, and there is even a bit of code in there (excluded
4107        by #ifdef) for handling some of the data. However, I was unable to
4108        specify any sensible way of actually doing anything with the data. There
4109        were comments on the mailing list at the time; many people, including
4110        me, conclude that DSN is in practice unworkable. The killer problem is
4111        with forwarding and aliasing. Do you propagate the DSN data with the
4112        generated addresses? Do you send back a "reached end of the DSN world"
4113        or "expanded" message? Do you do this differently for different kinds of
4114        aliasing/forwarding? For a user who has a <B>.forward</B> file with a single
4115        address in, this might seem easy - just propagate the data. But what if
4116        there are several forwardings? If you propagate the DSN data, the sender
4117        may get back several DSN messages - and should the sender really know
4118        about the detail of the receiver's forwarding arrangements? There isn't
4119        really any way to distinguish between a <B>.forward</B> file that is forwarding
4120        and one that is a mini mailing list. And so on, and so on. There are so
4121        many questions that don't have obvious answers.
4122
4123 </P>
4124 <A NAME="SEC159" HREF="FAQ.html#TOC159">Q0518</A>: When I dial up to collect mail from my ISP, only the first 10 messages
4125        get delivered immediately; the remainder just sit on the queue until a
4126        queue runner process finds them.
4127
4128
4129 <P>
4130 A0518: Your ISP is delivering all the messages in a single SMTP session. Exim
4131        limits the number of immediate delivery processes it will create as a
4132        result of a single SMTP connection, in order to avoid creating a zillion
4133        processes on systems that can have many incoming connections. In your
4134        situation, you should probably set <TT>smtp_accept_queue_per_connection</TT> to
4135        some number larger than 10.
4136
4137 </P>
4138 <A NAME="SEC160" HREF="FAQ.html#TOC160">Q0519</A>: My ISP's mail server is rejecting bounce messages from Exim, complaining
4139        that they have no sender. The SMTP trace does indeed show that the
4140        sender address is "&#60;&#62;". Why is the Sender on the bounce message empty?
4141
4142
4143 <P>
4144 A0519: Because the RFCs say it must be. Your ISP is at fault. Send them this
4145        extract from RFC 1123 section 5.3.3 ("Reliable Mail Receipt"):
4146
4147 </P>
4148 <P>
4149          If there is a delivery failure after acceptance of a message,
4150          the receiver-SMTP MUST formulate and mail a notification
4151          message.  This notification MUST be sent using a null ("&#60;&#62;")
4152          reverse path in the envelope; see Section 3.6 of RFC-821.  The
4153          recipient of this notification SHOULD be the address from the
4154          envelope return path (or the Return-Path: line).  However, if
4155          this address is null ("&#60;&#62;"),  the receiver-SMTP MUST NOT send a
4156          notification.  If the address is an explicit source route, it
4157          SHOULD be stripped down to its final hop.
4158
4159 </P>
4160 <A NAME="SEC161" HREF="FAQ.html#TOC161">Q0520</A>: What does the message "retry time not reached [for any host]" on the log
4161        mean? Why won't Exim try to deliver the message?
4162
4163
4164 <P>
4165 A0520: That is not an error. It means exactly what it says. A previous attempt
4166        to deliver to that address failed with a temporary error, and Exim
4167        computed the earliest time at which to try again. This can apply to
4168        local as well as to remote deliveries. For remote deliveries, each host
4169        (if there are several) has its own retry time.
4170
4171 </P>
4172 <P>
4173        If you are running on a dial-up host, the rest of this answer probably
4174        does not apply to you. Go and read 
4175         <A HREF="FAQ.html#SEC263">Q1404</A> instead. If your host is
4176        permanently online, read on...
4177
4178 </P>
4179 <P>
4180        Some MTAs have a retrying schedule for each message. Exim does not work
4181        like this. Retry timing is normally host-based for remote domains and
4182        address-based for local domains. (There are some exceptions for certain
4183        kinds of remote failure - see "Errors in outgoing SMTP" in the manual.)
4184
4185 </P>
4186 <P>
4187        If a new message arrives for a failing address and the retry time has
4188        not yet arrived, Exim will log "retry time not reached" and leave the
4189        message on the queue, without attempting delivery. Similarly, if a queue
4190        runner notices the message before the time to retry has arrived, it
4191        writes the same log entry. When the retry time has past, Exim attempts
4192        delivery at the next queue run. If you want to know when that will be,
4193        run the exinext utility on the address, for example:
4194
4195 </P>
4196 <PRE>
4197          exinext user@some.domain</PRE>
4198 <P>
4199        You can suppress these messages on the log by setting <TT>log_level</TT> to a
4200        value that is less than 5. You can force a delivery attempt on a
4201        specific message (overriding the retry time) by means of the <B>-M</B> option:
4202
4203 </P>
4204 <PRE>
4205          exim -M 10hCET-0000Bf-00</PRE>
4206 <P>
4207        If you want to do this for the entire queue, use the <B>-qf</B> option. See
4208        also 
4209         <A HREF="FAQ.html#SEC174">Q0533</A>.
4210
4211 </P>
4212 <A NAME="SEC162" HREF="FAQ.html#TOC162">Q0521</A>: RFC 1985 specifies that the SMTP command "ETRN <B>host.domain"</B> causes all
4213        mail queued for that host, no matter what domain it's for, to be
4214        dequeued. Why doesn't Exim support this?
4215
4216
4217 <P>
4218 A0521: Exim does not keep queues of mail for specific destinations. It just
4219        keeps one pool of undelivered messages. What is more, once you start a
4220        delivery of a message, it tries to deliver to <EM>all</EM> the addresses in the
4221        message, not just the one you may be interested in. (Of course, this
4222        doesn't usually do any harm.)
4223
4224 </P>
4225 <P>
4226        The only way it could be done within Exim would be, for <EM>every</EM> message
4227        on the queue, to go through the motions of routing each undelivered
4228        address and see if that resulted in a delivery to the host of interest.
4229        This could be extremely expensive (e.g. 1,000 messages on the queue,
4230        only 1 for the given host).
4231
4232 </P>
4233 <P>
4234        The bottom line is that Exim just wasn't designed for this kind of
4235        operation, that is, holding messages for intermittently connected hosts.
4236        The queueing arrangements are designed for handling delivery problems
4237        that are not expected to be common.
4238
4239 </P>
4240 <P>
4241        A better way to do this is to implement the required queues separately.
4242        After all, keeping such mail on an "active" queue (where Exim will keep
4243        trying to deliver) is silly. If there is a lot of mail for these hosts,
4244        it also masks genuine delivery problems when you inspect the queue.
4245
4246 </P>
4247 <P>
4248        Large ISPs who provide this kind of functionality do not usually leave
4249        waiting mail on the MTA's queue. Instead, they get it delivered into
4250        per-host directories, one message per file, in one of the special
4251        formats (BSMTP, maildir, or mailstore) and when an ETRN arrives, it
4252        kicks off some completely different program that establishes an SMTP
4253        connection to the host and shovels the waiting mail down it. That seems
4254        to me to be a much neater way of doing this. It means you can easily add
4255        additional functionality such as archiving or throwing away uncollected
4256        mail.
4257
4258 </P>
4259 <P>
4260        One program that has this functionality is "ssmtp", which can be
4261        found in <B><A HREF="ftp://metalab.unc.edu/pub/Linux/system/mail/mta/.">ftp://metalab.unc.edu/pub/Linux/system/mail/mta/.</A></B>
4262        Alternatively, sample configuration C037 demonstrates an elegant way of
4263        using Exim itself to deliver the saved messages when the client issues
4264        an ETRN.
4265
4266 </P>
4267 <A NAME="SEC163" HREF="FAQ.html#TOC163">Q0522</A>: If email has been deferred to a member on a local mailing list
4268        (implemented through forward files), and one of our ETRN clients is on
4269        this mailing list, the <B>-R</B> won't "flush" the mailing list message for
4270        that client.
4271
4272
4273 <P>
4274 A0522: That is because <B>-R</B> matches only original recipient addresses, not those
4275        produced as a result of expansion, because these are not (by default)
4276        preserved from delivery to delivery. You can get round this by setting
4277        <TT>one_time</TT> on the <B>forwardfile</B> director, but you are not allowed to have
4278        expansions to pipes or files on directors that have <TT>one_time</TT> set.
4279        Therefore, you will have to have a separate director for mailing lists
4280        (with <TT>one_time</TT> set) to the one used for normal forward files that might
4281        specify pipe or file deliveries. However, the problem will then still be
4282        present for any user who sets up a <B>.forward</B> file to redirect to any of
4283        the ETRN domains. See the last 3 paragraphs of 
4284         <A HREF="FAQ.html#SEC162">A0521</A> for a discussion of
4285        an alternative approach.
4286
4287 </P>
4288 <A NAME="SEC164" HREF="FAQ.html#TOC164">Q0523</A>: Exim seems to be sending the same message twice, according to the log,
4289        although there is a difference in capitalization of the local part of
4290        the address.
4291
4292
4293 <P>
4294 A0523: That is correct. The RFCs are explicit in stating that capitalization
4295        matters for local parts. For remote domains, Exim is not entitled to
4296        assume case independence of local parts. I know, it is utterly silly,
4297        and it causes a lot of grief, but that's what the rules say. Here is a
4298        quote from the draft of the forthcoming revision to RFC 821:
4299
4300 </P>
4301 <P>
4302          ... a command verb, an argument value other than a mailbox
4303          local-part, and free form text MAY be encoded in upper case,
4304          lower case, or any mixture of upper and lower case with no impact
4305          on its meaning.  This is NOT true of a mailbox local-part. The
4306          local-part of a mailbox MUST BE treated as case sensitive.
4307          Therefore, SMTP implementations MUST take care to preserve the
4308          case of mailbox local-parts.  Mailbox domains are not case
4309          sensitive.  However, exploiting the case sensitivity of mailbox
4310          local-parts impedes interoperability and is discouraged.
4311
4312 </P>
4313 <A NAME="SEC165" HREF="FAQ.html#TOC165">Q0524</A>: How can I force the next retry time for a host to be now?
4314
4315
4316 <P>
4317 A0524: (A) You can force a particular message to be delivered with the <B>-M</B>
4318        command line option. If it succeeds, the retry data will get cleared. If
4319        the host is past the cutoff time, so that messages are bouncing
4320        immediately without trying a delivery, you can use <B>-odq</B> to put a message
4321        on the queue without a delivery attempt, and then use <B>-M</B> on it.
4322
4323 </P>
4324 <P>
4325        (B) You can change the retry time with the <TT>exim_fixdb</TT> utility, but its
4326        interface is very clumsy.
4327
4328 </P>
4329 <A NAME="SEC166" HREF="FAQ.html#TOC166">Q0525</A>: I set up "|/bin/grep Subject|/usr/bin/smbclient <B>-M</B> &#60;netbiosname&#62;" as an
4330        alias but it doesn't work.
4331
4332
4333 <P>
4334 A0525: That is a shell command line. Exim does not run pipe commands under a
4335        shell by default (for added security - and it saves a process). You
4336        need something like
4337
4338 </P>
4339 <PRE>
4340          "|/bin/sh -c '/bin/grep Subject|/usr/bin/smbclient -M &#60;netbiosname&#62;'"</PRE>
4341 <A NAME="SEC167" HREF="FAQ.html#TOC167">Q0526</A>: Why does the pipe transport add a line starting with "&#62;From" to
4342        messages?
4343
4344
4345 <P>
4346 A0526: Actually, it adds a line starting with "From", because that is the
4347        default of the "prefix" option (/usr/ucb/vacation needs it, and that is
4348        the most common use of piping). If you don't want it, change the setting
4349        of "prefix".
4350
4351 </P>
4352 <A NAME="SEC168" HREF="FAQ.html#TOC168">Q0527</A>: I have set <TT>fallback_hosts</TT> on my smtp transport, but after the error
4353        <B><B>"sem@chat.ru</B></B> cannot be resolved at this time" Exim isn't using them.
4354
4355
4356 <P>
4357 A0527: <TT>fallback_hosts</TT> only works if an attempt at delivery to the original
4358        host(s) fails. In this case, Exim couldn't even resolve the domain
4359        <B>chat.ru</B> to discover what the original hosts were, so it never got as far
4360        as the transport. However, see 
4361         <A HREF="FAQ.html#SEC89">Q0322</A> for a possible solution.
4362
4363 </P>
4364 <A NAME="SEC169" HREF="FAQ.html#TOC169">Q0528</A>: After the holidays my ISP has always hundreds of e-mails waiting for me.
4365        These are forced down Exim's throat in one go. Exim spawns a lot of
4366        kids, but is there some limit to the number of processes it creates?
4367
4368
4369 <P>
4370 A0528: Unless you have changed <TT>smtp_accept_queue_per_connection</TT> (introduced at
4371        release 2.03) it should only spawn that many processes per connection
4372        (default 10). Your ISP may be making many connections, of course. That
4373        is limited by <TT>smtp_accept_max</TT>.
4374
4375 </P>
4376 <A NAME="SEC170" HREF="FAQ.html#TOC170">Q0529</A>: When a message in the queue got to 12h old, Exim wrote 'retry timeout
4377        exceeded' and removed <EM>all</EM> messages in the queue to this host - even
4378        recent messages. How I can avoid this behaviour? I only want to remove
4379        messages that have exceeded the maximum retry time.
4380
4381
4382 <P>
4383 A0529: Exim's retrying is host-based rather than message-based. The philosophy
4384        is that if a host has been down for a very long time, there is no point
4385        in keeping messages hanging around. However, you might like to check
4386        out <TT>delay_after_cutoff</TT> in the smtp transport. It doesn't do what you
4387        want, but it might help.
4388
4389 </P>
4390 <A NAME="SEC171" HREF="FAQ.html#TOC171">Q0530</A>: Can Exim add a Content-Length: header to messages it delivers?
4391
4392
4393 <P>
4394 A0530: You could include something like
4395
4396 </P>
4397 <PRE>
4398          headers_remove = "content-length"
4399          headers_add = "Content-Length: $message_body_size"</PRE>
4400 <P>
4401        to the appendfile transport. However, the use of Content-Length: can
4402        cause several problems, and is not recommended unless you really know
4403        what you are doing. There is a discussion of the problems in
4404
4405 </P>
4406 <P>
4407          <B><A HREF="http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html">http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html</A></B>
4408
4409 </P>
4410 <A NAME="SEC172" HREF="FAQ.html#TOC172">Q0531</A>: Exim seems to be trying to deliver a message every 10 minutes, though
4411        the retry rules specify longer times after a while, because it is
4412        writing a log entry every time, like this:
4413
4414
4415 <PRE>
4416        1999-08-26 14:51:19 11IVsE-000MuP-00 == example@example.com T=smtp defer
4417        (-34): some host address lookups failed and retry time not reached for
4418        other hosts or connection limit reached</PRE>
4419 <P>
4420 A0531: It is <EM>looking</EM> at the message every 10 minutes, but it isn't actually
4421        trying to deliver. It's looking up <B>example.com</B> in the DNS and finding
4422        this information:
4423
4424 </P>
4425 <PRE>
4426          example.com.                MX 10 example-com.isp.example.com.
4427          example.com.                MX  0 mail.example.com.
4428          mail.example.com.           A  202.77.183.45
4429          A lookup for example-com.isp.example.com. yielded NXDOMAIN</PRE>
4430 <P>
4431        The last line means that there is no address (A) record in the DNS for
4432        <B>example-com.isp.example.com.</B> That accounts for "some host address
4433        lookups failed", but the retry time for <B>mail.example.com</B> hasn't been
4434        reached, which accounts for "retry time not reached for other hosts".
4435
4436 </P>
4437 <A NAME="SEC173" HREF="FAQ.html#TOC173">Q0532</A>: I am trying to set exim up to have a automatic failover if it sees that
4438        the system that it is sending all mail to is down.
4439
4440
4441 <P>
4442 A0532: Add to the <TT>remote_smtp</TT> transport the following:
4443
4444 </P>
4445 <PRE>
4446          fallback_hosts = failover.server.name(s)</PRE>
4447 <P>
4448        If there are several names, they must be separated by colons.
4449
4450 </P>
4451 <A NAME="SEC174" HREF="FAQ.html#TOC174">Q0533</A>: I can't get Exim to deliver over NFS. I get the error "fcntl() failed:
4452        No locks available", though the lock daemon is running on the NFS server
4453        and other hosts are able to access it.
4454
4455
4456 <P>
4457 A0533: Check that you have lockd running on the NFS <EM>client</EM>. This is not
4458        always running by default on some systems (Red Hat is believed to be one
4459        such system).
4460
4461 </P>
4462 <A NAME="SEC175" HREF="FAQ.html#TOC175">Q0534</A>: Why does Exim bounce messages without even attempting delivery, giving
4463        the error "retry time not reached for any host after a long failure
4464        period"?
4465
4466
4467 <P>
4468 A0534: This message means that all hosts to which the message could be sent
4469        have been failing for so long that the end of the retry period
4470        (typically 4 or 5 days) has been reached. In this situation, Exim still
4471        computes a next time to retry, but any messages that arrive in the
4472        meantime are bounced straight away. You can alter this behaviour by
4473        unsetting the <TT>delay_after_cutoff</TT> option on the smtp transport. Then Exim
4474        will try most messages for those hosts once before giving up.
4475
4476 </P>
4477 <A NAME="SEC176" HREF="FAQ.html#TOC176">Q0535</A>: My <B>.forward</B> file is "|/usr/bin/procmail <B>-f-"</B> and mail gets delivered,
4478        but there was a bounce to the sender, sending him the output of procmail.
4479        How can I prevent this?
4480
4481
4482 <P>
4483 A0535: Exim's default configuration is set up like this:
4484
4485 </P>
4486 <PRE>
4487          address_pipe:
4488            driver = pipe
4489            return_output</PRE>
4490 <P>
4491        The <TT>return_output</TT> option requests that <EM>any</EM> output that the pipe
4492        produces be returned to the sender. That is the safest default. If you
4493        don't want this, you can either remove the option altogether, or change
4494        it to <TT>return_fail_output</TT>, to return output only if the command fails.
4495        Note that this will affect all pipes that users run, not just your
4496        procmail one. It might be better to arrange for procmail not to produce
4497        any output when it succeeds.
4498
4499 </P>
4500 <A NAME="SEC177" HREF="FAQ.html#TOC177">Q0536</A>: Can I write an ordinary file when I running a perl script as a transport
4501        filter for <TT>remote_smtp</TT> and <TT>address_pipe</TT> transports?
4502
4503
4504 <P>
4505 A0536: Yes, provided the file is writeable by the Exim user. However, if two
4506        messages are being delivered at once, their data will get mixed up in
4507        the file unless you implement your own locking scheme. If all you want
4508        to do is to take a copy of the message, another approach that avoids
4509        the locking problem is to use a system filter to set up an "unseen"
4510        delivery to a file. If you only want the message's headers, you can
4511        set <TT>message_filter_file_transport</TT> to point to a special appendfile
4512        transport that has <TT>headers_only</TT> set.
4513
4514 </P>
4515 <A NAME="SEC178" HREF="FAQ.html#TOC178">Q0537</A>: I have some mails on my queues that are sticking around longer than
4516        the retry time indicates they should. They are all getting frozen
4517        because some remote admin has set their MX record to 127.0.0.1.
4518
4519
4520 <P>
4521 A0537: The admin in question is an idiot. Exim will always freeze such messages
4522        because they are apparently routed to the local host. There are two
4523        router options that can help you deal with them.
4524
4525 </P>
4526 <P>
4527        (1) Set
4528
4529 </P>
4530 <PRE>
4531          self = fail</PRE>
4532 <P>
4533        on the router which handles the domain - in a simple configuration this
4534        will be the <B>lookuphost</B> router. This will cause the relevant addresses to
4535        bounce, instead of freezing the message.
4536
4537 </P>
4538 <P>
4539        (2) If you are running Exim 3.20 or later, you can set
4540
4541 </P>
4542 <PRE>
4543          ignore_target_hosts = 127.0.0.1</PRE>
4544 <P>
4545        on the router instead. This causes Exim to completely ignore any hosts
4546        with that IP address.
4547
4548 </P>
4549 <A NAME="SEC179" HREF="FAQ.html#TOC179">Q0538</A>: My <B>/var/spool/mail</B> has grown drastically. Is there any possibility of
4550        using two files in <B>exim.cfg</B> ?
4551
4552
4553 <P>
4554 A0538: You can use an expansion string to split mailboxes between two
4555        directories. For example,
4556
4557 </P>
4558 <PRE>
4559          file = /var/spool/mail${nhash_2:$local_part}/$local_part</PRE>
4560 <P>
4561        which does a hash on the local part, producing either 0 or 1, thereby
4562        using mail0 or mail1. But remember, the MUAs that read these mailboxes
4563        also have to know where they are.
4564
4565 </P>
4566 <A NAME="SEC180" HREF="FAQ.html#TOC180">Q0539</A>: Sendmail has a program called smrsh that restricts what binaries
4567        can be run from sendmail aliases. Is there someting like this in Exim ?
4568
4569
4570 <P>
4571 A0539: Check out the <TT>allow_commands</TT> option in the pipe transport.
4572
4573 </P>
4574 <A NAME="SEC181" HREF="FAQ.html#TOC181">Q0540</A>: I wish to have large emails go out one at a time.
4575
4576
4577 <P>
4578 A0540: One possibility is to set up a router that defers all large messages,
4579        except in queue runs. Since queue runners deliver just one
4580        message at a time, if you limited the number of simultaneous queue
4581        runners to 1, you would get the effect you wanted. A suitable router
4582        might be
4583
4584 </P>
4585 <PRE>
4586          defer_if_large_unless_queue_run:
4587            driver = domainlist
4588            self = defer
4589            condition = ${if or{{queue_running}{&#60;{$message_size}{200K}}}{no}{yes}}
4590            route_list = * 127.0.0.1 byname</PRE>
4591 <P>
4592        Of course, this would always delay any large message until the next
4593        queue runner, but if you run them fairly regularly, this shouldn't be a
4594        huge problem. (May even be desirable!)
4595
4596 </P>
4597 <BR><H2><A NAME="SEC182" HREF="FAQ.html#TOC182">6. UUCP
4598
4599 </A></H2>
4600 <A NAME="SEC183" HREF="FAQ.html#TOC183">Q0601</A>: The MX records for some UUCP domains point to my local host. How do I
4601        get it to pass the messages on to UUCP?
4602
4603
4604 <P>
4605 A0601: There are several possibilities. One straightforward way is to set up
4606        a <B>domainlist</B> router which matches the UUCP domains and routes to a
4607        suitable transport. Sample configuration C003 is such a configuration,
4608        while C004 shows another way to do it, by defining the domains as local
4609        and using a <B>smartuser</B> director.
4610
4611 </P>
4612 <P>
4613        If <EM>all</EM> the domains whose MX records point to the local host are either
4614        local domains or UUCP domains, you can do without the <B>domainlist</B> router
4615        altogether, by making use of the "self" option. This means that only the
4616        DNS has to be updated when a UUCP domain is added or removed.
4617
4618 </P>
4619 <P>
4620        For example, this router routes to remote hosts over SMTP using a DNS
4621        lookup with default options, and fails for unknown domains (because of
4622        the <TT>no_more</TT> setting), but if the MX for a domain points at the local
4623        host, Exim continues on to the next router (self = <TT>fail_soft</TT> overrides
4624        <TT>no_more)</TT>.
4625
4626 </P>
4627 <PRE>
4628          lookuphost:
4629            driver = lookuphost
4630            transport = smtp
4631            no_more
4632            self = fail_soft</PRE>
4633 <P>
4634        The next router can just send everything to a suitable UUCP transport:
4635
4636 </P>
4637 <PRE>
4638          uucp:
4639            driver = domainlist
4640            transport = uux_transport
4641            route_list = "* $domain"</PRE>
4642 <P>
4643        This assumes that the transport can determine the UUCP host name from
4644        the domain name.
4645
4646 </P>
4647 <A NAME="SEC184" HREF="FAQ.html#TOC184">Q0602</A>: How can I get Exim to handle "bang path" addresses?
4648
4649
4650 <P>
4651 A0602: In general, you can't (Exim is an Internet mailer and recognizes only
4652        RFC 822 addresses) but some restricted kinds of bang path can be dealt
4653        with by appropriate rewriting - but please note the warning below.
4654
4655 </P>
4656 <P>
4657        Exim treats a bang path address as an unqualified local part, and so
4658        will qualify it with your domain. A rule such as
4659
4660 </P>
4661 <PRE>
4662          ^([^!]+)!(.+)@your\.domain$   $2@$1</PRE>
4663 <P>
4664        turns <B><B>a!b@your.domain</B></B> into <B><B>b@a.</B></B> You can also use a repeating rule to
4665        turn multi-component paths into the "percent hack" notation with a rule
4666        such as
4667
4668 </P>
4669 <PRE>
4670          ^([^!]+)!([^@%]+)(.+)$   $2%$1$3   R</PRE>
4671 <P>
4672        which turns <B>a!b@c</B> into <B>b%a@c</B> and <B>a!b!c@d</B> first into <B>b!c%a@d</B> and then,
4673        because of the R flag, into <B><B>c%b%a@d.</B></B> The R flag causes repetition up to
4674        10 times.
4675
4676 </P>
4677 <P>
4678        See also sample configuration C002, which contains some more
4679        sophisticated rewriting rules.
4680
4681 </P>
4682 <P>
4683        WARNING: If you install a general rewriting rule like the above, you are
4684        opening yourself up to the possibility of unwanted relaying. A host that
4685        is not permitted to relay through your system could send a message with
4686        an SMTP command line such as
4687
4688 </P>
4689 <PRE>
4690          RCPT TO:&#60;victim-host!victim-user@your.domain&#62;</PRE>
4691 <P>
4692        and this would be accepted because it is addressed to your domain.
4693        However, the rewriting then converts the address, and the message does
4694        in fact get relayed. One way round this, if all your bang path messages
4695        are passed to Exim via SMTP, is to use the "S" rewriting flag. This
4696        applies a rewriting rule to incoming SMTP addresses as soon as they are
4697        received, before checking for qualification, relaying, etc. So a rule
4698        such as
4699
4700 </P>
4701 <PRE>
4702          ^([^!]+)!(.+)$  $2@$1  S</PRE>
4703 <P>
4704        rewrites simple two-component bang paths before the result is checked
4705        for relaying. However, this does not rewrite addresses in the headers of
4706        the message.
4707
4708 </P>
4709 <A NAME="SEC185" HREF="FAQ.html#TOC185">Q0603</A>: We see something strange on our system in regards to mail comming in via
4710        rmail from a UUCP link. The sender is being set to mailmaster instead of
4711        the real sender, and a Sender: header is being added to the message.
4712
4713
4714 <P>
4715 A0603: If mailmaster is the user that is running rmail, you need to include
4716        that user in the <TT>trusted_users</TT> configuration option. Only trusted users
4717        are permitted to specify senders when mail is passed to Exim via the
4718        command line.
4719
4720 </P>
4721 <BR><H2><A NAME="SEC186" HREF="FAQ.html#TOC186">7. PERFORMANCE
4722
4723 </A></H2>
4724 <A NAME="SEC187" HREF="FAQ.html#TOC187">Q0701</A>: I'm running a large mail server. Should I set <TT>split_spool_directory</TT> to
4725        improve performance?
4726
4727
4728 <P>
4729 A0701: There doesn't seem to be any significant performance hit using a flat
4730        queue on Solaris systems, so there is no need to do this for them. On
4731        the other hand, there is a known performance problem on Linux filing
4732        systems, where <TT>split_spool_directory</TT> can make a significant difference.
4733        ???? Other operating systems ????
4734
4735 </P>
4736 <A NAME="SEC188" HREF="FAQ.html#TOC188">Q0702</A>: How well does Exim scale?
4737
4738
4739 <P>
4740 A0702: Although the author did not specifically set out to write a high-
4741        performance MTA, Exim does seem to be fairly efficient. The biggest
4742        server at the University of Cambridge (a large Sun box) goes over
4743        100,000 deliveries per day on busy days (it has over 20,000 users).
4744        There was a report of a mailing list exploder that sometimes handles
4745        over 100,000 deliveries a day on a big Linux box, the record being
4746        177,000 deliveries (791MB in total). Up to 13,000 deliveries an hour
4747        have been reported.
4748
4749 </P>
4750 <P>
4751        These are quotes from some Exim users:
4752
4753 </P>
4754 <P>
4755        "... Canada's largest internet provider, uses Exim on all of our mail
4756        machines, and we're absolutely delighted with it. It brought life back
4757        into one of our machines plagued with backlogs and high load averages.
4758        Here's just an example of how much email our largest mail server
4759        (quad SS1000) is seeing ... "  [230,911 deliveries in a day: 4,475MB]
4760
4761 </P>
4762 <P>
4763        "... Exim has to ... do gethostbyname()s and RBL lookups on all of the
4764        incoming mail servers, and he runs from <B>inetd</B> (TCP Wrappers connected).
4765        All the same, it seems to me that he runs as fast as lightning on our
4766        SCO 5.0.4 box (1 Pentium 166) - far faster than MMDF which I (and many
4767        customers) had before."
4768
4769 </P>
4770 <P>
4771        "On a PII 400 with 128M of RAM running Linux 2.2.5, I have achieved
4772        36656 messages per hour (outgoing unique messages and recipients). For
4773        about a 5 minute period, I was able to achieve an average of 30 messages
4774        per second (that would be 108000 m/hour)! We are using: (options that
4775        make a difference):
4776
4777 </P>
4778 <PRE>
4779          queue_only
4780          split_spool_directory
4781          auto_thaw 60s
4782          max_queue_run 1
4783          remote_max_parallel 1</PRE>
4784 <P>
4785        We have a cron job hat runs every five minutes that spawns 5 exim <B>-q</B> if
4786        there are less that 120 exim processes currently running. We found
4787        that by "manually" controlling the concurrency of exim <B>-q</B> processes
4788        contending for the spool for <TT>remote_smtp</TT> delivery that we gained
4789        considerable performance <B>--</B> 10000 m/hour."
4790
4791 </P>
4792 <A NAME="SEC189" HREF="FAQ.html#TOC189">Q0703</A>: We have a large password file. Can Exim use alternative lookups during
4793        delivery to speed things up?
4794
4795
4796 <P>
4797 A0703: Yes. You don't have to use the password file at all. See sample
4798        configuration C009 for some suggestions. (It shows lsearch lookups, but
4799        these could equally be DBM or cdb or NIS or LDAP lookups.)
4800
4801 </P>
4802 <P>
4803        If you are using FreeBSD, this problem should not arise, because it
4804        automatically uses an indexed password file. In some other operating
4805        systems you can arrange for this to happen too. On Linux, for example,
4806        all you need to do is
4807
4808 </P>
4809 <PRE>
4810          # cd /var/db
4811          # make</PRE>
4812 <P>
4813        and put "db" before "files" in any <B><B>/etc/nsswitch.conf</B></B> lines you want to
4814        use db for.
4815
4816 </P>
4817 <A NAME="SEC190" HREF="FAQ.html#TOC190">Q0704</A>: I just wondered if it might be helpful to put the hints database on a
4818        RAM disk during regular operation. Did anybody try that yet?
4819
4820
4821 <P>
4822 A0704: A user reported thus: I have found that this works GREAT under Solaris.
4823        Make a RAM disk partition and keep everything in the "db" directory on
4824        it. However, when I try the same thing on Linux, I don't see the same
4825        boost. I think that Linux's file buffer cache works about the same.
4826        Plus, this leave more room for processes to run.
4827
4828 </P>
4829 <BR><H2><A NAME="SEC191" HREF="FAQ.html#TOC191">8. POLICY CONTROLS
4830
4831 </A></H2>
4832 <A NAME="SEC192" HREF="FAQ.html#TOC192">Q0801</A>: How do I block unwanted messages from outside my host?
4833
4834
4835 <P>
4836 A0801: There are several different options that can be used to block incoming
4837        SMTP messages according to different criteria. The following are the
4838        most commonly used:
4839
4840 </P>
4841 <P>
4842        (A) Set <TT>sender_verify</TT>; this causes rejection of any message whose
4843            envelope sender cannot be successfully routed. This is mainly a
4844            check on the existence of remote domains, though it the domain is a
4845            local one, the local part also gets checked. Unfortunately, error
4846            mesages do not have envelope sender addresses, so cannot be checked
4847            in this way. See the <TT>headers_sender_verify</TT> options for ways of
4848            checking header addresses.
4849
4850 </P>
4851 <P>
4852        (B) If you want to block all mail from specific hosts or IP networks,
4853            set <TT>host_reject_recipients</TT>. The <TT>_recipients</TT> form of the option is
4854            more likely to prevent the remote hosts from keeping on trying. For
4855            example:
4856
4857 </P>
4858 <PRE>
4859              host_reject_recipients = 209.12.111.0/24</PRE>
4860 <P>
4861            If you have many such blocks, they can be put in a file which is
4862            named in the option. If you have a mixture of IP addresses and names
4863            in your list, it is best to put the addresses first, because they
4864            can be checked without the need for a DNS lookup.
4865
4866 </P>
4867 <P>
4868        (C) If you want to block mail from specific envelope sender addresses,
4869            one convenient way is to organize a file of local parts indexed by
4870            domain names, for example
4871
4872 </P>
4873 <PRE>
4874              x.y.z     creditrepair:^betterlovelife[0-9]+$:...
4875              p.q.r     *</PRE>
4876 <P>
4877            This would block <B><B>creditrepair@x.y.z</B>,</B> any local part starting with
4878            <B>betterlovelife</B> and ending with digits in the <B>x.y.z</B> domain, and
4879            all addresses in the <B>p.q.r</B> domain. You refer to the file in the Exim
4880            configuration as follows:
4881
4882 </P>
4883 <PRE>
4884              sender_reject_recipients = @@lsearch*;/name/of/the/file</PRE>
4885 <P>
4886            If the file is big, you can convert it into a DBM or cdb file and
4887            use a faster lookup method. The asterisk on the end of the search
4888            type causes a lookup for "*" if the domain is not found; that is, it
4889            permits a default list of local parts that are blocked at any
4890            domain that is not specifically listed. If you use this, you
4891            probably also want to end each local part list with "&#62;*" (except
4892            those that consist of "*"). This causes Exim to check the default
4893            list of local parts if none of the specific ones for a domain are
4894            matched. So, the file above could become
4895
4896 </P>
4897 <PRE>
4898              *         yourfriend:a.friend:...
4899              x.y.z     creditrepair:^betterlovelife[0-9]+$:&#62;*
4900              p.q.r     *</PRE>
4901 <P>
4902            If you are using an lsearch file, putting the * entry first saves a
4903            bit of processing.
4904
4905 </P>
4906 <P>
4907        (D) If you want to allow mail to postmaster through the blocks, you can
4908            set
4909
4910 </P>
4911 <PRE>
4912              recipients_reject_except = postmaster@your.domain</PRE>
4913 <P>
4914            This overrides any of the policy controls that cause rejection by
4915            recipient.
4916
4917 </P>
4918 <A NAME="SEC193" HREF="FAQ.html#TOC193">Q0802</A>: I don't want to block spam entirely; how can I inspect each message
4919        before deciding whether to deliver it or not?
4920
4921
4922 <P>
4923 A0802: This can be done by using a system filter. See the sample configuration
4924        F003.
4925
4926 </P>
4927 <A NAME="SEC194" HREF="FAQ.html#TOC194">Q0803</A>: How can I test that my spam blocks are working?
4928
4929
4930 <P>
4931 A0803: The <B>-bh</B> option allows you to run a testing SMTP session as if from a
4932        given IP address. For example,
4933
4934 </P>
4935 <PRE>
4936          exim -bh 192.203.178.39</PRE>
4937 <P>
4938        In addition to the normal SMTP replies, it outputs commentary about
4939        which tests have succeeded or failed.
4940
4941 </P>
4942 <A NAME="SEC195" HREF="FAQ.html#TOC195">Q0804</A>: How can I test that Exim is correctly configured to use the Realtime
4943        Blocking List (RBL)?
4944
4945
4946 <P>
4947 A0804: The <B>-bh</B> option allows you to run a testing SMTP session as if from a
4948        given address. You need to know a blocked IP address with which to test.
4949        Such a testing address is kindly provided by Russell Nelson:
4950
4951 </P>
4952 <PRE>
4953          linux.crynwr.com [192.203.178.39]</PRE>
4954 <P>
4955        You can also send mail to <B><B>nelson@linux.crynwr.com</B></B> from the server
4956        whose RBL block you are testing. The robot that receives that email
4957        will attempt to send a piece of test email in reply. If your RBL block
4958        didn't work, you get a message to that effect. Regardless of whether the
4959        RBL block succeeds or not it emails you the results of the SMTP
4960        conversation from a host that is not on the RBL, so you can see how your
4961        server looks from the view of someone on the RBL.
4962
4963 </P>
4964 <A NAME="SEC196" HREF="FAQ.html#TOC196">Q0805</A>: How can I use <B>tcpwrappers</B> in conjunction with Exim?
4965
4966
4967 <P>
4968 A0805: Exim's own control facilities can do all that <B>tcpwrappers</B> can do.
4969        However, if you are already using <B>tcpwrappers</B> for other things it might
4970        be convenient to include Exim controls in the same place.
4971
4972 </P>
4973 <P>
4974        First of all, ensure that Exim is built to call the <B>tcpwrappers</B> library,
4975        by including <TT>USE_TCPWRAPPERS=yes</TT> in <B>Local/Makefile</B>. You also need to
4976        ensure that the header file <B>tcpd.h</B> is available at compile time, and the
4977        <B>libwrap.a</B> library is available at link time, typically by including it in
4978        <TT>EXTRALIBS</TT>. You may need to copy these two files from the <B>tcpwrappers</B>
4979        build directory to, for example, <B>/usr/local/include</B> and <B>/usr/local/lib</B>,
4980        respectively. Then you could reference them by
4981
4982 </P>
4983 <PRE>
4984          CFLAGS=-I/usr/local/include
4985          EXTRALIBS=-L/usr/local/lib -lwrap</PRE>
4986 <P>
4987        in <B>Local/Makefile</B>. There are two ways to make use of the functionality,
4988        depending on how you have <B>tcpwrappers</B> set up. If you have it set up to
4989        use only one file, you ought to have something like:
4990
4991 </P>
4992 <PRE>
4993          /etc/hosts.allow:</PRE>
4994 <PRE>
4995              exim : &#60;client_list&#62;  : &#60;allow_or_deny&#62;</PRE>
4996 <P>
4997          For example:
4998
4999 </P>
5000 <PRE>
5001              exim : LOCAL  192.168.0.  .friendly.domain  special.host : ALLOW
5002              exim : ALL                                               : DENY</PRE>
5003 <P>
5004        This allows connections from local hosts (chiefly `localhost'), from
5005        the subnet 192.168.0.0/24, from all hosts in <B>*.friendly.domain,</B> and
5006        from a specific host called <B>special.host.</B> All other connections are
5007        denied. If you have <B>tcpwrappers</B> set up to use two files, use the
5008        following:
5009
5010 </P>
5011 <PRE>
5012          /etc/hosts.allow:</PRE>
5013 <PRE>
5014              exim    : &#60;client_list&#62;</PRE>
5015 <PRE>
5016          /etc/hosts.deny:</PRE>
5017 <PRE>
5018              exim    : &#60;client_list&#62;</PRE>
5019 <P>
5020        Read the <TT>hosts_access(5)</TT> man page for more ways of specifying clients,
5021        including ports, <B>etc.,</B> and on logging connections.
5022
5023 </P>
5024 <A NAME="SEC197" HREF="FAQ.html#TOC197">Q0806</A>: How can I get POP-auth-before-relay support in Exim?
5025
5026
5027 <P>
5028 A0806: See <B><A HREF="http://cc.ysu.edu/~doug/exim-pop.tar.Z">http://cc.ysu.edu/~doug/exim-pop.tar.Z</A></B> which has some scripts for
5029        this, courtesy of Doug S <B><B>&#60;doug@cc.ysu.edu</B>&#62;.</B> See also 
5030         <A HREF="FAQ.html#SEC226">Q0835</A>.
5031
5032 </P>
5033 <A NAME="SEC198" HREF="FAQ.html#TOC198">Q0807</A>: I have one or two cases where my machine correctly rejects messages, but
5034        the remote machine is quite persistent, and keeps trying over and over.
5035
5036
5037 <P>
5038 A0807: It is an unfortunate fact that a number of SMTP clients, in violation of
5039        the SMTP RFC, do not treat a permanent error code that is given after
5040        the  MAIL FROM command or the DATA portion of the transaction as a
5041        permanent error. Consequently they keep resending the message. Failing
5042        checks on a message's headers (the <TT>headers_</TT>... options) necessarily
5043        result in an error code after the data has been received.
5044
5045 </P>
5046 <A NAME="SEC199" HREF="FAQ.html#TOC199">Q0808</A>: I am seeing the error "no valid sender in message headers: return path
5047        is &#60;&#62;" in the reject log. Isn't &#60;&#62; a valid return path for error
5048        messages?
5049
5050
5051 <P>
5052 A0808: It is indeed valid. The complaint here is about the contents of the
5053        message's headers, not the return path. This message has been reworded
5054        in later versions of Exim. You must have set the <TT>headers_sender_verify</TT>
5055        option. Check the From:, Reply-to: and Sender: headers that were logged
5056        with the error. You can use Exim's <B>-bv</B> option to find out why
5057        verification of those addresses failed.
5058
5059 </P>
5060 <A NAME="SEC200" HREF="FAQ.html#TOC200">Q0809</A>: Let's say that we want to run a mail server that does not care if you
5061        have proper reverse DNS. If you include <TT>host_reject</TT> lines in your
5062        config file, Exim will always reject connections from such hosts. How
5063        can this be avoided?
5064
5065
5066 <P>
5067 A0809: This is true only if you have wild-carded host names in  <TT>host_reject</TT>.
5068        For complete host names, Exim uses a DNS forward lookup to obtain an IP
5069        address to compare. If you are using wild cards of any sort, put
5070        <TT>+allow_unknown</TT> as an item in your host list, for example:
5071
5072 </P>
5073 <PRE>
5074          host_reject = +allow_unknown : *.def.zz : *.stu.yy</PRE>
5075 <P>
5076        This will allow any host without reverse DNS to bypass the checks. Note
5077        that it means that the owner of <B>abc.def.zz</B> (for example) can trivially
5078        get round your block simply by deleting the PTR record for <B>abc.def.zz.</B>
5079        If you use +warn_unknown instead of <TT>+allow_unknown</TT>, the action is the
5080        same, but every time the exception is invoked, it is logged.
5081
5082 </P>
5083 <A NAME="SEC201" HREF="FAQ.html#TOC201">Q0810</A>: Is there a way to prevent lookups in the RBL for local hosts?
5084
5085
5086 <P>
5087 A0810: Check out the <TT>rbl_hosts</TT> option.
5088
5089 </P>
5090 <A NAME="SEC202" HREF="FAQ.html#TOC202">Q0811</A>: How can I set up the <TT>sender_reject</TT> option in my config file so I can
5091        reject mail by matching regular expressions?
5092
5093
5094 <P>
5095 A0811: You must either put the regular expressions directly in the option
5096        setting, or in a file that is referenced by a plain file name, or use
5097        an @@ type of search. If the regular expressions match the domain as
5098        well as the local part, then the first two approaches are the only
5099        possible ones. For example:
5100
5101 </P>
5102 <PRE>
5103          sender_reject_recipients = ^.*\.spam\.com$ : ^.*@[0-9]+\.com$</PRE>
5104 <P>
5105        or
5106
5107 </P>
5108 <PRE>
5109          sender_reject_recipients = /some/file</PRE>
5110 <P>
5111        Each line of the file is treated as if it were an entry in the list, and
5112        must begin with ^ if it is a regular expression. No keys are involved
5113        because this is not a lookup,
5114
5115 </P>
5116 <P>
5117        If you are using version 2.10 or later, the first of those regular
5118        expressions can be rewritten to execute much more efficiently by
5119        using lookbehinds and once-only subpatterns:
5120
5121 </P>
5122 <PRE>
5123          sender_reject_recipients = ^(?&#62;.*$)(?&#60;=\.spam\.com)</PRE>
5124 <P>
5125        See the manual section entitled "Address lists" for a description of the
5126        @@ type of split domain/local part lookup. See also 
5127         <A HREF="FAQ.html#SEC192">Q0801</A>.
5128
5129 </P>
5130 <A NAME="SEC203" HREF="FAQ.html#TOC203">Q0812</A>: Normally <TT>sender_reject_recipients</TT> works fine, but addresses that have
5131        some uppercase letters in them seem to come through.
5132
5133
5134 <P>
5135 A0812: This should no longer be the case from release 3.00 onwards. Although
5136        host and domain names are case-insensitive, the RFCs about mail specify
5137        that local parts are case sensitive. When earlier versions of Exim
5138        looked up a sender address in <TT>sender_reject_recipients</TT>, they did so
5139        using the caseful form, in order to be compliant with the mail RFCs.
5140        (In principle, <B>user@domain</B> and <B>USER@domain</B> might be different
5141        people. Silly, I know, but that's the rule. It has caused a lot of
5142        grief.) However, RFC 2305 (Anti-Spam Recommendations for SMTP MTAs)
5143        recommends that address checking in blocking lists should be done
5144        caselessly, so Exim now does this by default.
5145
5146 </P>
5147 <A NAME="SEC204" HREF="FAQ.html#TOC204">Q0813</A>: I want to accept some sender addresses, even though they do not verify.
5148        There doesn't seem to be an option for verification exceptions, so how
5149        can I do this?
5150
5151
5152 <P>
5153 A0813: Set up a special director or router to ensure that those addresses do
5154        verify, using <TT>verify_only</TT> and <TT>verify_sender</TT> so that it is not used
5155        during delivery or recipient verification. For example, here is a router
5156        which verifies the address <B><B>root@somedomain.com</B>:</B>
5157
5158 </P>
5159 <PRE>
5160          verify_exceptions:
5161            driver = domainlist
5162            verify_only
5163            verify_sender
5164            domains = some.domain.com
5165            local_parts = root
5166            route_list = *</PRE>
5167 <A NAME="SEC205" HREF="FAQ.html#TOC205">Q0814</A>: We are being plagued by forged mail coming from a number of different
5168        hosts and sender addresses. The guy however leaves a fingerprint. The
5169        first received line always contains 'Received: from baby'. What is the
5170        best suggested way for eliminiating him from our systems?
5171
5172
5173 <P>
5174 A0814: You cannot, unfortunately, prevent the message from getting into your
5175        system, because the message has to be read before you can inspect the
5176        Received: header. The best you can do is to install a system filter
5177        which junks any message containing such a header. Thus the sender still
5178        wastes bandwidth and your resources in transporting the message to you,
5179        but you just throw it away. A simple system filter that does this is
5180
5181 </P>
5182 <PRE>
5183          # Exim filter
5184          if $h_Received: contains "from baby" then seen finish endif</PRE>
5185 <A NAME="SEC206" HREF="FAQ.html#TOC206">Q0815</A>: I have set <TT>host_accept_relay</TT>, but my host still refuses to relay from
5186        matching hosts.
5187
5188
5189 <P>
5190 A0815: (A) Did you remember to HUP or restart the Exim daemon after changing
5191            the configuration? You can get information as to what options Exim
5192            is checking by using the <B>-bh</B> option to test how it would handle mail
5193            from a specific host.
5194
5195 </P>
5196 <P>
5197        (B) Have you used any wild-card host names in <TT>host_accept_relay</TT>? <B>E.g:</B>
5198
5199 </P>
5200 <PRE>
5201              host_accept_relay = *.aaa.bbb</PRE>
5202 <P>
5203            If so, the problem may be that the relevant hosts do not have
5204            reverse DNS entries for their IP addresses. In order to match a wild
5205            card name, Exim has to look up the calling host's name from its IP
5206            address, and if it cannot do so, it takes a hard line by default.
5207            Exim processes lists from left to right, and so will attempt a
5208            reverse DNS lookup at the first wild-carded entry it reaches. If you
5209            have IP addresses in your list, it is best to put them first for
5210            this reason. Suppose you had
5211
5212 </P>
5213 <PRE>
5214              host_accept_relay = *.x.y : 10.9.8.7</PRE>
5215 <P>
5216            Then when the host 10.9.8.7 connects, a reverse lookup will still
5217            be done, because the first check is against <B>*.x.y.</B> If the lookup
5218            fails, relaying is rejected. However, if the list were in the
5219            opposite order, the IP check would succeed, and no DNS lookup would
5220            be done. See also 
5221         <A HREF="FAQ.html#SEC200">Q0809</A>.
5222
5223 </P>
5224 <A NAME="SEC207" HREF="FAQ.html#TOC207">Q0816</A>: How can I run customized verification checks on incoming addresses?
5225
5226
5227 <P>
5228 A0816: If you can implement your checks in Perl, then you can use Exim's
5229        facility for running an embedded Perl interpreter. For example, if you
5230        want to run special checks on local addresses, you could install this as
5231        your first director:
5232
5233 </P>
5234 <PRE>
5235          private_verify:
5236            driver = smartuser
5237            condition = ${perl{verify}{$local_part}{$domain}}
5238            verify_only</PRE>
5239 <P>
5240        If you want this to be the only means of verification, you can set
5241        <TT>no_verify</TT> on all the other directors. Otherwise, if this director fails
5242        to verify, the address gets passed on to those that follow.
5243
5244 </P>
5245 <P>
5246        The <TT>verify_sender</TT> and <TT>verify_recipient</TT> options can be used to restrict
5247        the director to sender or recipient verification only, and if necessary
5248        you could have two different directors, one for senders and one for
5249        recipients.
5250
5251 </P>
5252 <P>
5253        If the result of the expansion of <TT>condition</TT> is not "no", "false" or
5254        "0", then address verification succeeds, because the director itself
5255        matches any address. The expansion of <TT>condition</TT> causes the Perl
5256        subroutine called "verify" to be run, with two arguments, the local part
5257        and the domain. The subroutine must be provided in Perl code that is
5258        referenced by the <TT>perl_startup</TT> option. See the chapter on embedded Perl
5259        for details.
5260
5261 </P>
5262 <P>
5263        Remote addresses can be handled in a similar way by using a <B>domainlist</B>
5264        router that matches all domains. See also 
5265         <A HREF="FAQ.html#SEC204">Q0813</A>.
5266
5267 </P>
5268 <P>
5269        Starting up a Perl interpreter is not cheap. On a busy system you should
5270        first make sure that there isn't some way of using Exim's own facilities
5271        for doing what you want before going down this road.
5272
5273 </P>
5274 <A NAME="SEC208" HREF="FAQ.html#TOC208">Q0817</A>: Does Exim apply RBL checks to error messages, those with an envelope
5275        sender of "&#60;&#62;" ?
5276
5277
5278 <P>
5279 A0817: Yes, it does, because the RBL check happens immediately on connection,
5280        before any commands are passed, and so therefore before it even knows
5281        that the envelope sender is "&#60;&#62;".
5282
5283 </P>
5284 <A NAME="SEC209" HREF="FAQ.html#TOC209">Q0818</A>: I want to be able to set up a list, similar to <TT>sender_reject_recipients</TT>,
5285        but with a user-defined message. I believe I have to use a director for
5286        this.
5287
5288
5289 <P>
5290 A0818: You can do this using the <TT>prohibition_message</TT> mechanism (see the section
5291        entitled "Customizing prohibition messages" in the manual). This avoids
5292        having to use a director, and therefore doesn't require you to let the
5293        message into your host at all. Use something like this:
5294
5295 </P>
5296 <PRE>
5297          prohibition_message = "\
5298            ${if eq {$prohibition_reason}{sender_reject_recipients}\
5299            {${lookup{$sender_address}lsearch{/some/file}{$value}}}{}}"</PRE>
5300 <P>
5301        This example looks up a message that is specific to the sender, but you
5302        can of course tailor the message any way you like. Vertical bar is
5303        treated as a line separator in prohibition texts.
5304
5305 </P>
5306 <A NAME="SEC210" HREF="FAQ.html#TOC210">Q0819</A>: I want to reject certain sender-recipient combinations, with a specific
5307        message for each such combination.
5308
5309
5310 <P>
5311 A0819: That needs a special director, using the "senders" option to predicate
5312        it on the sender, and a file of recipients to fail for each sender.
5313        Something like this:
5314
5315 </P>
5316 <PRE>
5317          forced_fail:
5318            driver = aliasfile
5319            senders = sender@domain.com : *@otherdomain.com
5320            file = /blocked/${lc:$sender_address}
5321            search_type = lsearch</PRE>
5322 <P>
5323        with the files containing lines like
5324
5325 </P>
5326 <PRE>
5327          recipient:  :fail:  message</PRE>
5328 <P>
5329        If you are handling multiple local domains, you may want to set
5330        <TT>include_domain</TT> so you can specify fully qualified addresses in the
5331        files. If the files get big, an indexed search type such as DBM or cdb
5332        should be used.
5333
5334 </P>
5335 <P>
5336        If you want to block an entire domain from a specific sender, you could
5337        use this director:
5338
5339 </P>
5340 <PRE>
5341          domain_block:
5342            driver = aliasfile
5343            senders = dislikedsender@wherever
5344            file = /fail/all
5345            search_type = lsearch*</PRE>
5346 <P>
5347        with the file containing
5348
5349 </P>
5350 <PRE>
5351          *:   :fail:   message</PRE>
5352 <P>
5353        The message text supplied after :fail: is restricted to a single line.
5354        If you want to send several paragraphs of message, instead of using
5355        :fail: you could use the <B>aliasfile</B> to pipe the message off so some
5356        script which generates a long message and then gives a non-zero return
5357        code so that the message gets returned to the sender.
5358
5359 </P>
5360 <P>
5361        In all of these cases you are in trouble if the sender address is bad,
5362        because the bounce message you generate will get stuck.
5363
5364 </P>
5365 <A NAME="SEC211" HREF="FAQ.html#TOC211">Q0820</A>: Will Exim allow me to create a file of regexs and match incoming
5366        external email to the list - and if a match is found file the offending
5367        message into a special location? Also is it possible to make exim only
5368        filter parts of an incoming email - e.g. ignore large MIME attachments
5369        for example and only process text/plain?
5370
5371
5372 <P>
5373 A0820: You can do some of this in a system filter. For example:
5374
5375 </P>
5376 <PRE>
5377          if $message_body matches &#60;...some complicated regex...&#62; or
5378             $message_body matches &#60;...some other regex...&#62; or
5379             $header_from: matches &#60;...regex...&#62; or
5380             etc.
5381          then
5382            save /some/special/file
5383          endif</PRE>
5384 <P>
5385        or instead of "save" you could have "deliver" (to some address) or
5386        "pipe" (to some script).
5387
5388 </P>
5389 <P>
5390        There isn't any mechanism for ignoring attachments, but <B>$message_body</B>
5391        only looks at the first n bytes of the body, where n defaults to 500 but
5392        can be changed.
5393
5394 </P>
5395 <P>
5396        A more expensive alternative would be to run a Perl subroutine using the
5397        embedded Perl mechanism. If you passed over the message id, the Perl
5398        code could read the message files on the spool and implement any
5399        algorithm it liked for deciding what should be done.
5400
5401 </P>
5402 <A NAME="SEC212" HREF="FAQ.html#TOC212">Q0821</A>: I've hacked sendmail to make an ioctl call at the time of the SMTP RCPT
5403        command, to check if a user has exceeded their email quota. If they have
5404        I issue a temporary failure and a message - can I do this with Exim?
5405
5406
5407 <P>
5408 A0821: This could be done by arranging for a quota check to happen during the
5409        verification of the address after RCPT, but without hacking Exim you
5410        would have to use the embedded Perl facility to get it to run a Perl
5411        script to do the test.
5412
5413 </P>
5414 <P>
5415        If the reason you want to do this is to avoid having messages for over-
5416        quota users sitting on your spool for many days, there is an
5417        alternative. In Exim you can set up special retry rules for quota
5418        excession (what we use is "if mailbox not read for 7 days, bounce
5419        immediately, otherwise try every hour for one day, then bounce").
5420
5421 </P>
5422 <A NAME="SEC213" HREF="FAQ.html#TOC213">Q0822</A>: I'm looking for a rule to reject special unknown recipients.
5423
5424
5425 <P>
5426 A0822: If the messages in question are coming in via SMTP, you can turn on
5427        <TT>receiver_verify</TT> (if you haven't already) and arrange for these addresses
5428        not to verify. For example, if they are not in your local domains, you
5429        could use a router like this:
5430
5431 </P>
5432 <PRE>
5433          verify_check_specials:
5434            driver = domainlist
5435            condition = "\
5436              ${if eq {$local_part@$domain}{account@host.domain}{yes}{no}}"
5437            verify_only
5438            fail_verify
5439            route_list = *</PRE>
5440 <P>
5441        where of course you can extend the <TT>condition</TT> setting to use regular
5442        expressions, file lookups, Perl calls, or anything else that is
5443        available. The failure of the verification causes an error return to the
5444        SMTP RCPT command, so the messages never get into your system. For
5445        addresses in your local domains you could use a <B>smartuser</B> director in a
5446        similar fashion, but you could also use an alias file with :fail:
5447        entries.
5448
5449 </P>
5450 <P>
5451        If you are receiving such messages from the local host, then they are
5452        already in the system, and have to be failed locally as part of the
5453        delivery process. The :fail: mechanism is the simplest for local
5454        addresses. For remote addresses, one possibility would be to use a
5455        router with a <TT>condition</TT> setting to send such messages to an autoreply
5456        transport that sends back an error message to the sender. See also
5457        
5458         <A HREF="FAQ.html#SEC217">Q0826</A>.
5459
5460 </P>
5461 <A NAME="SEC214" HREF="FAQ.html#TOC214">Q0823</A>: I'd like to pass all messages through a virus-scanning system before
5462        delivery. Can Exim do this?
5463
5464
5465 <P>
5466 A0823: One way of achieving this is to deliver all messages via a pipe to a
5467        checking program that resubmits them for delivery in some private way
5468        that can be checked (e.g. on a specific SMTP port, or IP address). One
5469        possibility is to use the "received protocol" field that can be set
5470        for locally submitted mail via the <B>-oMr</B> command line option. This
5471        director sends all messages that are not from the local host and whose
5472        received protocol is not "scanned-ok" to the <TT>virus_scan</TT> transport:
5473
5474 </P>
5475 <PRE>
5476          vircheck:
5477            driver = smartuser
5478            transport = virus_scan
5479            condition = "${if or {{eq {$received_protocol}{scanned-ok}} \
5480                                  {eq {$sender_host_address}{127.0.0.1}}}\
5481                                  {0}{1}}"</PRE>
5482 <P>
5483        A similar router could be used if you want to scan messages for remote
5484        addresses. One problem is that this approach scans the message for each
5485        recipient, not just once per message.
5486
5487 </P>
5488 <P>
5489        The <TT>virus_scan</TT> transport should be set up to pipe the message to a
5490        suitable checking program or script which runs as a trusted user. This
5491        can then re-submit the message to Exim, using <B>-oMr</B> to set the received
5492        protocol to "scanned-ok", and the <B>-f</B> option to set the correct envelope
5493        sender address. WARNING: If you forget to make the resubmitting process
5494        run as a trusted user, the received protocol does not get set, and you
5495        are likely to generate a loop.
5496
5497 </P>
5498 <A NAME="SEC215" HREF="FAQ.html#TOC215">Q0824</A>: How can I accomplish this: a message sent from any host must either be
5499        sending to a domain in a list (a dbm file) or the sender's address
5500        domain must be in the list.
5501
5502
5503 <P>
5504 A0824: First of all, set
5505
5506 </P>
5507 <PRE>
5508          relay_domains = dbm;/the/dbm/file</PRE>
5509 <P>
5510        This allows relaying from any host, provided that the recipient address
5511        matches one of the domains in the list. Then set
5512
5513 </P>
5514 <PRE>
5515          host_accept_relay = *
5516          sender_address_relay = dbm;/the/dbm/file</PRE>
5517 <P>
5518        This allows relaying from any host (because of the *) to any arbitrary
5519        domain, provided that the sender's address matches a domain in the list.
5520
5521 </P>
5522 <P>
5523        WARNING: This setting makes it possible for your host to be used as an
5524        open relay by those unscrupulous enough to forge sender addresses. Your
5525        host may end up on one of the open relay blocking lists as a result.
5526
5527 </P>
5528 <A NAME="SEC216" HREF="FAQ.html#TOC216">Q0825</A>: I've set <TT>relay_domains</TT> and <TT>sender_address_relay</TT>, but if <B>user@mydomain</B>
5529        tries sending to an arbitrary domain, Exim rejects it.
5530
5531
5532 <P>
5533 A0825: The safest way to control relaying arbitrary domains is by host, not
5534        by sender address. If you are able to specify the hosts which your users
5535        use, then set <TT>host_accept_relay</TT> to match them. You can then remove the
5536        setting of <TT>sender_address_relay</TT>, unless you also want to limit relaying
5537        to specific senders.
5538
5539 </P>
5540 <P>
5541        If you want to permit relaying from specific senders on arbitrary hosts,
5542        you can set <TT>relay_match_host_or_sender</TT>. This requires that only one of
5543        the host or sender address be recognized, instead of both of them.
5544
5545 </P>
5546 <P>
5547        WARNING: This setting makes it possible for your host to be used as an
5548        open relay by those unscrupulous enough to forge sender addresses. Your
5549        host may end up on one of the open relay blocking lists as a result.
5550
5551 </P>
5552 <A NAME="SEC217" HREF="FAQ.html#TOC217">Q0826</A>: I set <TT>sender_reject_recipients</TT>, but Exim is not rejecting those
5553        recipients.
5554
5555
5556 <P>
5557 A0826: You have misunderstood the option. A setting like that rejects <EM>all</EM> the
5558        recipients of an incoming message with that <EM>sender</EM>. To reject a
5559        specific recipient in your own domain you can set up an alias like this:
5560
5561 </P>
5562 <PRE>
5563          reject-me:  :fail: mail for reject-me is not acceptable</PRE>
5564 <P>
5565        If you want to reject a recipient that is not in a local domain, one
5566        approach is to set up a router to send the address to your directors,
5567        and then use an alias file to generate a :fail: message as above.
5568        Alternatively, you can use the verification mechanism: see 
5569         <A HREF="FAQ.html#SEC213">Q0822</A>.
5570
5571 </P>
5572 <A NAME="SEC218" HREF="FAQ.html#TOC218">Q0827</A>: I can't find an option to deny "RCPT TO:" addresses.
5573
5574
5575 <P>
5576 A0827: Denying RCPT TO addresses is the job of verifying. You can set up
5577        directors and routers that are run only when verifying and not when
5578        delivering. This gives you a great deal of flexibility. See 
5579         <A HREF="FAQ.html#SEC213">Q0822</A>.
5580
5581 </P>
5582 <A NAME="SEC219" HREF="FAQ.html#TOC219">Q0828</A>: My problem is that Exim replaces <B>$local_part</B> with an empty string in the
5583        system filtering. What's wrong or what did I miss?
5584
5585
5586 <P>
5587 A0828: A message may have many recipients. The system filter is run just once
5588        at the start of a delivery attempt. Consequently, it does not make sense
5589        to set <B><B>$local_part.</B></B> Which recipient should it be set to? However, you
5590        can access all the recipients from a system filter via the variable
5591        called <B><B>$recipients.</B></B>
5592
5593 </P>
5594 <A NAME="SEC220" HREF="FAQ.html#TOC220">Q0829</A>: Using <B>$recipients</B> in a system filter gives me another problem: how can
5595        I do a string lookup if <B>$recipients</B> is a list of addresses?
5596
5597
5598 <P>
5599 A0829: Check out section 25 of the filter document ("Testing a list of
5600        addresses"). If that doesn't help, you may have to resort to calling an
5601        embedded Perl interpreter - but that is expensive.
5602
5603 </P>
5604 <A NAME="SEC221" HREF="FAQ.html#TOC221">Q0830</A>: Is there a way to configure Exim to reject mail to a certain local host?
5605
5606
5607 <P>
5608 A0830: No, only to certain domains. Use a configuration like this:
5609
5610 </P>
5611 <PRE>
5612          receiver_verify
5613          local_domains = rejected.domain : &#60;other local domains&#62;</PRE>
5614 <P>
5615        with the first director as
5616
5617 </P>
5618 <PRE>
5619          reject_domains:
5620            driver = smartuser
5621            domains = rejected.domain
5622            verify_only
5623            fail_verify</PRE>
5624 <A NAME="SEC222" HREF="FAQ.html#TOC222">Q0831</A>: Exim sometimes rejects messages with bad senders after the DATA and
5625        sometimes after the MAIL command. What is the difference?
5626
5627
5628 <P>
5629 A0831: The first time Exim encounters a particular bad sender, it rejects the
5630        message after the data has been received, so that it can log the
5631        headers. If the same sender re-appears within 24 hours, Exim assumes
5632        that the remote host has (in violation of RFC 821) not interpreted the
5633        previous 550 error code correctly, so this time it rejects the MAIL
5634        command. Some hosts don't even managed to handle that, so if the same
5635        sender turns up for a third time within 24 hours, Exim accepts MAIL, but
5636        rejects every RCPT command instead.
5637
5638 </P>
5639 <A NAME="SEC223" HREF="FAQ.html#TOC223">Q0832</A>: How can I get Exim to remove attachments from messages?
5640
5641
5642 <P>
5643 A0832: (A) The cleanest way is to check for the existence of a "Content-type"
5644            header line, and route messages containing it down a pipe to some
5645            other program that strips the attachments and re-submits the message
5646            to Exim. Alternatively, a transport filter can be used to do the
5647            job, as described in C028.
5648
5649 </P>
5650 <P>
5651        (B) A somewhat more hairy way is to use embedded Perl from a system
5652            filter to truncate the message's data file directly, and then use
5653            the "headers remote" filter command to get rid of the associated
5654            headers.
5655
5656 </P>
5657 <A NAME="SEC224" HREF="FAQ.html#TOC224">Q0833</A>: I ran a relay test against my host and it failed with an address
5658        containing a %, though I don't have <TT>percent_hack_domains</TT> set. Is Exim
5659        broken? This is what the tester said:
5660
5661
5662 <PRE>
5663          Relay test 6
5664          &#62;&#62;&#62; RSET
5665          &#60;&#60;&#60; 250 Reset OK
5666          &#62;&#62;&#62; MAIL FROM:&#60;spamtest@example.com&#62;
5667          &#60;&#60;&#60; 250 &#60;spamtest@example.com&#62; is syntactically correct
5668          &#62;&#62;&#62; RCPT TO:&#60;relaytest%mail-abuse.org@example.com&#62;
5669          &#60;&#60;&#60; 250 &#60;relaytest%mail-abuse.org@example.com&#62; is syntactically correct
5670          Relay test result
5671          Uh oh, host appeared to accept a message for relay.
5672          The host may reject this message internally, however</PRE>
5673 <P>
5674 A0833: This does not prove that your host is open for relaying. Notice the
5675        wording of the last two sentences: "appeared to accept" and "may reject
5676        internally". Assuming that your Exim configuration is correct, Exim will
5677        discover that the local part <B>"relaytest%mail-abuse.org"</B> is not valid on
5678        your host, and it will bounce the message.
5679
5680 </P>
5681 <P>
5682        Why doesn't it reject the RCPT TO command? Answer: because you have not
5683        set <TT>receiver_verify</TT> in your configuration file, or you have excluded
5684        these particular sender or recipient domains from receiver verification.
5685
5686 </P>
5687 <A NAME="SEC225" HREF="FAQ.html#TOC225">Q0834</A>: How can I arrange for each user to have a file listing the only sender
5688        addresses from which she will accept mail? I want to do this so my
5689        family members don't get any spam (or other inappropriate mail).
5690
5691
5692 <P>
5693 A0834: Arrange for each user you want to control to have a file called
5694        .acceptlist, ignoring for the moment how this gets maintained. Then,
5695        turn on <TT>receiver_verify</TT> and make the following your first director:
5696
5697 </P>
5698 <PRE>
5699          verify_known_sender:
5700            driver = smartuser
5701            require_files = /home/$local_part/.acceptlist
5702            senders = ! /home/$local_part/.acceptlist
5703            new_address = :fail: Sender unknown</PRE>
5704 <P>
5705        That will stop such messages even getting into your host. (Replace
5706        <B>/home/$local_part</B> with whatever the correct path to your user's home
5707        directories is.) As written above, the accept list is interpolated into
5708        the senders list and can contain wild cards. If there are no wild cards
5709        and the lists get very long, it would be more efficient to convert them
5710        into some indexed format, e.g. cdb and use a cdb lookup.
5711
5712 </P>
5713 <P>
5714        One problem with this is that it will block bounce messages, which have
5715        empty senders. You can get round this, by changing the "senders" line to
5716
5717 </P>
5718 <PRE>
5719            senders = ! : ! /home/$local_part/.acceptlist</PRE>
5720 <P>
5721        However, this will, of course, let in spam that has a null sender. Since
5722        the "senders" option is expanded, you could perhaps include something
5723        that tested a message without a sender for being a plausible bounce
5724        message before including the null sender in the list. Another approach
5725        would be to use a <TT>condition</TT> option to do various tests, including
5726        looking up <B>$sender_address</B> in <B><B>/home/$local_part/.acceptlist</B>.</B>
5727
5728 </P>
5729 <A NAME="SEC226" HREF="FAQ.html#TOC226">Q0835</A>: I have the POP-auth-before-relay support in, but I see that Exim still
5730        does an RBL lookup before checking the POP authorisation file. How can I
5731        prevent it doing an RBL check if the caller is authorized by virtue of a
5732        recent POP authentication?
5733
5734
5735 <P>
5736 A0835: If the file containing a list of recent POP-authenticated hosts is
5737        <B>/usr/local/etc/exim/popauth</B>, say, set
5738
5739 </P>
5740 <PRE>
5741          rbl_hosts = !/usr/local/etc/exim/popauth</PRE>
5742 <P>
5743        so that hosts in the list are exempted from RBL checking.
5744
5745 </P>
5746 <A NAME="SEC227" HREF="FAQ.html#TOC227">Q0836</A>: When using Nessus on a system that runs exim, a number of security
5747        issues are raised. Nessus complains that exim answers to EXPN and/or
5748        VRFY; sometimes it even complains that exim allows relaying.
5749
5750
5751 <P>
5752 A0836: Exim supports EXPN only if you permit it to do so by setting
5753        <TT>smtp_expn_hosts</TT>. Likewise, it supports to VRFY only if you set
5754        <TT>smtp_verify</TT>. Without these settings, its responses are
5755
5756 </P>
5757 <PRE>
5758          550 EXPN not available
5759          252 VRFY not available</PRE>
5760 <P>
5761        Maybe the use of 252 is the "problem". It is recommended that this be
5762        done (by those that discuss these things) because there are stupid
5763        clients that attempt VRFY before sending a message.
5764
5765 </P>
5766 <A NAME="SEC228" HREF="FAQ.html#TOC228">Q0837</A>: Could anyone points me to right rules to prevent sending/receiving
5767        messages to/for domains which have one MX to localhost or only have
5768        address 127.0.0.1 ?
5769
5770
5771 <P>
5772 A0837: You need to turn on <TT>sender_verify</TT>. With the default configuration, this
5773        will result in a temporary verification failure for these domains. You
5774        can make this into a permanent failure by adding
5775
5776 </P>
5777 <PRE>
5778          self = fail</PRE>
5779 <P>
5780        to your <B>lookuphost</B> router. The default action on encountering a routing
5781        to the local host is to defer, and freeze the message if it is a
5782        delivery address. Making this change applies to any routing to the local
5783        host, not just to 127.0.0.1.
5784
5785 </P>
5786 <P>
5787        If you are running Exim release 3.16 or later, an alternative approach
5788        is to set <TT>ignore_target_hosts</TT> = 127.0.0.1 on the relevant routers.
5789
5790 </P>
5791 <A NAME="SEC229" HREF="FAQ.html#TOC229">Q0838</A>: How can I lock out domains that do not have any MX records?
5792
5793
5794 <P>
5795 A0838: You can do this by means of the <TT>mx_domains</TT> option, but you should NOT do
5796        this for Internet domains in general. There are still a large number of
5797        legitimate domains that do not have MX records.
5798
5799 </P>
5800 <A NAME="SEC230" HREF="FAQ.html#TOC230">Q0839</A>: I would like to have a per-user limit for the maximum size of messages
5801        that can be sent.
5802
5803
5804 <P>
5805 A0839: The simplest way to do this is to put something in a system filter along
5806        these lines:
5807
5808 </P>
5809 <PRE>
5810        if $message_size is above
5811          "${lookup{$sender_address}lsearch{/some/file}{$value}{10M}}"
5812        then
5813          fail "Message is larger than $sender_address is allowed to send"
5814        endif</PRE>
5815 <A NAME="SEC231" HREF="FAQ.html#TOC231">Q0840</A>: I have set up a DBM (or cdb, or lsearch, or MySQL or whatever) file
5816        containing a list of IP addresses for the hosts I want to allow to
5817        relay, but when I set <TT>host_accept_relay</TT> to do a lookup on that data, it
5818        doesn't work.
5819
5820
5821 <P>
5822 A0840: If you include any kind of lookup in a host list, it will by default
5823        search on the host <EM>name</EM>, not on the IP address. What you want is
5824        something like
5825
5826 </P>
5827 <PRE>
5828          host_accept_relay = net-dbm;/some/file</PRE>
5829 <P>
5830        The prefix net- makes it look up the IP address instead of the name. You
5831        can also look up IP networks by using entries like
5832
5833 </P>
5834 <PRE>
5835          host_accept_relay = net24-dbm;/some/file</PRE>
5836 <P>
5837        For a host with IP address 192.168.45.23 this would do the lookup using
5838        the key "192.168.45.0/24".
5839
5840 </P>
5841 <BR><H2><A NAME="SEC232" HREF="FAQ.html#TOC232">9. MAJORDOMO
5842
5843 </A></H2>
5844 <A NAME="SEC233" HREF="FAQ.html#TOC233">Q0901</A>: How do I set up Majordomo to work with Exim?
5845
5846
5847 <P>
5848 A0901: Users have found several ways of setting up Exim for use with Majordomo.
5849        There's a web page at
5850
5851 </P>
5852 <PRE>
5853          <A HREF="http://www.netmaster.ca/exim/majordomo.html">http://www.netmaster.ca/exim/majordomo.html</A></PRE>
5854 <P>
5855        which shows one way to do it, and discusses some of the issues. The
5856        sample configuration C018 is another approach which automates a lot of
5857        the functions based on whether the files or directories exist. Only
5858        three aliases per list are needed.
5859
5860 </P>
5861 <P>
5862        Somewhere in the Majordomo docs or FAQ it mentions using batchmail or
5863        other additional programs to improve the performance of large lists.
5864        They are not needed with Exim, and their use can actually make things
5865        worse. However, it's a good idea to set <TT>remote_max_parallel</TT> to a value
5866        greater than 1 in the Exim configuration.
5867
5868 </P>
5869 <A NAME="SEC234" HREF="FAQ.html#TOC234">Q0902</A>: I have set <B>$mailer</B> in <B>majordomo.cf,</B> but it still isn't setting the
5870        sender correctly in the messages it sends.
5871
5872
5873 <P>
5874 A0902: Make sure you have got the quoting correct in the <B>$mailer</B> setting. For
5875        example,
5876
5877 </P>
5878 <PRE>
5879          $mailer = "$sendmail_command -oi -oee -f$sender\@lists.mydomain.de";</PRE>
5880 <P>
5881        is not correct. It needs three backslashes, not one, and the $ at the
5882        start of <B>$sender</B> has to be escaped with a backslash.
5883
5884 </P>
5885 <A NAME="SEC235" HREF="FAQ.html#TOC235">Q0903</A>: I'm trying to set up majordomo, but I'm getting a "wrong mode" error
5886        when I try to send it mail. The panic log entry reads:
5887
5888
5889 <PRE>
5890          1999-01-05 11:23:34 0zxZGY-0000vB-00 majordomo_aliases director:
5891          /var/lib/majordomo/lists/lists.aliases (lsearch lookup): wrong mode</PRE>
5892 <P>
5893 A0903: Check the mode of <B><B>/var/lib/majordomo/lists/lists.aliases</B></B> and compare it
5894        with the setting of the modemask option in the <TT>majordomo_aliases</TT>
5895        director. This option specifies bits which must not be set for the alias
5896        file, and it defaults to 022.
5897
5898 </P>
5899 <A NAME="SEC236" HREF="FAQ.html#TOC236">Q0904</A>: I'm getting return code 9 from <B><B>/home/majordomo/majordomo-1.94.4/wrapper</B></B>
5900        when it is passed a message from Exim.
5901
5902
5903 <P>
5904 A0904: A problem like this turned out to be the Perl version that came with
5905        RedHat 5.2. Rebuilding Perl 5.005x solved it.
5906
5907 </P>
5908 <A NAME="SEC237" HREF="FAQ.html#TOC237">Q0905</A>: Exim is complaining about an invalid command line when Majordomo tries
5909        to send it a message for delivery.
5910
5911
5912 <P>
5913 A0905: Take a look at your <B>majordomo.cf</B> file,  It should have something that
5914        looks like
5915
5916 </P>
5917 <PRE>
5918          $sendmail_command = "/usr/lib/sendmail";</PRE>
5919 <P>
5920        and another line like
5921
5922 </P>
5923 <PRE>
5924          $mailer = "$sendmail_command -oi -oee -f\$sender";</PRE>
5925 <P>
5926        If you have modified resend (one of the majordomo programs) to use
5927        <B>$sendmail_command</B> instead of <B>$mailer</B> you will be calling Exim with no
5928        command line arguments.
5929
5930 </P>
5931 <BR><H2><A NAME="SEC238" HREF="FAQ.html#TOC238">10. REWRITING ADDRESSES
5932
5933 </A></H2>
5934 <A NAME="SEC239" HREF="FAQ.html#TOC239">Q1001</A>: How can I get Exim to strip the hostname from the sender's address?
5935
5936
5937 <P>
5938 A1001: If you set up a rewriting rule in the following form:
5939
5940 </P>
5941 <PRE>
5942           *@*.your.domain  $1@your.domain</PRE>
5943 <P>
5944        then Exim will rewrite all addresses in the envelope and the headers,
5945        removing anything between "@" and <B>"your.domain".</B> This applies to all
5946        messages that Exim processes. If you want to rewrite sender addresses
5947        only, the the rule should be
5948
5949 </P>
5950 <PRE>
5951           *@*.your.domain  $1@your.domain  Ffrs</PRE>
5952 <P>
5953        This applies the rule only to the envelope "From" address and to the
5954        From:, Reply-to:, and Sender: headers.
5955
5956 </P>
5957 <A NAME="SEC240" HREF="FAQ.html#TOC240">Q1002</A>: I have Exim configured to remove the hostname portion of the domain on
5958        outgoing mail, and yet the hostname is present when the mail gets
5959        delivered.
5960
5961
5962 <P>
5963 A1002: Check the DNS record for your domain. If the MX record points to a CNAME
5964        record instead of to an A record, MTAs are liable to rewrite addresses,
5965        changing your domain name to its "canonical" form, as obtained from the
5966        CNAME record.
5967
5968 </P>
5969 <A NAME="SEC241" HREF="FAQ.html#TOC241">Q1003</A>: I want to rewrite local addresses in mail that goes to the outside
5970        world, but not for messages that remain within the local intranet.
5971
5972
5973 <P>
5974 A1003: Exim wasn't really designed to handle this kind of split world, and
5975        doing this is not entirely straightforward.
5976
5977 </P>
5978 <P>
5979        (A) If you are running version 3.20 or later, you can use the
5980        <TT>headers_rewrite</TT> option on a transport. This will apply to just those
5981        copies of a message that pass through the transport. The <TT>return_path</TT>
5982        option can similarly be used to rewrite the sender address, but there is
5983        no way of rewriting recipient addresses at transport time. However, as
5984        these are by definition remote addresses, you probably don't want to
5985        rewrite them.
5986
5987 </P>
5988 <P>
5989        You have to set up the configuration so that it uses different SMTP
5990        transports for internal and external mail. Typically this would be done
5991        by setting the <TT>domains</TT> option on a router for handling your internal
5992        domains. However, if all domains are routed in the same way (for
5993        example, using a DNS lookup), another approach is to use a string
5994        expansion for the transport name. For example:
5995
5996 </P>
5997 <PRE>
5998        lookuphost:
5999          driver = lookuphost
6000          transport = ${if match{$domain}{\\.my\\.domain\$}{int_smtp}{ext_smtp}}</PRE>
6001 <P>
6002        This example uses the <TT>int_smtp</TT> transport for domains ending in
6003        .<B>my.domain,</B> and <TT>ext_smtp</TT> for everything else. The <TT>ext_smtp</TT> transport
6004        could be something like this:
6005
6006 </P>
6007 <PRE>
6008        ext_smtp:
6009          driver = smtp
6010          headers_rewrite = *@*.my.domain \
6011               ${lookup{$1}cdb{/etc/$2/mail.handles.cdb}{$value}fail}
6012          return_path = \
6013            ${if match{$return_path}{^([^@]+)@(.*)\\.my\\.domain\$}\
6014             {\
6015             ${lookup{$1}cdb{/etc/$2/mail.handles.cdb}{$value}fail}\
6016             }\
6017             fail}</PRE>
6018 <P>
6019        This example uses a separate file of local-to-external address
6020        translations for each domain. This is not the only possibility, of
6021        course. The <TT>headers_rewrite</TT> and <TT>return_path</TT> options apply the same
6022        rewriting to the header lines and the envelope sender address,
6023        respectively.
6024
6025 </P>
6026 <P>
6027        (B) If you are running a version of Exim that is earlier than 3.20,
6028        doing this kind of rewriting is very much more difficult. Until the
6029        <TT>headers_rewrite</TT> option was added, all header rewriting was done at the
6030        time a message was received. A standard configuration cannot handle
6031        rewriting that is specific to certain recipients only.
6032
6033 </P>
6034 <P>
6035        The simplest thing to do is to upgrade to the latest current Exim
6036        release. For those that cannot do that, this old information from the
6037        <B>pre-3.20</B> FAQ is retained:
6038
6039 </P>
6040 <P>
6041        The trick is to split off a copy of the message to be sent to all
6042        external recipients, and do the rewriting on that. This can be achieved
6043        by running two differently-configured versions of Exim, either on a
6044        single host, or on two different hosts. If you have a gateway or
6045        firewall machine, that is the natural place to run the rewriting
6046        version.
6047
6048 </P>
6049 <P>
6050        On a single machine, the following is one way of handling this:
6051
6052 </P>
6053 <P>
6054        (1) Set up the normal configuration (in the configuration file whose
6055            name is screwed into the binary) such that it does local deliveries
6056            as required, but forwards a copy of the message for non-local
6057            recipients to a different incarnation of Exim via a private SMTP
6058            port. For example, use this transport and router:
6059
6060 </P>
6061 <PRE>
6062              # Transport to send SMTP using port 26
6063              internal_smtp:
6064                driver = smtp
6065                service = 26</PRE>
6066 <PRE>
6067              # Router to send everything the internal_smtp transport
6068              pass_remotes:
6069                driver = domainlist
6070                transport = internal_smtp
6071                route_list = * localhost byname
6072                self = send</PRE>
6073 <P>
6074            This should be the only router. Because of the <TT>self = send</TT>
6075            setting, Exim will transport the messages, even though it knows it
6076            is going to the local host.
6077
6078 </P>
6079 <P>
6080        (2) Set up a different configuration file for the rewriting version of
6081            Exim. This need do no local deliveries, so it needs no local
6082            domains or directors, and as it accepts mail only from the local
6083            host, there is no need for any spam-blocking or other policy
6084            controls. However, it does need to have its own spool area. The main
6085            part of the configuration could be like this:
6086
6087 </P>
6088 <PRE>
6089              local_domains =
6090              local_interfaces = 127.0.0.1
6091              host_reject = !127.0.0.1
6092              spool_directory = /var/spool/exim-external
6093              end</PRE>
6094 <P>
6095            Note the use of a negated item for <TT>host_reject</TT>, causing rejection of
6096            SMTP calls from all but the local host.
6097
6098 </P>
6099 <P>
6100            The directors section can be completely empty (apart from the line
6101            saying "end"), while the routers section should be as in a normal
6102            configuration, as it is going to control external delivery.
6103
6104 </P>
6105 <P>
6106            The rule(s) for rewriting your internal addresses into external ones
6107            should be in this configuration. This is one example of what might
6108            be done:
6109
6110 </P>
6111 <PRE>
6112            *@*.your.domain  "\
6113               ${lookup{$1}cdb{/etc/$2/mail.handles.cdb}{$value}fail}"</PRE>
6114 <P>
6115            which looks up each local part in a per-host file to obtain the
6116            externally-visible address, including (in this example) the domain.
6117
6118 </P>
6119 <P>
6120        (3) You have to arrange for a daemon to be listening on port 26, and to
6121            be using the alternate configuration file. It is necessary to do
6122            this as root so that Exim retains its privilege after reading a
6123            non-standard configuration. A command such as
6124
6125 </P>
6126 <PRE>
6127              exim -C /etc/exim-configure2 -bd -oX 26</PRE>
6128 <P>
6129            could be used in a suitable system start-up file. Alternatively you
6130            could set up <B>inetd</B> to run Exim with the <B>-C</B> option for incoming
6131            connections on port 26.
6132
6133 </P>
6134 <P>
6135        The net result of all of this is that when a message has one or more
6136        external recipients, a copy of it is sent via port 26 to the second
6137        version of Exim, which rewrites any internal addresses and does the
6138        external deliveries. The cost of this is that the message has to be
6139        copied and spooled twice, and you have two different Exim queues to
6140        manage. Note that if the "external" Exim has to send a delivery failure
6141        message, it will use the rewritten sender address.
6142
6143 </P>
6144 <A NAME="SEC242" HREF="FAQ.html#TOC242">Q1004</A>: I'm using this rewriting rule to change login names into "friendly"
6145        names, but if mail comes in for an upper case login name, it doesn't
6146        get rewritten.
6147
6148
6149 <PRE>
6150          *@my.domain     ${lookup{$1}dbm{/usr/lib/exim/longforms}\
6151                          {$value}fail}@my.domain bcfrtFT</PRE>
6152 <P>
6153        The longforms database has entries of the form:
6154
6155 </P>
6156 <PRE>
6157          ano23: A.N.Other</PRE>
6158 <P>
6159 A1004: Replace <B>$1</B> in your rule by <B>${lc:$1}</B> to force the local part to lower
6160        case before it is used as a lookup key.
6161
6162 </P>
6163 <A NAME="SEC243" HREF="FAQ.html#TOC243">Q1005</A>: Is it possible to completely fail a message if the rewrite rules fail?
6164
6165
6166 <P>
6167 A1005: It depends on what you mean by "fail a message" and what addresses you
6168        are rewriting. If you are rewriting recipient addresses for your local
6169        domain, you can do:
6170
6171 </P>
6172 <PRE>
6173          *@dom.ain  ${lookup{$1}dbm{/wher/ever}{$value}{failaddr}}  Ehq</PRE>
6174 <P>
6175        and in your alias file put something like
6176
6177 </P>
6178 <PRE>
6179          failaddr:   :fail: Rewriting failed.</PRE>
6180 <P>
6181        This fails a single recipient - others are processed independently.
6182
6183 </P>
6184 <A NAME="SEC244" HREF="FAQ.html#TOC244">Q1006</A>: I'm using <B>$domain</B> as the key for a lookup in a rewriting rule, but its
6185        contents are not being lowercased. Aren't domains supposed to be handled
6186        caselessly?
6187
6188
6189 <P>
6190 A1006: The value of <B>$domain</B> is the actual domain that appears in the address.
6191        It could of course be lower cased, but I know that would cause some
6192        unhappiness, because some people have mixed-case domain names which look
6193        silly if the case is changed. Thus, one wants to preserve the case in
6194        rewrites such as
6195
6196 </P>
6197 <PRE>
6198          *@*.TheRap.com   &#60;something&#62;@$domain</PRE>
6199 <P>
6200        (not the best example) because "therap" doesn't look like two words. I
6201        know it seems trivial, but it is important to some people - especially
6202        if by some unfortunate accident the lowercased word is something
6203        indecent.
6204
6205 </P>
6206 <P>
6207        You can trivally force lower casing by means of the <B>${lc:</B> operator.
6208        Instead of "$domain" write "${lc:$domain}".
6209
6210 </P>
6211 <A NAME="SEC245" HREF="FAQ.html#TOC245">Q1007</A>: I want to rewrite local sender addresses depending on the domain of the
6212        recipient.
6213
6214
6215 <P>
6216 A1007: In general, this is not possible, because a message may have more than
6217        one recipient and Exim keeps just a single copy of each message. It may
6218        also deliver one copy of a message with several recipient addresses.
6219        You can do an incomplete job by using a regular expression match in a
6220        rewrite rule to test, for example, the contents of the To: header. This
6221        would work except in cases of multiple recipients. See also 
6222         <A HREF="FAQ.html#SEC241">Q1003</A>.
6223
6224 </P>
6225 <BR><H2><A NAME="SEC246" HREF="FAQ.html#TOC246">11. HEADERS
6226
6227 </A></H2>
6228 <A NAME="SEC247" HREF="FAQ.html#TOC247">Q1101</A>: I would like add some custom headers to selected outgoing mail based on
6229        a specific domain and the subject line.
6230
6231
6232 <P>
6233 A1101: To the <TT>remote_smtp</TT> transport, add something like
6234
6235 </P>
6236 <PRE>
6237          headers_add = "${if and{\
6238                        {eq{$domain}{spec.dom}}\
6239                        {matches{$h_subject:}{whatever}}}\
6240                        {Content-Type: text/html; charset=\"us-ascii\"} fail }"</PRE>
6241 <P>
6242        This example shows a Content-Type header, but you can have anything you
6243        like, and multiple headers can be inserted by using \n to separate them.
6244
6245 </P>
6246 <A NAME="SEC248" HREF="FAQ.html#TOC248">Q1102</A>: Is it possible to have Exim add a header to only certain <TT>local_parts</TT> of
6247        outgoing mail?
6248
6249
6250 <P>
6251 A1102: Only if you arrange for each such local part to receive its own private
6252        copy of the mail. See <TT>max_rcpt</TT> in the SMTP transport. Then you could use
6253        conditions in an expansion string to add or not add a header.
6254
6255 </P>
6256 <A NAME="SEC249" HREF="FAQ.html#TOC249">Q1103</A>: How can I remove some part of the Received: header?
6257
6258
6259 <P>
6260 A1103: Set <TT>received_header_text</TT>.
6261
6262 </P>
6263 <A NAME="SEC250" HREF="FAQ.html#TOC250">Q1104</A>: How I can insert the PGP header line using exim filters?
6264
6265
6266 <P>
6267 A1104: You can't insert headers in a user filter. A system filter can do so,
6268        but the inserted lines then are included for all recipients.
6269
6270 </P>
6271 <A NAME="SEC251" HREF="FAQ.html#TOC251">Q1105</A>: I know I can use a system filter to replace certain headers in messages,
6272        but how can I add text to existing headers? I want to add [SPAM] to
6273        the subject line of messages that appear to be spam.
6274
6275
6276 <P>
6277 A1105: You can only do this in a round about way, using filter commands like
6278        this:
6279
6280 </P>
6281 <PRE>
6282          headers add "New-Subject: SPAM: $h_subject:"
6283          headers remove subject
6284          neaders add "Subject: $h_new-subject:"
6285          headers remove new-subject</PRE>
6286 <P>
6287        This trick works only in system filters, where the commands are obeyed
6288        in order, and affect the master list of headers that apply to the whole
6289        message. You cannot do this with the <TT>headers_add</TT> and <TT>headers_remove</TT>
6290        options on drivers.
6291
6292 </P>
6293 <BR><H2><A NAME="SEC252" HREF="FAQ.html#TOC252">12. FETCHMAIL
6294
6295 </A></H2>
6296 <A NAME="SEC253" HREF="FAQ.html#TOC253">Q1201</A>: When I run fetchmail, I get the error "SMTP listener doesn't like
6297        recipient address <B><I>xxx</I>@localhost</B>".
6298
6299
6300 <P>
6301 A1201: Put "localhost" in a list of local domains, that is, add it to the
6302        <TT>local_domains</TT> option in your Exim configuration file.
6303
6304 </P>
6305 <A NAME="SEC254" HREF="FAQ.html#TOC254">Q1202</A>: Fetchmail is passing on bounce messages to Exim with the sender address
6306        set to <B><B>&#60;@some.domain</B>&#62;</B> which causes Exim to complain, because there is no
6307        local part.
6308
6309
6310 <P>
6311 A1202: This was a fetchmail problem which has been fixed. Ideally, you should
6312        upgrade to the current fetchmail release. If you cannot do this, there
6313        is some Exim magic that might help. The 'S' rewriting flag allows
6314        rewriting of envelope addresses to be done as soon as they are received
6315        in the SMTP protocol, before any kind of checking or other processing is
6316        done. This is specifically provided for installations that have to cope
6317        with mangled addresses coming in over SMTP.
6318
6319 </P>
6320 <A NAME="SEC255" HREF="FAQ.html#TOC255">Q1203</A>: I'm currently using Exim with fetchmail and I'd like to use the RBL on
6321        Exim, but will it work? Do I need to configure fetchmail any particular
6322        way? As far as Exim knows, all mail is coming from 127.0.01. Will it
6323        check the source address against RBL? Or will it check the From: header?
6324
6325
6326 <P>
6327 A1203: It will check 127.0.0.1 (not very useful). The point of the RBL is to
6328        keep messages from black-listed hosts out of your machine. If you are
6329        using fetchmail, you have got the messages into your machine before you
6330        approach Exim. That kind of defeats the purpose of the RBL. The right
6331        way to do this would be for the host from which you fetchmail to do the
6332        RBL checking and insert some kind of warning header for you to test, as
6333        Exim does if you run RBL checks in warning mode.
6334
6335 </P>
6336 <BR><H2><A NAME="SEC256" HREF="FAQ.html#TOC256">13. PERL
6337
6338 </A></H2>
6339 <A NAME="SEC257" HREF="FAQ.html#TOC257">Q1301</A>: Exim built with Perl support exits with the error message <B>"./exim:</B> can't
6340        load library <B>'libperl.so'".</B>
6341
6342
6343 <P>
6344 A1301: If you are using BSDI, see 
6345         <A HREF="FAQ.html#SEC324">Q9401</A>.
6346
6347 </P>
6348 <A NAME="SEC258" HREF="FAQ.html#TOC258">Q1302</A>: Exim built with Perl support exits with several error messages of the
6349        form "undefined reference to `PL_stack_sp'".
6350
6351
6352 <P>
6353 A1302: This has been seen on FreeBSD systems that had two different versions of
6354        Perl installed, the older with an <B>a.out</B> library and the newer with an
6355        ELF library. Ensure that the older package is removed.
6356
6357 </P>
6358 <BR><H2><A NAME="SEC259" HREF="FAQ.html#TOC259">14. DIAL-UP
6359
6360 </A></H2>
6361 <A NAME="SEC260" HREF="FAQ.html#TOC260">Q1401</A>: How can I arrange for mail to other hosts on my local network to be
6362        delivered when I'm not connected to the Internet?
6363
6364
6365 <P>
6366 A1401: Use the <TT>queue_remote_domains</TT> option to control which domains are held
6367        on the queue for later delivery. For example,
6368
6369 </P>
6370 <PRE>
6371          queue_remote_domains = ! *.localnet</PRE>
6372 <P>
6373        allows delivery to domains ending in .localnet, while queueing all the
6374        others.
6375
6376 </P>
6377 <A NAME="SEC261" HREF="FAQ.html#TOC261">Q1402</A>: I have a dial-up machine, and I use the <TT>queue_smtp_domains</TT> option so
6378        that remote mail only goes out when I do a queue run. However, any email
6379        I send with an address <B><B>&#60;anything&#62;@aol.com</B></B> is returned within about 15
6380        minutes saying 'retry time exceeded', and all addresses are affected.
6381
6382
6383 <P>
6384 A1402: (A) You should be using <TT>queue_remote_domains</TT> rather than <TT>queue_smtp_</TT>
6385        domains. With the latter, Exim is trying to route the addresses, which
6386        involves a DNS lookup. This is presumably timing out, causing a retry
6387        time to be set for the domain, and somehow a valid lookup never happened
6388        before the maximum retry time (default of 4 days) passed. Hence the
6389        bounce. The fact that it is <B>aol.com</B> is not relevant. You should probably
6390        also be using <B>-qq</B> to do your queue run rather than <B><B>-q.</B></B>
6391
6392 </P>
6393 <P>
6394        (B) An alternative approach if you are sending all your outgoing mail to
6395        the same smart host is to use a single router like this:
6396
6397 </P>
6398 <PRE>
6399          route_append:
6400          driver = domainlist
6401          transport = remote_smtp
6402          route_list = "* smarthost.isp.net byname"</PRE>
6403 <P>
6404        and put the address of the smart host in <B>/etc/hosts</B>, so that it can be
6405        found without the need of a DNS lookup. Then you can use <TT>queue_smtp_</TT>
6406        domains so that Exim does the routing for every message, but doesn't try
6407        to deliver it. See also 
6408         <A HREF="FAQ.html#SEC262">Q1403</A>.
6409
6410 </P>
6411 <A NAME="SEC262" HREF="FAQ.html#TOC262">Q1403</A>: How should Exim be configured when it is acting as a temporary storage
6412        system for a domain on a dial-up host?
6413
6414
6415 <P>
6416 A1403: Exim isn't really designed for this, but... The lowest-numbered MX
6417        record for the domain should be pointing to your host. You should set a
6418        large retry time for that domain, so that Exim doesn't keep trying to
6419        deliver when the host is offline. When the host comes online, the
6420        waiting messages have to be kicked somehow. This can be done by calling
6421        Exim with the <B>-R</B> option, or via the SMTP ETRN command. This works
6422        provided the number of messages is low. If you are handling lots of
6423        mail, keeping messages waiting for their host to connect and those that
6424        are having delivery problems to remote hosts all in the same queue
6425        doesn't work so well. It is better in this case to get Exim to deliver
6426        the mail for the dial-in hosts into some local files which then get
6427        transmitted by other software when the host connects. See the manual
6428        chapter entitled "Intermittently connected hosts" and also 
6429         <A HREF="FAQ.html#SEC283">Q5014</A> and
6430        
6431         <A HREF="FAQ.html#SEC162">Q0521</A>.
6432
6433 </P>
6434 <A NAME="SEC263" HREF="FAQ.html#TOC263">Q1404</A>: I have <TT>queue_remote_domains</TT> or <TT>queue_smtp_domains</TT> set, and use <B>-qf</B> to
6435        force delivery of waiting mail when I dial in. How can I arrange for any
6436        new messages that arrive while I'm connected to be delivered immediately?
6437
6438
6439 <P>
6440 A1404: (A) Instead of <TT>queue_remote_domains</TT> or <TT>queue_smtp_domains</TT>, use the
6441        <TT>queue_only_file</TT> option. This causes messages to be queued only if a
6442        particular file exists. The word "remote" or "smtp" before the file name
6443        controls which type of queueing is used. For example:
6444
6445 </P>
6446 <PRE>
6447          queue_only_file = remote/etc/present/when/not/connected</PRE>
6448 <P>
6449        Then, in the scripts which are run when you connect and disconnect,
6450        arrange to remove the file after connection, and create it just before
6451        disconnection.
6452
6453 </P>
6454 <P>
6455        (B) An alternative is to set <TT>hold_domains</TT> to point to a file lookup and
6456        switch that file appropriately.
6457
6458 </P>
6459 <BR><H2><A NAME="SEC264" HREF="FAQ.html#TOC264">15. MODIFYING MESSAGE BODIES
6460
6461 </A></H2>
6462 <A NAME="SEC265" HREF="FAQ.html#TOC265">Q1501</A>: How can I add a disclaimer or an advertisement to a message?
6463
6464
6465 <P>
6466 A1501: There are a number of technical and potential legal problems that arise
6467        in connection with message modification. Some of them are listed below.
6468        If, despite these considerations, you still want to modify messages, you
6469        can do so using Exim, but not directly in Exim itself. It is not the job
6470        of an MTA to modify messages, something that requires understanding of
6471        their content and format.
6472
6473 </P>
6474 <P>
6475        Exim provides a hook in the form of a "transport filter" that lets you
6476        pass any outgoing message through a program or script of your choice. It
6477        is the job of this script to make any changes to the message that you
6478        require. By this means, you have full control over what changes are
6479        made, and Exim does not need to know anything about message bodies.
6480        However, using a transport filter requires additional resources, and may
6481        slow down mail delivery.
6482
6483 </P>
6484 <P>
6485        You can use Exim's directors and routers to arrange for those messages
6486        that you want to modify to be delivered via a transport filter. For
6487        example, suppose you want to do this for messages from addresses in
6488        your domain that are being delivered to a remote host. Place the
6489        following router before the standard <B>lookuphost</B> router:
6490
6491 </P>
6492 <PRE>
6493          filter_remote:
6494            driver = lookuphost
6495            transport = remote_smtp_filter
6496            condition = ${if eq {$sender_address_domain}{your.domain}{yes}{no}}</PRE>
6497 <P>
6498        This routes the relevant addresses to a transport called
6499        <TT>remote_smtp_filter</TT>. Other addresses fall through to the normal router,
6500        and are routed to the standard <TT>remote_smtp</TT> transport. Another way to do
6501        this would be to use a single router, with an expanded string for the
6502        transport setting. The new transport is defined thus:
6503
6504 </P>
6505 <PRE>
6506          remote_smtp_filter:
6507            driver = smtp
6508            transport_filter = /your/filter/command</PRE>
6509 <P>
6510        The entire message is passed to your filter command on its standard
6511        input. It must write the modified version to the standard output, taking
6512        care not to break the RFC 822 syntax. The command is run as the Exim
6513        user, if one is defined; otherwise it is run as root.
6514
6515 </P>
6516 <P>
6517        There are a number of potential problems in doing this kind of
6518        modification in an MTA. Many people believe that to attempt is it wrong,
6519        because:
6520
6521 </P>
6522 <P>
6523        1. It breaks digital signatures, which are becoming legally binding
6524           in some countries (already in the UK, likely to be 1 October 2000 in
6525           the USA). It may well also break encryption.
6526
6527 </P>
6528 <P>
6529        2. It is likely to break MIME encoding, that is, it is likely to wreck
6530           attachments, unless great care is taken. And what about the case of a
6531           message containing only binary MIME parts?
6532
6533 </P>
6534 <P>
6535        3. It is illegal under German and Dutch law to change the body of
6536           a mail message in transit. It might potentially be illegal in
6537           the UK under European law. This consideration applies to ISPs and
6538           other "common carriers". It would presumably not apply in a corporate
6539           environment where modification was done only to messages originating
6540           from the employees, before they left the company's network. It might
6541           also not apply if the senders have explicitly given their consent
6542           (e.g. agreed to have advertisements added to their incoming mail).
6543
6544 </P>
6545 <P>
6546        4. Since the delivered message body was produced by the MTA (not the
6547           originator, because it was modified), the MTA operator could
6548           potentially be sued for any content. This again applies to "common
6549           carrier" MTAs. It's interesting that adding a disclaimer of liability
6550           could be making you liable for the message, but this case seems
6551           more likely to involve adding advertisements than disclaimers. After
6552           all, no postal service in the world opens all the mail it carries to
6553           add disclaimers.
6554
6555 </P>
6556 <P>
6557        5. Some mail clients (old versions of MS outlook) crash if the message
6558           body of an incoming MIME message has been tampered with.
6559
6560 </P>
6561 <P>
6562        There are also potential problems that could arise if a scheme to add
6563        disclaimers goes wrong for some messages:
6564
6565 </P>
6566 <P>
6567        1. False negatives: "Ah, this guy usually says he does not represent
6568           their views, but in this message he doesn't have the disclaimer".
6569
6570 </P>
6571 <P>
6572        2. False positives: "This official announcement does not represent our
6573           views, oh no".
6574
6575 </P>
6576 <P>
6577        An alternative approach to the disclaimer problem would be to insist
6578        that all relevant messages have the disclaimer appended by the MUA. The
6579        MTA should refuse to accept any that do not. Again, however, the MTA
6580        must understand the format of messages in order to do this. Simply
6581        checking for appropriate wording at the end of the body is not good
6582        enough. It would probably be necessary to run a Perl script from within
6583        an Exim system filter in order to adopt this approach.
6584
6585 </P>
6586 <P>
6587        Finally, it's a trivial matter to add customized headers of the sort:
6588
6589 </P>
6590 <PRE>
6591          X-Disclaimer:  This is a standard disclaimer that says that the views
6592          X-Disclaimer:  contained within this message are somebody elses.</PRE>
6593 <P>
6594        which is a much easier alternative to modifying message bodies.
6595
6596 </P>
6597 <A NAME="SEC266" HREF="FAQ.html#TOC266">Q1502</A>: How can I remove attachments from messages?
6598
6599
6600 <P>
6601 A1502: The answer to this is essentially the same as for 
6602         <A HREF="FAQ.html#SEC265">Q1501</A>.
6603
6604 </P>
6605 <BR><H2><A NAME="SEC267" HREF="FAQ.html#TOC267">20. MILLENNIUM
6606
6607 </A></H2>
6608 <A NAME="SEC268" HREF="FAQ.html#TOC268">Q2000</A>: Are there any Y2K issues with Exim?
6609
6610
6611 <P>
6612 A2000: The author of Exim believes that it is Y2K-compliant, as long as the
6613        underlying operating system and C library are. Exim does not parse dates
6614        or times at all. Internally, it makes some use of binary timestamps in
6615        Unix format (number of seconds since 1-Jan-1970) and uses C library
6616        services to convert these to printing forms (e.g. for logging). The
6617        printing forms all use 4-digit years. Some people have tried various
6618        tests. No problems have been reported, but details of what tests have
6619        been done are not available.
6620
6621 </P>
6622 <P>
6623        Well, it's now August 2000, and no Y2K problems have been reported, so
6624        it looks like I was right.
6625
6626 </P>
6627 <BR><H2><A NAME="SEC269" HREF="FAQ.html#TOC269">50. MISCELLANEOUS
6628
6629 </A></H2>
6630 <A NAME="SEC270" HREF="FAQ.html#TOC270">Q5001</A>: What does the error "Unable to get interface configuration: 22 Invalid
6631        argument" mean?
6632
6633
6634 <P>
6635 A5001: This is an error that occurs when Exim is trying to find out the all the
6636        IP addresses on all of the local host's interfaces. If you have lots of
6637        virtual interfaces, this can occur if there are more than around 250 of
6638        them. The solution is to set the option <TT>local_interfaces</TT> to list just
6639        those IP addresses that you want to use for making and receiving SMTP
6640        connections.
6641
6642 </P>
6643 <A NAME="SEC271" HREF="FAQ.html#TOC271">Q5002</A>: How can I arrange to allow a limited set of users to perform a limited
6644        set of Exim administration functions? I don't want to put them all in
6645        the exim group.
6646
6647
6648 <P>
6649 A5002: See <B><A HREF="http://www.chiark.greenend.org.uk/~ian/userv/.">http://www.chiark.greenend.org.uk/~ian/userv/.</A></B> Using userv you can
6650        arrange (for example) for certain users to be able to invoke mailq or
6651        runq or other preset commands as exim (or any other user, as configured)
6652        with only userv configuration. If you want to check the particular Exim
6653        options available you can easily do it with shell or Perl scripts and
6654        userv configuration, and provided you know how to do argument
6655        `unparsing' properly in shell or Perl it will be secure.
6656
6657 </P>
6658 <A NAME="SEC272" HREF="FAQ.html#TOC272">Q5003</A>: How can I test for a message's size being greater or less than a given
6659        value in an expansion string?
6660
6661
6662 <P>
6663 A5003: This isn't straightforward in versions of Exim prior to 2.10, because
6664        there were no arithmetic operators in expansion strings. In version
6665        2.10 or later you can write, straightforwardly,
6666
6667 </P>
6668 <PRE>
6669          ${if &#62; {$message_size}{10K} {yes} {no}}</PRE>
6670 <P>
6671        In earlier versions, low cunning can be used to achieve certain
6672        kinds of test. For example, to test if the message size is less than
6673        or equal to 1000000:
6674
6675 </P>
6676 <PRE>
6677        ${if eq{${expand:\$\{substr_-1000000_$message_size:x\}}} {} {yes} {no}}</PRE>
6678 <A NAME="SEC273" HREF="FAQ.html#TOC273">Q5004</A>: I want to "tail" the Exim log, but I have a number of other logs I also
6679        want to "tail", and the number of tailing windows is getting to be a
6680        nuisance.
6681
6682
6683 <P>
6684 A5004: Look for a program called 'xtail' (despite its name, it's not an
6685        X-windows application). It allows you to do multiple tails, even of
6686        entire directories.
6687
6688 </P>
6689 <A NAME="SEC274" HREF="FAQ.html#TOC274">Q5005</A>: I would like to have Exim log information written to syslog.
6690
6691
6692 <P>
6693 A5005: Support for this is available from version 3.10 onwards.
6694
6695 </P>
6696 <A NAME="SEC275" HREF="FAQ.html#TOC275">Q5006</A>: What does the error "Failed to create spool file" mean?
6697
6698
6699 <P>
6700 A5006: Exim has been unable to create a file in its spool area in which to
6701        store an incoming message. This is most likely to be either a
6702        permissions problem in the file hierarchy, or a problem with the uid
6703        under which Exim is running, though it could be something more drastic
6704        such as your disc being full. Check that you have defined the spool
6705        directory correctly by running
6706
6707 </P>
6708 <PRE>
6709          exim -bP spool_directory</PRE>
6710 <P>
6711        and examining the output. Check the mode of this directory. It should
6712        look like this, assuming you are running Exim as user `exim':
6713
6714 </P>
6715 <PRE>
6716          drwxr-x---   6 exim  exim      512 Jul 16 12:29 /var/spool/exim</PRE>
6717 <P>
6718        If there are any subdirectories already in existence, they should have
6719        the same permissions, owner, and group. Check also that you haven't got
6720        incorrect permissions on superior directories (for example, <B>/var/spool</B>).
6721        Check that you have set up the exim binary to be setuid root. It should
6722        look like this:
6723
6724 </P>
6725 <PRE>
6726          -rwsr-xr-x   1 root     xxx       502780 Jul 16 14:16 exim</PRE>
6727 <P>
6728        Note that it is not just the owner that must be root, but also the third
6729        permission must be "s" rather than "x".
6730
6731 </P>
6732 <A NAME="SEC276" HREF="FAQ.html#TOC276">Q5007</A>: Exim keeps crashing with segmentation errors (signal 11 or 139).
6733
6734
6735 <P>
6736 A5007: This might be a problem with the db library. See 
6737         <A HREF="FAQ.html#SEC146">Q0505</A>.
6738
6739 </P>
6740 <A NAME="SEC277" HREF="FAQ.html#TOC277">Q5008</A>: Exim's databases keep getting corrupted.
6741
6742
6743 <P>
6744 A5008: See 
6745         <A HREF="FAQ.html#SEC146">Q0505</A>.
6746
6747 </P>
6748 <A NAME="SEC278" HREF="FAQ.html#TOC278">Q5009</A>: I've been using an autoreply director to try and mimic a bounce message,
6749        but I can't get it to have an envelope from of &#60;&#62;.
6750
6751
6752 <P>
6753 A5009: You haven't, by any chance, put "exim" in the list of <TT>never_users</TT>, have
6754        you?
6755
6756 </P>
6757 <A NAME="SEC279" HREF="FAQ.html#TOC279">Q5010</A>: I see entries in the log that mention two different IP addresses for the
6758        same connection. Why is this? For example:
6759
6760
6761 <PRE>
6762          H=tip-mp8-ncs-13.stanford.edu ([36.173.0.189]) [36.173.0.156]</PRE>
6763 <P>
6764 A5010: The actual IP address from which the call came is the final one.
6765        Whenever there's something in parentheses in a host name, it is what the
6766        host quoted as the domain part of an SMTP HELO or EHLO command. So in
6767        this case, the client, despite being 36.173.0.156, issued the command
6768
6769 </P>
6770 <PRE>
6771          HELO [36.173.0.189]</PRE>
6772 <P>
6773        when it sent your server the message. This is, of course, very
6774        misleading.
6775
6776 </P>
6777 <A NAME="SEC280" HREF="FAQ.html#TOC280">Q5011</A>: How can I persuade Exim to accept ETRN commands without the leading
6778        # character?
6779
6780
6781 <P>
6782 A5011: Set the option
6783
6784 </P>
6785 <PRE>
6786          smtp_etrn_command = /usr/lib/sendmail -R $domain</PRE>
6787 <P>
6788        This causes Exim to run that command, with <B>$domain</B> replaced by the
6789        argument of ETRN. The default action of Exim is to require the # sign
6790        in order to be RFC-compliant, and to run the equivalent of
6791
6792 </P>
6793 <PRE>
6794          smtp_etrn_command = /usr/lib/sendmail -R ${substr_1:$domain}</PRE>
6795 <P>
6796        which uses the argument without the leading # as the value for the <B>-R</B>
6797        option. You aren't restricted to running Exim with the <B>-R</B> option, of
6798        course. You can specify any command you like, with any number of
6799        arguments. In particular, you can pass over the IP address of the caller
6800        via <B><B>$sender_host_address.</B></B> However, if you make use of expansion strings
6801        in the arguments, each one must be entirely contained in a single
6802        argument. For example, if you want to remove the first character of the
6803        ETRN argument when it is @ or #, you could use
6804
6805 </P>
6806 <PRE>
6807          smtp_etrn_command = "/usr/lib/sendmail -R \
6808            \"${if match {$domain}{^[@#]}{${substr_1:$domain}}{$domain}}\""</PRE>
6809 <P>
6810        The internal quotes are necessary because of the white space inside the
6811        expansion string.
6812
6813 </P>
6814 <P>
6815        If you use <TT>smtp_etrn_command</TT> to run something other than Exim with the
6816        <B>-R</B> option, you must disable <TT>smtp_etrn_serialize</TT>, because otherwise the
6817        serialization lock (which is set by default) never gets removed.
6818
6819 </P>
6820 <A NAME="SEC281" HREF="FAQ.html#TOC281">Q5012</A>: I've recently noticed that emails I send with a Bcc: line are being
6821        delivered to their final destination with the Bcc: line still present.
6822
6823
6824 <P>
6825 A5012: Exim removes Bcc lines only if you call it with the <B>-t</B> option (i.e.
6826        when it is acting partly as an MUA). It does not remove Bcc lines that
6827        are present in incoming SMTP mail or command-line mail that does not
6828        use <B><B>-t.</B></B> Indeed, it should not remove them. From RFC 822:
6829
6830 </P>
6831 <P>
6832          5.3.  BCC / RESENT-BCC
6833
6834 </P>
6835 <P>
6836          This field contains the identity of additional recipients of the
6837          message. The contents of this field are not included in copies of the
6838          message sent to the primary and secondary recipients. Some systems may
6839          choose to include the text of the "Bcc" field only in the author(s)'s
6840          copy, while others may also include it in the text sent to all those
6841          indicated in the "Bcc" list.
6842
6843 </P>
6844 <P>
6845        Only the initiating software (i.e. the MUA) can tell what to do with
6846        Bcc; any MTA software has to leave it alone.
6847
6848 </P>
6849 <A NAME="SEC282" HREF="FAQ.html#TOC282">Q5013</A>: I used gv <B>v3.5.8</B> (ghostview) to try printing <B>spec.ps.</B> After every
6850        printed page, the printer ejects a blank sheet. Is this something to do
6851        with using "letter" rather than A4 paper?
6852
6853
6854 <P>
6855 A5013: This seems to be an effect of using ghostview. Although the PostScript
6856        is generated for A4 pages, the size of the page images is such that they
6857        should fit on a letter page (they are shorter than would normally be
6858        used on A4 paper). If the PostScript file is sent directly to a
6859        PostScript printer, there is no problem. An alternative is to get hold
6860        of the "psutils" toolset, which is available from
6861
6862 </P>
6863 <PRE>
6864          <A HREF="ftp://ftp.dcs.ed.ac.uk/pub/psutils/psutils.tar.gz">ftp://ftp.dcs.ed.ac.uk/pub/psutils/psutils.tar.gz</A></PRE>
6865 <P>
6866        It contains utilities for extracting pages (which can be useful for
6867        double-sided printing) and for resizing pages. If you resize from A4 to
6868        letter the text shrinks a bit, but should then be printable via
6869        ghostview.
6870
6871 </P>
6872 <A NAME="SEC283" HREF="FAQ.html#TOC283">Q5014</A>: I would like to have a separate queue per domain for hosts which dial
6873        in to collect their mail.
6874
6875
6876 <P>
6877 A5014: Exim isn't really designed for this kind of operation. The only way to
6878        do this would be to cause it to send those messages to a differently
6879        configured version of Exim with its own spool area. This could be done
6880        via a pipe or SMTP to a private port. The main Exim, listening on port
6881        25, would then be configured to run an appropriate command to prod one
6882        of the others when it received ETRN, by means of the <TT>etrn_command</TT> option.
6883
6884 </P>
6885 <P>
6886        You could probably manage this with a single Exim binary and a number of
6887        different configuration files, passed to the special versions using the
6888        <B>-C</B> option. For this application they could all run as exim, since no
6889        root privilege would be needed.
6890
6891 </P>
6892 <P>
6893        An alternative approach id to get Exim to deliver mail for such hosts
6894        in batch SMTP format into some directory, and have the ETRN run
6895        something to pass such messages to the dialled-in host. See also 
6896         <A HREF="FAQ.html#SEC144">Q0503</A>
6897        and 
6898         <A HREF="FAQ.html#SEC162">Q0521</A>.
6899
6900 </P>
6901 <A NAME="SEC284" HREF="FAQ.html#TOC284">Q5015</A>: A short time after I start Exim I see a &#60;defunct&#62; zombie process. What
6902        is causing this?
6903
6904
6905 <P>
6906 A5015: Your system must be lightly loaded as far as mail is concerned. The
6907        daemon sets off a queue runner process when it is started, but it only
6908        tidies up completed child processes when it wakes up for some other
6909        reason. When there's nothing much going on, you occasionally see
6910        &#60;defunct&#62; processes like this waiting to be dealt with. This is
6911        perfectly normal.
6912
6913 </P>
6914 <A NAME="SEC285" HREF="FAQ.html#TOC285">Q5016</A>: On a reboot, or a restart of the mail system, I see the message "Mailer
6915        daemons: exim abandoned: unknown, malformed, or incomplete option
6916        <B>-bz</B> sendmail". What does this mean?
6917
6918
6919 <P>
6920 A5016: <B>-bz</B> is a Sendmail option requesting it to create a "configuration freeze
6921        file". Exim has no such concept and so does not support the option. You
6922        probably have a line like
6923
6924 </P>
6925 <PRE>
6926          /usr/lib/sendmail -bz</PRE>
6927 <P>
6928        in some start-up script (e.g. <B><B>/etc/init.d/mail</B>)</B> immedately before
6929
6930 </P>
6931 <PRE>
6932          /usr/lib/sendmail -bd -q15m</PRE>
6933 <P>
6934        The first of these lines should be commented out.
6935
6936 </P>
6937 <A NAME="SEC286" HREF="FAQ.html#TOC286">Q5017</A>: I would like to restrict e-mail usage for some users to the local
6938        machine, ideally on a group basis.
6939
6940
6941 <P>
6942 A5017: See 
6943         <A HREF="FAQ.html#SEC349">A9802</A>
6944
6945 </P>
6946 <A NAME="SEC287" HREF="FAQ.html#TOC287">Q5018</A>: Whenever exim restarts it takes up to 3-5 minutes to start responding on
6947        the SMTP port. Why is this?
6948
6949
6950 <P>
6951 A5018: Something else is hanging onto port 25 and not releasing it. One place
6952        to look is <B><B>/etc/inetd.conf</B></B> in case for any reason an SMTP stream is
6953        configured there.
6954
6955 </P>
6956 <A NAME="SEC288" HREF="FAQ.html#TOC288">Q5019</A>: Why aren't there any man pages for Exim? I don't always carry my printed
6957        documentation.
6958
6959
6960 <P>
6961 A5019: As well as plain ASCII text, the Exim documentation is provided in two
6962        online forms - texinfo and HTML - which have a certain amount of built-
6963        in indexing for ease of finding your way around. There are no man pages
6964        because the author of Exim hasn't the time (or desire :-) to maintain
6965        yet another documentation format. Besides, it is hard to know how to
6966        split the Exim manual up.
6967
6968 </P>
6969 <P>
6970        There is a contributed man page for a previous version of Exim in
6971
6972 </P>
6973 <P>
6974        <B><A HREF="ftp://ftp.cus.cam.ac.uk/pub/software/programs/exim/Contrib/doc/exim.8">ftp://ftp.cus.cam.ac.uk/pub/software/programs/exim/Contrib/doc/exim.8</A></B>
6975
6976 </P>
6977 <P>
6978        This was written by a previous maintainer of the Debian GNU/Linux Exim
6979        package. You can view a nicely formated version at:
6980
6981 </P>
6982 <P>
6983        <B><A HREF="http://dwww.jimpick.com/cgi-bin/dwww?type=man&location=/usr/man/man8/exim.8.gz">http://dwww.jimpick.com/cgi-bin/dwww?type=man&location=/usr/man/man8/exim.8.gz</A></B>
6984
6985 </P>
6986 <P>
6987        This contains some introductory text and the command line options only.
6988
6989 </P>
6990 <A NAME="SEC289" HREF="FAQ.html#TOC289">Q5020</A>: When I send a message using the <B>-t</B> command line option, Exim sends only
6991        to the addresses within the message, not to those on the command line.
6992
6993
6994 <P>
6995 A5020: By default Exim operates according to the Sendmail documentation, and
6996        interprets addresses on the command line as addresses <EM>not</EM> to send to.
6997        You can set
6998
6999 </P>
7000 <PRE>
7001          extract_addresses_remove_arguments = false</PRE>
7002 <P>
7003        to change this behaviour. There is some confusion in the Sendmail
7004        community about the interpretation of recipient addresses on the command
7005        line if the <B>-t</B> option is used.
7006
7007 </P>
7008 <P>
7009        Here is an except from one version of the sendmail documentation
7010
7011 </P>
7012 <P>
7013          <B>-t</B>  Read message for recipients. To:, Cc:, and Bcc: lines will
7014              be scanned for recipient addresses. The Bcc: line will be
7015              deleted before transmission. Any addresses in the argument
7016              list will be suppressed, that is, they will not receive
7017              copies even if listed in the message header.
7018
7019 </P>
7020 <P>
7021        Earlier versions of the sendmail documentation are ambiguous (unlike the
7022        snippet above).  Apparently the code and documentation streams resolved
7023        the ambiguity differently.
7024
7025 </P>
7026 <A NAME="SEC290" HREF="FAQ.html#TOC290">Q5021</A>: If I set up, for example, 
7027           <TT>local_domains = *customer.com</TT>, then it matches
7028        <B>"customer.com"</B> and <B>"abc.customer.com"</B> as required, but it also matches
7029        <B>"noncustomer.com",</B> which is wrong. How can I get round this?
7030
7031
7032 <P>
7033 A5021: (A) You have to specify two entries in the list:
7034
7035 </P>
7036 <PRE>
7037          local_domains = customer.com : *.customer.com</PRE>
7038 <P>
7039        because * in a domain list matches any characters, including "." and
7040        including a null sequence.
7041
7042 </P>
7043 <P>
7044        (B) Alternatively, you could use a regular expression:
7045
7046 </P>
7047 <PRE>
7048           local_domains = ^(.+\.|)customer\.com$</PRE>
7049 <P>
7050        but that probably will not be as efficient.
7051
7052 </P>
7053 <P>
7054        (C) If you have lots of local domains, you could put them into a file to
7055        be searched (using lsearch, dbm, cdb, or whatever) and use a partial
7056        search such as
7057
7058 </P>
7059 <PRE>
7060          local_domains = partial-dbm;/list/of/domains</PRE>
7061 <P>
7062        If the file contains the key <B>*.customer.com</B> then the desired effect is
7063        achieved, because partial lookups do operate on a component basis. See
7064        the section entitled "Partial matching in domain lists". It is a bit
7065        confusing that "*" is used in this context, because its meaning is not
7066        the same as when it appears directly in a domain list.
7067
7068 </P>
7069 <A NAME="SEC291" HREF="FAQ.html#TOC291">Q5022</A>: I want to match all local domains of the form <B>*.oyoy.org</B> but want a few
7070        exceptions. For instance I don't want <B>foo.oyoy.org</B> or <B>bar.oyoy.org</B> to be
7071        treated as local. What is the best way to do this?
7072
7073
7074 <P>
7075 A5022: (A) From release 3.00 onwards, you can put negative items in the
7076        <TT>local_domains</TT> setting, like this:
7077
7078 </P>
7079 <PRE>
7080          local_domains = !foo.oyoy.org : !bar.oyoy.org : *.oyoy.org</PRE>
7081 <P>
7082        If there are many exceptions, you can use a lookup instead of listing
7083        them all inline.
7084
7085 </P>
7086 <P>
7087        (B) Otherwise, you can use a regular expression:
7088
7089 </P>
7090 <PRE>
7091          local_domains = ^.*(?&#60;!^foo|^bar)\.oyoy\.org$</PRE>
7092 <P>
7093        An alternative formulation that is more efficient in execution (because
7094        it doesn't backtrack for .* in cases that don't match) is
7095
7096 </P>
7097 <PRE>
7098          local_domains = ^(?&#62;.*$)(?&#60;=\.oyoy\.org)(?&#60;!^(foo|bar)\.oyoy\.org)</PRE>
7099 <P>
7100        If you are using an earlier version of Exim in which the regular
7101        expression library does not have lookbehind support (versions prior to
7102        2.051, but after 1.735):
7103
7104 </P>
7105 <PRE>
7106          local_domains = ^(?!(foo|bar)\.oyoy\.org$).+\.oyoy\.org$</PRE>
7107 <P>
7108        If you are using a version of Exim that is earlier than 1.735, consider
7109        upgrading!
7110
7111 </P>
7112 <A NAME="SEC292" HREF="FAQ.html#TOC292">Q5023</A>: I can't seem to find a pre-built version of Exim anywhere. The machine
7113        is a Sparc 5 running Solaris 2.6.
7114
7115
7116 <P>
7117 A5023: The problem is that there are a number of build-time options, requiring
7118        the answer to questions like:
7119
7120 </P>
7121 <P>
7122        . Which DBM library do you have? (On Solaris probably ndbm, but no easy
7123          default on some other systems.)
7124
7125 </P>
7126 <P>
7127        . Which uid/gid do you want to use for Exim?
7128
7129 </P>
7130 <P>
7131        . Where do you want the configuration file to be? (<EM>Many</EM> different
7132          answers, even on the same OS, depending on local policy.)
7133
7134 </P>
7135 <P>
7136        . Ditto for the binaries.
7137
7138 </P>
7139 <P>
7140        . Which optional bits of Exim do you want to include?
7141
7142 </P>
7143 <P>
7144        ... and so on. One could impose a set of values, but I suspect they
7145        would probably please nobody.
7146
7147 </P>
7148 <A NAME="SEC293" HREF="FAQ.html#TOC293">Q5024</A>: Is there a Windows NT version of Exim available?
7149
7150
7151 <P>
7152 A5024: A long time ago somebody took a copy of the Exim source with the aim of
7153        trying to port it to NT. However, I never heard anything more.
7154
7155 </P>
7156 <A NAME="SEC294" HREF="FAQ.html#TOC294">Q5025</A>: Does Exim support Delivery Status Notificaion (DSN), Message Status
7157        Notification (MSN), or any other form of delivery acknowledgement?
7158
7159
7160 <P>
7161 A5025: See 
7162         <A HREF="FAQ.html#SEC158">A0517</A>.
7163
7164 </P>
7165 <A NAME="SEC295" HREF="FAQ.html#TOC295">Q5026</A>: What does "Exim" stand for?
7166
7167
7168 <P>
7169 A5026: Originally, it was "EXperimental Internet Mailer", which was the best I
7170        could come up with when I was starting out. At that point it <EM>was</EM>
7171        experimental - I wanted to see if the ideas I had for extending Smail's
7172        approach actually worked. Then somebody discovered about it and wanted
7173        to start using it, and told other people about it...
7174
7175 </P>
7176 <A NAME="SEC296" HREF="FAQ.html#TOC296">Q5027</A>: What does the log message "no immediate delivery: more than 10 messages
7177        received in one connection" mean?
7178
7179
7180 <P>
7181 A5027: See 
7182         <A HREF="FAQ.html#SEC159">A0518</A>.
7183
7184 </P>
7185 <A NAME="SEC297" HREF="FAQ.html#TOC297">Q5028</A>: Although I haven't set <TT>check_spool_space</TT>, Exim is still checking the
7186        amount of space on the spool for incoming SMTP messages that use the
7187        SIZE option. Can I suppress this?
7188
7189
7190 <P>
7191 A5028: The RFC for the SIZE option says
7192
7193 </P>
7194 <P>
7195          If the server currently lacks sufficient resources to accept a
7196          message of the indicated size, but may be able to accept the
7197          message at a later time, it responds with code "452
7198          insufficient system storage".
7199
7200 </P>
7201 <P>
7202        and that is what Exim is trying to implement. This is entirely
7203        independent from <TT>check_spool_space</TT>, which says "don't accept any mail
7204        if there is less than so much space in the spool partition", though the
7205        code is optimised to do both checks at the same time if required.
7206        However, you can suppress the SIZE check if you want to, by unsetting
7207        <TT>smtp_check_spool_space</TT>.
7208
7209 </P>
7210 <A NAME="SEC298" HREF="FAQ.html#TOC298">Q5029</A>: I just noticed log entries that start off "&#60;= &#60;&#62;". Am I correct in
7211        assuming that the "&#60;&#62;" indicates that the envelope did not contain any
7212        "From" data?
7213
7214
7215 <P>
7216 A5029: Yes. This indicates a delivery failure report (aka "bounce message").
7217        Here is what RFC 1123 has to say about this:
7218
7219 </P>
7220 <P>
7221          "If there is a delivery failure after acceptance of a message,
7222          the receiver-SMTP MUST formulate and mail a notification
7223          message.  This notification MUST be sent using a null ("&#60;&#62;")
7224          reverse path in the envelope; see Section 3.6 of RFC-821.  The
7225          recipient of this notification SHOULD be the address from the
7226          envelope return path (or the Return-Path: line).  However, if
7227          this address is null ("&#60;&#62;"),  the receiver-SMTP MUST NOT send a
7228          notification.  If the address is an explicit source route, it
7229          SHOULD be stripped down to its final hop."
7230
7231 </P>
7232 <P>
7233        The reason for using empty sender addresses is to identify bounce
7234        messages so that they themselves do not cause further bounces. However,
7235        this has made life harder for those that want to check incoming mail for
7236        valid senders. It is a pity that some other mechanism (e.g. a keyword
7237        on the MAIL command) was not used instead, but it is far too late to
7238        change now.
7239
7240 </P>
7241 <P>
7242        Empty senders are also used for other kinds of report which should not
7243        themselves cause the generation of bounce messages. For example, Exim
7244        uses them when sending out warnings about delivery delays.
7245
7246 </P>
7247 <A NAME="SEC299" HREF="FAQ.html#TOC299">Q5030</A>: I've received a message which does not have my address in the To:
7248        line. It is a spam message with the same address in both the From: and
7249        the To: headers. How can this happen, and why doesn't Exim reject it?
7250
7251
7252 <P>
7253 A5030: There is an important distinction between the "envelope" from and to and
7254        the "header" from and to. The former are sometimes called the "sender"
7255        and "recipient". An email message needs an "envelope" for the same
7256        reason that paper mail does - the envelope tells the delivery mechanism
7257        what to do with *this copy* of the message, whereas the To: header lists
7258        all the recipients, including those who have been sent different copies
7259        of the message because their mailbox is on some other host.
7260
7261 </P>
7262 <P>
7263        An MTA such as Exim normally works entirely with the "envelope"
7264        addresses, not with those in the header lines. However, you can specify
7265        that it should do some checking of header addresses by setting a
7266        number of options whose names begin with <TT>headers_</TT>.
7267
7268 </P>
7269 <P>
7270        Don't try to block mail where envelope from and the header from differ.
7271        There are common legitimate cases where this happens, for example,
7272        messages forwarded from mailing lists and delivery failure reports.
7273
7274 </P>
7275 <A NAME="SEC300" HREF="FAQ.html#TOC300">Q5031</A>: Can (or will) Exim ever handle a message delivery purely in memory,
7276        that is, it is handled without it ever hitting the disc?
7277
7278
7279 <P>
7280 A5031: It doesn't, and never will. Accepting and delivering a message are two
7281        entirely separate, independent processes, which communicate only by
7282        writing/reading the message on the disc.
7283
7284 </P>
7285 <A NAME="SEC301" HREF="FAQ.html#TOC301">Q5032</A>: If I am using dbm files for data that Exim reads, can I rebuild them
7286        on the fly, or do I need to restart Exim every time I make a change?
7287
7288
7289 <P>
7290 A5032: Exim re-reads the file every time it consults it, so if you are using a
7291        cdb or a DBM library that uses just a single file (i.e. NOT ndbm) then
7292        you can just build the new file with a temporary file name, and use "mv"
7293        to rename it into the correct place on the fly. If there are two files
7294        to rename, there is a window of time during which the DBM database is
7295        inconsistent. On lightly loaded systems this may not matter.
7296
7297 </P>
7298 <A NAME="SEC302" HREF="FAQ.html#TOC302">Q5033</A>: What are the main differences between using an Exim filter and using
7299        procmail?
7300
7301
7302 <P>
7303 A5033: Exim filters and procmail provide different facilities. Exim filters run
7304        at directing time, before <EM>any</EM> deliveries are done. A filter is like a
7305        <B>".forward</B> file with conditions". One of the benefits is de-duplication.
7306        Another is that if you forward, you are forwarding the original message.
7307
7308 </P>
7309 <P>
7310        However, this does mean that pipes etc. are not run at filtering time,
7311        nor can you change the headers, because the message may have other
7312        recipients and Exim keeps only a single set of headers.
7313
7314 </P>
7315 <P>
7316        Procmail runs at delivery time. This is for one recipient only, and so
7317        it can change headers, run pipes and check the results, etc. However, if
7318        it wants to forward, it has to create a new message containing a copy
7319        of the original message.
7320
7321 </P>
7322 <P>
7323        It's your choice as to which of these you use. You can of course use
7324        both.
7325
7326 </P>
7327 <A NAME="SEC303" HREF="FAQ.html#TOC303">Q5034</A>: I need an option that is the opposite of <B>-bpa,</B> that is, a listing of
7328        those addresses generated from a top-level address that have not yet
7329        been delivered.
7330
7331
7332 <P>
7333 A5034: Exim does not keep this information. It saves only the top-level
7334        addresses and the list of addresses that are finished with. At each
7335        delivery attempt, generated addresses are recomputed from scratch. This
7336        makes it possible to correct errors in <B>.forward</B> and alias files that are
7337        causing delivery delays. However, there is an option you can set on an
7338        <B>aliasfile</B> or <B>forwardfile</B> director that changes things. It is called
7339        <TT>one_time</TT>, and if it is set, the list of generated addresses gets added
7340        to the top-level list at the first delivery attempt, and is never
7341        regenerated. Because top-level address lists must be real email
7342        addresses, this option cannot be used if any of the generated addresses
7343        are pipes, files, or autoreplies.
7344
7345 </P>
7346 <A NAME="SEC304" HREF="FAQ.html#TOC304">Q5035</A>: I am getting complaints from a customer who uses my EXIM server for
7347        relaying that they are being blocked with a "Too many connections"
7348        error.
7349
7350
7351 <P>
7352 A5035: See <TT>smtp_accept_max</TT> and related options such as <TT>smtp_accept_reserve</TT>.
7353
7354 </P>
7355 <A NAME="SEC305" HREF="FAQ.html#TOC305">Q5036</A>: When I try "exim <B>-bf"</B> to test a system filter, I received the following
7356        error message: "Filter error: unavailable filtering command "fail" near
7357        line 8 of filter file".
7358
7359
7360 <P>
7361 A5036: Use the <B>-bF</B> option to test system filters. This gives you access to the
7362        freeze and fail actions.
7363
7364 </P>
7365 <A NAME="SEC306" HREF="FAQ.html#TOC306">Q5037</A>: How can I make Exim receive incoming mail, queue it, but NOT attempt to
7366        deliver it? I want to be in this state while moving some mailboxes.
7367
7368
7369 <P>
7370 A5037: (1) Set <TT>queue_only</TT> in the Exim configuration. (2) Kill off your daemon,
7371        and restart it <EM>without</EM> the <B>-q</B> option (i.e. with just the <B>-bd</B> option),
7372        so that it does not spawn any queue runners. This stops all deliveries,
7373        remote as well as local. To stop just local deliveries, assuming that
7374        none of your routers are configured to send messages directly to a local
7375        transport, make this your first director:
7376
7377 </P>
7378 <PRE>
7379          defer_all:
7380            driver = smartuser
7381            new_address = :defer:</PRE>
7382 <P>
7383        When you are ready to go again, remove that director and do a <B>-qf</B> run to
7384        override the retry times. This solution works from release 3.10 onwards.
7385        In earlier releases an <B>aliasfile</B> director must be used because :defer:
7386        was not available for use in <B>smartuser</B>.
7387
7388 </P>
7389 <A NAME="SEC307" HREF="FAQ.html#TOC307">Q5038</A>: What does the rejection message "reject all recipients: 3 times bad
7390        sender" mean?
7391
7392
7393 <P>
7394 A5038: See the section of the manual entitled "Sender verification". Exim has
7395        failed to verify a sender from the same host 3 times within a period of
7396        24 hours.
7397
7398 </P>
7399 <A NAME="SEC308" HREF="FAQ.html#TOC308">Q5039</A>: The menu in Eximon isn't working. It displays, but I can't select
7400        anything from it.
7401
7402
7403 <P>
7404 A5039: On some X implementations, if the numlock key is pressed (so that the
7405        numeric keypad is working) then the menu didn't work properly in
7406        versions of Eximon before Exim release 3.10. The problem is an
7407        infelicity in the particular implementation of X. A workaround was
7408        introduced at release 3.10, so this problem should no longer be
7409        encountered.
7410
7411 </P>
7412 <A NAME="SEC309" HREF="FAQ.html#TOC309">Q5040</A>: What does "ridiculously long message header" in an error report mean?
7413
7414
7415 <P>
7416 A5040: There has to be some limit to the length of a message's header lines,
7417        because otherwise a malefactor could open an SMTP channel to your host,
7418        start a message, and then just send characters continuously until your
7419        machine ran out of memory. (Exim stores all the header lines in main
7420        memory). For this reason a limit is imposed on the total amount of
7421        memory that can be used for header lines. The default is 1MB, but this
7422        can be changed by setting HEADER_MAXSIZE in <B>Local/Makefile</B>. Exceeding
7423        the limit provokes the "ridiculous" error message.
7424
7425 </P>
7426 <P>
7427        Prior to release 3.022 Exim used two separate limits, one on the length
7428        of an individual header line and one on the total number of header
7429        lines. A header line longer than 8192 used to provoke the error "Header
7430        line is ridiculously overlong". In subsequent releases there is no limit
7431        on individual header lines; only the total header size matters.
7432
7433 </P>
7434 <A NAME="SEC310" HREF="FAQ.html#TOC310">Q5041</A>: What does Exim use for POP as a default?  Do I have to install anything
7435        else?
7436
7437
7438 <P>
7439 A5041: Yes. Exim provides MTA functionality. That is, it delivers mail. POP is
7440        one of several ways of reading previously-delivered mail. Exim does not
7441        provide that functionality.
7442
7443 </P>
7444 <A NAME="SEC311" HREF="FAQ.html#TOC311">Q5042</A>: I see that Exim doesn't support SSL. Can it be made to work with stunnel?
7445
7446
7447 <P>
7448 A5042: From release 3.20, Exim does support SSL/TLS, by making use of the
7449        OpenSSL library.
7450
7451 </P>
7452 <P>
7453        The problem with using stunnel is that all your SSL connections look
7454        like they come from 127.0.0.1 - none of your IP based policies will
7455        have any effect. This means that you are basically an open relay,
7456        anyone who connects to your server via SSL can relay through you,
7457        whether they are local or not (and who knows, spammers may someday
7458        evolve brains enough to try using SSL ports).
7459
7460 </P>
7461 <P>
7462        One solution to this is to force all SSL connections to authenticate
7463        before relaying. This is how one user has done this:
7464
7465 </P>
7466 <P>
7467        First make sure you are set up to do SMTP AUTH properly (see the sample
7468        configuration C034). Then add MUSTAUTH to the <TT>auth_hosts</TT> line in your
7469        configure file. If you don't already have a list of IPs there, it will
7470        look like this:
7471
7472 </P>
7473 <PRE>
7474          auth_hosts = MUSTAUTH</PRE>
7475 <P>
7476        If you have some IPs you want to authenticate, add them like this:
7477
7478 </P>
7479 <PRE>
7480          auth_hosts = MUSTAUTH:10.1.1.1:10.1.1.2</PRE>
7481 <P>
7482        Then invoke stunnel like this:
7483
7484 </P>
7485 <PRE>
7486          /usr/local/sbin/stunnel -d 465 -l /usr/exim/bin/exim \
7487            -p /usr/local/ssl/certs/exim.pem -- exim -bs -DMUSTAUTH=127.0.0.1</PRE>
7488 <P>
7489        Whenever an SSL connection is established, Exim is invoked with the
7490        macro MUSTAUTH defined as 127.0.0.1, which forces that one particular
7491        instance to authenticate, without disrupting normal 127.0.0.1 operations
7492        via non-SSL sessions.
7493
7494 </P>
7495 <A NAME="SEC312" HREF="FAQ.html#TOC312">Q5043</A>: Is there an easy way of removing all queued messages at once in a safe
7496        way?
7497
7498
7499 <P>
7500 A5043: Try this command:
7501
7502 </P>
7503 <PRE>
7504        exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | sh</PRE>
7505 <A NAME="SEC313" HREF="FAQ.html#TOC313">Q5044</A>: What is the best way to provide backup MX for clients?
7506
7507
7508 <P>
7509 A5044: If the clients are always online, all you need to do is to have MX
7510        records for their domains pointing to your host, with suitable
7511        preference values, and ensure that their domains are listed in
7512        <TT>relay_domains</TT>. If the clients are not always online, see 
7513         <A HREF="FAQ.html#SEC262">Q1403</A>.
7514
7515 </P>
7516 <A NAME="SEC314" HREF="FAQ.html#TOC314">Q5045</A>: Why does Exim do "ident" callbacks by default? Isn't this just a waste
7517        of resources? I've been told this is an ancient way of authentication.
7518        Is it obsolete?
7519
7520
7521 <P>
7522 A5045: This is a common mistake, at least partially resulting from the
7523        incorrect naming of the protocol when it was first published.
7524        The service on port 113 is an identification service, which allows a
7525        target host to record information identifying the user responsible for
7526        making a connection to it. The information may not be intelligible to
7527        the recording host - it could, for example, be encrypted so that only
7528        someone on the calling host can make sense of it. It is useful for
7529        providing additional information in an audit trail.
7530
7531 </P>
7532 <P>
7533        The data should not be used for authentication in any form except
7534        on a closed secure network between cooperating hosts (probably not
7535        even then). The information from the source host is only as reliable
7536        as the host itself - if it's not under your control then you have to
7537        treat the information as opaque data that can be used by the sysadmin
7538        of the source system to trace back connection data - and some ident
7539        implementations send out opaque cookies or DES encrypted information.
7540        Ident is hugely useful at times - especially for checking back on
7541        connections from multiuser machines (as opposed to one-person desktop
7542        boxes).
7543
7544 </P>
7545 <P>
7546        You can stop Exim making ident calls by adding
7547
7548 </P>
7549 <PRE>
7550          rfc1413_query_timeout = 0s</PRE>
7551 <P>
7552        to its configuration, but it is better to leave it active (reducing the
7553        timeout if it is causing problems) - it costs very little, and in cases
7554        of mail forgery from a multiuser system can track the sinner concerned
7555        very quickly.
7556
7557 </P>
7558 <A NAME="SEC315" HREF="FAQ.html#TOC315">Q5046</A>: I often have the problem that a message gets stuck in the mailq and I
7559        want it to be bounced to a certain address.
7560
7561
7562 <P>
7563 A5046: You can do this using a combination of four command line options, like
7564        this:
7565
7566 </P>
7567 <PRE>
7568          exim -Mf   14Fdlq-0003kM-00
7569          exim -Mmad 14Fdlq-0003kM-00
7570          exim -Mar  14Fdlq-0003kM-00  new@ddress
7571          exim -M    14Fdlq-0003kM-00</PRE>
7572 <P>
7573        The first command freezes the message so that a queue runner won't start
7574        to deliver it while you are changing things. The second command marks
7575        all existing recipients as delivered. The third command adds a new
7576        recipient, and the fourth command forces a delivery of the message,
7577        which will cause it to be delivered to the new address, and then
7578        deleted.
7579
7580 </P>
7581 <A NAME="SEC316" HREF="FAQ.html#TOC316">Q5047</A>: What precautions should I take when editing <B>exim.conf?</B>
7582
7583
7584 <P>
7585 A5047: Edit <B>exim.conf</B> to <B>exim.conf.new.</B> Then run
7586
7587 </P>
7588 <PRE>
7589          exim -bV -C exim.conf.new</PRE>
7590 <P>
7591        That will check for syntax errors without disturbing your running
7592        configuration. If you are paranoid enough, <EM>as</EM> <EM>root</EM> run
7593
7594 </P>
7595 <PRE>
7596          exim -C exim.conf.new &#60;some address&#62;
7597          &#60;some message&#62;
7598          .</PRE>
7599 <P>
7600        and see if it delivers it. Carry on testing until happy. When happy,
7601
7602 </P>
7603 <PRE>
7604          mv exim.conf.new exim.conf
7605          kill -HUP `cat /var/spool/exim/exim-daemon.pid`</PRE>
7606 <P>
7607        Then check the Exim log to be sure the daemon restarted OK. Watch the
7608        log for a bit to see that mail is flowing.
7609
7610 </P>
7611 <A NAME="SEC317" HREF="FAQ.html#TOC317">Q5048</A>: Is exim able to use RFC 2645, On-demand Mail Relay (ODMR)?
7612
7613
7614 <P>
7615 A5048: No.
7616
7617 </P>
7618 <A NAME="SEC318" HREF="FAQ.html#TOC318">Q5049</A>: I want to send every bounced mail that is received by my server, as
7619        "headers-only" to the sysadmin. How can I do this?
7620
7621
7622 <P>
7623 A5049: 1. Set up a transport with <TT>headers_only</TT> to do the delivery.
7624
7625 </P>
7626 <P>
7627        2. Set up a <B>smartuser</B> director that directs messages to a special local
7628           alias (e.g. "sysadmin-header") to that transport.
7629
7630 </P>
7631 <P>
7632        3. Set up a system filter file, containing something like
7633
7634 </P>
7635 <PRE>
7636          if first_delivery and error_message then
7637            unseen deliver sysadmin-header@your.domain
7638          endif</PRE>
7639 <A NAME="SEC319" HREF="FAQ.html#TOC319">Q5050</A>: What POP3 daemon should I use with Exim? I want something with
7640        configurable authentication mechanisms.
7641
7642
7643 <P>
7644 A5050: Qmail-pop has a checkpasswd part that can be hacked to add whatever
7645        authentication you want. There is also Solid POP which has a lot of
7646        Exim support in it (e.g. nhash). There is also Cyrus, which is
7647        self-contained, so you don't have to worry about ownership of mailboxes
7648        and also it can be poked into authenticating from just about anything.
7649        However, in general, YMMV, and really what suits one user may not suit
7650        another. There is a mailing list at <B><B>pop-imap@exim.org</B></B> for the discussion
7651        of POP/IMAP issues. More information can be found in its archives.
7652
7653 </P>
7654 <A NAME="SEC320" HREF="FAQ.html#TOC320">Q5051</A>: Is there any way I can send bounces to the postmaster, and nobody else?
7655        Basically, I want to recieve them, and I don't want the reply/from
7656        person to get them. If I think they need it I will forward it myself.
7657
7658
7659 <P>
7660 A5051: Put <TT>errors_to=postmaster</TT> on every router and director.
7661
7662 </P>
7663 <BR><H2><A NAME="SEC321" HREF="FAQ.html#TOC321">93. HP-UX
7664
7665 </A></H2>
7666 <A NAME="SEC322" HREF="FAQ.html#TOC322">Q9301</A>: I'm trying to compile on an HP machine and I don't have gcc there. So I
7667        put <TT>CC=cc</TT> in the <B>Local/Makefile</B>, but I got this error:
7668
7669
7670 <PRE>
7671        (Bundled) cc: "buildconfig.c", line 54: error 1705: Function prototypes
7672          are an ANSI feature.</PRE>
7673 <P>
7674 A9301: The bundled compiler is not an ANSI C compiler. You either have to get a
7675        copy of gcc from the HPUX Software Porting Archives or buy the ANSI cc
7676        from HP. The advice given by one user of HP systems on the Exim
7677        mailing list was as follows:
7678
7679 </P>
7680 <P>
7681          "Personally, I wouldn't use anything but the ANSI C compiler. gcc
7682          works for compilation, but it doesn't know squat about PA-RISC chips
7683          past the 1.0 rev. Since then, HP has come out with PA-RISC 1.1, 2.0,
7684          and 2.1, each with better features. gcc will compile for them, but it
7685          doesn't produce anywhere near the optimization that HP's compiler
7686          does.
7687
7688 </P>
7689 <P>
7690          I took the gcc road when we moved from FreeBSD to HP-UX because I was
7691          familiar with it. After 6 months, I had to go and re-port everything
7692          over when we realized that gcc wasn't going to do it for us long-term.
7693          If I could give advice to any new HP-UX admin: don't use gcc if you
7694          can afford the ANSI C compiler.  Based on the cost of even the lowest
7695          HP workstation, that usually isn't a problem."
7696
7697 </P>
7698 <BR><H2><A NAME="SEC323" HREF="FAQ.html#TOC323">94. BSDI
7699
7700 </A></H2>
7701 <A NAME="SEC324" HREF="FAQ.html#TOC324">Q9401</A>: On BSDI 4.0, Exim built with Perl support exits with the error message
7702
7703
7704 <PRE>
7705          ./exim: can't load library 'libperl.so'</PRE>
7706 <P>
7707 A9401: You probably compiled perl5 yourself, without looking into
7708
7709 </P>
7710 <PRE>
7711          /usr/src/contrib/perl5/perl5.004_02/hints/bsdos.sh</PRE>
7712 <P>
7713        first. The problem is that the command
7714
7715 </P>
7716 <PRE>
7717          perl5 -MExtUtils::Embed -e ldopts</PRE>
7718 <P>
7719        doesn't give you sufficient flags to link something with libperl.
7720        Since 5.004_02 the <B>hints/bsdos.sh</B> file has changed to adapt to the
7721        changes between BSDI 3.1 and 4.0, but it is still not entirely right.
7722
7723 </P>
7724 <P>
7725        The solution is, when you compile perl, change the "ccdlflags"
7726        variable in <B>config.sh</B> to:
7727
7728 </P>
7729 <PRE>
7730          -rdynamic -Wl,-rpath,/usr/local/lib/perl5/5.00502/i386-bsdos/CORE</PRE>
7731 <P>
7732        (or something similar). Alternatively, you can run ./Configure and
7733        answering the question "Any special flags to pass to cc to use dynamic
7734        loading?" with the above line. It is not known what <B>-rdynamic</B> means
7735        (it's not apparently documented in any man page), but that's what BSDI
7736        guys did to compile perl5 which comes with BSDI 4.0 distribution.
7737
7738 </P>
7739 <BR><H2><A NAME="SEC325" HREF="FAQ.html#TOC325">95. IRIX
7740
7741 </A></H2>
7742 <A NAME="SEC326" HREF="FAQ.html#TOC326">Q9501</A>: I'm running IRIX 6.2 with a number of alias IP addresses set up, but
7743        Exim doesn't seem to recognize them as local addresses.
7744
7745
7746 <P>
7747 A9501: This problem was fixed in Exim release 2.03. If you are running an
7748        earlier version you should use the <TT>local_interfaces</TT> option to specify
7749        all your IP addresses explicitly.
7750
7751 </P>
7752 <A NAME="SEC327" HREF="FAQ.html#TOC327">Q9502</A>: The IP addresses for incoming calls are all being given as
7753        255.255.255.255 or 0.0.0.0.
7754
7755
7756 <P>
7757 A9502: From release 3.21, Exim contains a workaround that should fix this
7758        problem. If you are using an earlier release, read on...
7759
7760 </P>
7761 <P>
7762        If you used the gcc compiler 2.8.x or a version in the 2.95 series,
7763        there is a known bug with the "gethost" function under Irix. SGI
7764        recommends using either their cc compiler in Irix 6.5, or a lesser
7765        version of the gnu compiler. Version 2.7.2.3 is known to work.
7766        Alternatively, there is an Inst-able port of Exim for Irix at
7767        <B><A HREF="http://freeware.sgi.com">http://freeware.sgi.com</A>,</B> but it is not likely to be the latest release.
7768        There is further information about this problem, which is described as a
7769        "classic gcc structure-in-a-register bug" at this URL:
7770
7771 </P>
7772 <P>
7773          <B><A HREF="http://www.ccp14.ac.uk/ccp14admin/apache13/apache255error.html">http://www.ccp14.ac.uk/ccp14admin/apache13/apache255error.html</A></B>
7774
7775 </P>
7776 <P>
7777        This is a summary that I was sent:
7778
7779 </P>
7780 <P>
7781          "Gcc does not correctly pass/return structures which are smaller than
7782          16 bytes and which are not 8 bytes. The problem is very involved and
7783          difficult to fix. It affects a number of other targets also, but irix6
7784          is affected the most, because it is a 64 bit target, and 4 byte
7785          structures are common. The exact problem is that structures are being
7786          padded at the wrong end, e.g. a 4 byte structure is loaded into the
7787          lower 4 bytes of the register when it should be loaded into the upper
7788          4 bytes of the register."
7789
7790 </P>
7791 <BR><H2><A NAME="SEC328" HREF="FAQ.html#TOC328">96. LINUX
7792
7793 </A></H2>
7794 <A NAME="SEC329" HREF="FAQ.html#TOC329">Q9601</A>: Exim is mysteriously crashing, usually when forking to send a delivery
7795        error message.
7796
7797
7798 <P>
7799 A9601: This has been seen in cases where Exim has been incorrectly built with
7800        a muddled combination of an <B>ndbm.h</B> include file and a non-matching
7801        DBM library.
7802
7803 </P>
7804 <P>
7805        Faults like this have also been seen on systems with faulty motherboards.
7806        You could try to compile the Linux kernel 10 times - if the compile
7807        process stops with signal 11, your hardware is to blame.
7808
7809 </P>
7810 <A NAME="SEC330" HREF="FAQ.html#TOC330">Q9602</A>: Exim has created a directory called <B>build-Linux-libc5-i386</B> but is
7811        trying to reference <B>build-Linux-libc5-i386-linux</B> while building.
7812
7813
7814 <P>
7815 A9602: You have several shells installed, which are setting conflicting values
7816        in the HOSTTYPE environment variable that is used to construct the name
7817        of the build directory. One way round this is to run this command:
7818
7819 </P>
7820 <PRE>
7821          ln -s build-Linux-libc5-i386-linux build-Linux-libc5-i386</PRE>
7822 <P>
7823        This problem should no longer be encountered in release 3.10 or later.
7824        Exim has been changed to get the host type from the "uname" command
7825        preferentially.
7826
7827 </P>
7828 <A NAME="SEC331" HREF="FAQ.html#TOC331">Q9603</A>: I want to use logrotate which is standard with <B>RH5.2</B> Linux to rotate
7829        my mail logs. Anyone worked out the logrotate config file that will
7830        do this?
7831
7832
7833 <P>
7834 A9603: Here's one suggestion:
7835
7836 </P>
7837 <PRE>
7838          /var/log/exim/main.log {
7839              create 644 exim exim
7840              rotate 4
7841              compress
7842              delaycompress
7843          }</PRE>
7844 <P>
7845        The sleep is added to allow things to close the log file prior to
7846        compression. You also need similar entries for the panic log and the
7847        reject log, of course.
7848
7849 </P>
7850 <A NAME="SEC332" HREF="FAQ.html#TOC332">Q9604</A>: I'm seeing the message "<B>inetd</B>[334]: imap/tcp server failing (looping),
7851        service terminated" on a RedHat 5.2 system, causing imap connections to
7852        be refused. The imapd in use is Washington Uni vers 12.250. Could this
7853        be anything to do with Exim?
7854
7855
7856 <P>
7857 A9604: No, it's nothing to do with Exim, but here's the answer anyway: there
7858        is a maximum connection rate for <B>inetd</B>. If connections come in faster
7859        than that, it thinks a caller is looping. The default setting on RedHat
7860        5.2 is 40 calls in any one minute before <B>inetd</B> thinks there's a problem
7861        and suspends further calls for 10 mins. This default setting is very
7862        conservative. You should probably increase it by a factor of 10 or 20.
7863        For example:
7864
7865 </P>
7866 <PRE>
7867          imap stream tcp nowait.400 root /usr/sbin/tcpd /usr/local/etc/imapd</PRE>
7868 <P>
7869        The rate setting is the number following "nowait". This syntax seems to
7870        be specific to the Linux version of <B>inetd</B>. Other operating systems
7871        provide similar functionality, but in different ways.
7872
7873 </P>
7874 <A NAME="SEC333" HREF="FAQ.html#TOC333">Q9605</A>: I get the "too many open files" error especially when a lot of messages
7875        land for majordomo at the same time.
7876
7877
7878 <P>
7879 A9605: The problem appears to be the number of open files the system can
7880        handle. This is changable by using the proc filesystem. To your
7881        <B><B>/etc/rc.d/rc.local</B></B> file append something like the following:
7882
7883 </P>
7884 <PRE>
7885          # Now System is up, Modify kernel parameters for max open etc.</PRE>
7886 <PRE>
7887          if [ -f /proc/sys/kernel/file-max ]; then
7888                  echo 16384 &#62;&#62; /proc/sys/kernel/file-max
7889          fi
7890          if [ -f /proc/sys/kernel/inode-max ]; then
7891                  echo 24576 &#62;&#62; /proc/sys/kernel/inode-max
7892          fi
7893          if [ -f /proc/sys/kernel/file-nr ]; then
7894                  echo 2160 &#62;&#62; /proc/sys/kernel/file-nr
7895          fi</PRE>
7896 <P>
7897        By echoing the value you want for file-max to the file file-max <B>etc.,</B>
7898        you actually change the kernel parameters.
7899
7900 </P>
7901 <A NAME="SEC334" HREF="FAQ.html#TOC334">Q9606</A>: I'm having a problem with an Exim RPM.
7902
7903
7904 <P>
7905 A9606: Normally the thing to do if you have a problem with an RPM package is
7906        to contact the person who built the package first, not the person who
7907        made the software that's in the package.  You can usually find out who
7908        made a package using the following command:
7909
7910 </P>
7911 <PRE>
7912          rpm --query --package --queryformat '%{PACKAGER}\n' &#60;rpm-package-file&#62;</PRE>
7913 <P>
7914        where &#60;rpm-package-file&#62; is the actual file, e.g. <B>`exim-3.03-2.i386.rpm'.</B>
7915        Or, if the package is installed on your system:
7916
7917 </P>
7918 <PRE>
7919          rpm --query --queryformat '%{PACKAGER}\n' &#60;package-name&#62;</PRE>
7920 <P>
7921        where &#60;package-name&#62; is the name component of the package, e.g. `exim'.
7922        If the packager is unable or unwilling to help, only then should you
7923        contact the actual author or associated mailing list of the software.
7924
7925 </P>
7926 <P>
7927        If you discover through the querying process that you can't tell who
7928        the person (or company or group) is who built the package, or that they
7929        no longer exist at the given address, then you should reconsider
7930        whether you want a package from an unknown source on your system.
7931
7932 </P>
7933 <P>
7934        If you discover through the querying process that you yourself are the
7935        person who built the package, then you should either (a) contact the
7936        author or associated mailing list, or (b) reconsider whether you ought
7937        to be building and distributing RPM packages of software you don't
7938        understand.
7939
7940 </P>
7941 <P>
7942        Similar rules of thumb govern other binary package formats, including
7943        debs, tarballs, and POSIX packages.
7944
7945 </P>
7946 <A NAME="SEC335" HREF="FAQ.html#TOC335">Q9607</A>: I installed debian 2.2 linux on a small 325mb 486 laptop. When I try
7947        to test the Mail program, I get the following error: "Failed to open
7948        configuration file <B><B>/etc/exim.conf</B>".</B>
7949
7950
7951 <P>
7952 A9607: The Debian installation should have given you <B>/usr/sbin/eximconfig</B>,
7953        which asks you some questions and then sets up the configuration file
7954        in <B><B>/etc/exim.conf</B>.</B> Try running that (you'll probably need root) and see
7955        how it goes. In any case you get a thoroughly commented conf file at
7956        the end, which will give you a sample from which to work if you need
7957        further modification.
7958
7959 </P>
7960 <P>
7961        The exim docs in the Debian package are in <B>/usr/doc/exim</B> and the full
7962        reference manual is <B>spec.txt.gz</B>
7963
7964 </P>
7965 <A NAME="SEC336" HREF="FAQ.html#TOC336">Q9608</A>: I'm getting the error <B>"db.h:</B> No such file or directory" when I try to
7966        build Exim under RedHat 7.0.
7967
7968
7969 <P>
7970 A9608: See 
7971         <A HREF="FAQ.html#SEC62">Q0113</A>.
7972
7973 </P>
7974 <BR><H2><A NAME="SEC337" HREF="FAQ.html#TOC337">97. SUN SYSTEMS
7975
7976 </A></H2>
7977 <A NAME="SEC338" HREF="FAQ.html#TOC338">Q9701</A>: Exim builds fine with gcc on SunOS 4 but crashes inside <B>sscanf()</B>.
7978
7979
7980 <P>
7981 A9701: Make sure you are liking with the GNU <B>ld</B> linker and not the system
7982        version of <B>ld</B>.
7983
7984 </P>
7985 <A NAME="SEC339" HREF="FAQ.html#TOC339">Q9702</A>: How can I get rid of spurious ^M characters in messages sent from
7986        CDE <B>dtmail</B>?
7987
7988
7989 <P>
7990 A9702: CDE <B>dtmail</B> passes messages to Exim via the command line interface with
7991        lines terminated by CRLF, instead of the Unix convention of just LF. As
7992        Exim is an 8-bit clean program it treats the CR as just another data
7993        character. Exim has a command line option called <B>-dropcr</B> which causes
7994        it to ignore <EM>all</EM> CR characters in an incoming non-SMTP message. You
7995        should configure <B>dtmail</B> to add this option to the command it uses to
7996        call Exim (using the path <B>/usr/lib/sendmail</B>). However, it has been
7997        reported that it isn't possible to change this call from <B>dtmail</B> by any
7998        official means. An alternative approach is to replace <B>/usr/lib/sendmail</B>
7999        by a filtering script which removes the spurious CRs from the input
8000        before passing it to Exim.
8001
8002 </P>
8003 <A NAME="SEC340" HREF="FAQ.html#TOC340">Q9703</A>: On SunOS 4 Exim crashes when looking up domains in the DNS that have
8004        more than 10 A records.
8005
8006
8007 <P>
8008 A9703: There are Sun library patches to fix this. It is not Exim's problem.
8009        For 4.13_U1 the patch is 101558<I>-xx</I>; for 4.1.3 the patch is 100891<I>-xx</I>.
8010        From the README: 1054748 ftp, ping dump core when connecting to a host
8011        with multiple DNS A records.
8012
8013 </P>
8014 <P>
8015        An alternative is to build another resolver library - such as the ones
8016        that are part of the bind distribution - and explicitly link against
8017        those.
8018
8019 </P>
8020 <A NAME="SEC341" HREF="FAQ.html#TOC341">Q9704</A>: The menu in Eximon isn't working on my Sun system.
8021
8022
8023 <P>
8024 A9704: With OpenWindows, if the numlock key is pressed (so that the numeric
8025        pad is working) then some menus don't work. This appears to be true for
8026        the console and (some) remote X-window servers. A workaround for this
8027        problem was introduced in the 3.10 Exim release, so it should no longer
8028        be encountered.
8029
8030 </P>
8031 <A NAME="SEC342" HREF="FAQ.html#TOC342">Q9705</A>: I am experiencing mailbox locking problems with Sun's <B>mailtool</B> used
8032        over a network.
8033
8034
8035 <P>
8036 A9705: Under the "Expert" settings of mailtool is a option to turn on "Use
8037        network aware mail file locking". By default <B>dtmail</B> has this set, but
8038        mailtool doesn't. You should set it. The help info on <B>dtmail</B> has this
8039        to say about it:
8040
8041 </P>
8042 <P>
8043        "Mailer tries to prevent two different instances of itself from opening
8044        the same mail file at the same time through a technique that detects
8045        this access when both instances of Mailer and the file are all on the
8046        same machine. A network-aware mail file locking protocol is available
8047        that uses ToolTalk to coordinate instances of Mailer running from more
8048        than one machine, or mail files accessed over the network. Mailer can
8049        only change this option when first opening a mail file."
8050
8051 </P>
8052 <P>
8053        If you are using the SunOS4 version of <B>mailtool</B>, this apparently
8054        doesn't work. The only thing which does seem to work it getting the user
8055        to hit the "done" button to make it release the lock.
8056
8057 </P>
8058 <A NAME="SEC343" HREF="FAQ.html#TOC343">Q9706</A>: Exim has been crashing on my Solaris x86 system, apparently while
8059        running DBM functions.
8060
8061
8062 <P>
8063 A9706: The use of ndbm with gcc has caused problems on x86 Solaris systems.
8064        Try changing one or the other; using either db 1.85 with gcc, or Sun's
8065        WS compiler with ndbm, has fixed this in the past.
8066
8067 </P>
8068 <A NAME="SEC344" HREF="FAQ.html#TOC344">Q9707</A>: The exiwhat utility isn't working for me on a Solaris 2 system.
8069
8070
8071 <P>
8072 A9707: Have you got <B>/usr/ucb</B> on your path? If so, it is probably picking up the
8073        wrong version of the <B>ps</B> command. The exiwhat script is built on
8074        Solaris to expect the normal Solaris version of <B>ps</B>.
8075
8076 </P>
8077 <A NAME="SEC345" HREF="FAQ.html#TOC345">Q9708</A>: How do I stop Sun's <B>dtcm</B> from hanging?
8078
8079
8080 <P>
8081 A9708: From qmail's FAQ: "There is a novice programming error in <B>dtcm</B>, known as
8082        ``failure to close the output side of the pipe in the <B>child.''</B> Sun has,
8083        at the time of this writing, not yet provided a patch."
8084
8085 </P>
8086 <A NAME="SEC346" HREF="FAQ.html#TOC346">Q9709</A>: I want Exim to use only the resolver (i.e. ignore <B>/etc/hosts</B>), but don't
8087        want to alter the <B>nsswitch.conf</B> file in Solaris 2.
8088
8089
8090 <P>
8091 A9709: You need to rebuild Exim after fiddling with <B>OS/os.h-SunOS5:</B>
8092
8093 </P>
8094 <PRE>
8095        #define gethostbyaddr res_gethostbyaddr
8096        #define gethostbyname res_gethostbyname
8097        #define endhostent res_endhostent
8098        #define endnetent res_endnetent
8099        #define gethostent res_gethostent
8100        #define getnetbyaddr res_getnetbyaddr
8101        #define getnetbyname res_getnetbyname
8102        #define getnetent res_getnetent
8103        #define sethostent res_sethostent
8104        #define setnetent res_setnetent</PRE>
8105 <P>
8106        Exim uses gethostbyname and gethostbyaddr only, but may use others in
8107        the future. Note that <B>-lnsl</B> is still needed in the Makefile as it
8108        contains code used by the NIS lookup and also the <TT>inet_addr</TT> function
8109        that Exim uses.
8110
8111 </P>
8112 <BR><H2><A NAME="SEC347" HREF="FAQ.html#TOC347">98. COOKBOOK
8113
8114 </A></H2>
8115 <A NAME="SEC348" HREF="FAQ.html#TOC348">Q9801</A>: How do I configure Exim as part of TPC <B>(<A HREF="http://www.tpc.int">http://www.tpc.int</A>)?</B>
8116
8117
8118 <P>
8119 A9801: (1) add <B>partial-lsearch;/etc/mail/tpc.domains</B> to <TT>local_domains</TT>;
8120            <B><B>/etc/mail/tpc.domains</B></B> is a text file with lines in this format:
8121
8122 </P>
8123 <PRE>
8124              9.3.5.1.0.8.1.tpc.int.</PRE>
8125 <P>
8126            This sample line indicates that we accept faxes destined for
8127            1(801)539-*.
8128
8129 </P>
8130 <P>
8131        (2) Set up the following transport:
8132
8133 </P>
8134 <PRE>
8135              tpc:
8136                driver = pipe
8137                command = /usr/local/tpc/tpcmailer.pl ${local_part}@${domain} \
8138                   ${sender_address}
8139                pipe_as_creator</PRE>
8140 <P>
8141            <B><B>/usr/local/tpc/tpcmailer.pl</B></B> is the mail processing script that can
8142            be obtained from the TPC distribution.
8143
8144 </P>
8145 <P>
8146        (3) Set up the following director:
8147
8148 </P>
8149 <PRE>
8150              tpc_director:
8151                driver = smartuser
8152                transport = tpc
8153                domains = partial-lsearch;/etc/mail/tpc.domains</PRE>
8154 <P>
8155        Of course, there are other things to do as well before your system is
8156        a functioning TPC server.
8157
8158 </P>
8159 <A NAME="SEC349" HREF="FAQ.html#TOC349">Q9802</A>: How do I configure Exim so that it sends mail to the outside world only
8160        from a restricted list of our local users?
8161
8162
8163 <P>
8164 A9802: There are several possible ways that this can be done.
8165
8166 </P>
8167 <P>
8168        (A) You can restrict the senders directly by putting a setting such as
8169            this one on all the drivers that route to the outside (usually this
8170            is just the final <B>lookuphost</B> router):
8171
8172 </P>
8173 <PRE>
8174              senders = :^[^@]+@(?!${rxquote:your.domain}\$):\
8175                        lsearch;/permitted/senders</PRE>
8176 <P>
8177            The first item in this list is empty, to match the empty sender.
8178            This is necessary because bounce messages have null senders. The
8179            second item is a regular expression that matches any address whose
8180            domain is <EM>not</EM> your domain. This caters for cases when mail from
8181            an external user has arrived for a local user who has forwarding
8182            set up to some outside address.
8183
8184 </P>
8185 <P>
8186            If the first two items do not match (that is, the address is in your
8187            domain) the sender is looked up in a file of permitted senders; each
8188            item in the file must be a complete address, including the domain.
8189            If the sender is unacceptable, an "unrouteable mail domain" error
8190            will occur because the router won't run, and there are no more to
8191            try.
8192
8193 </P>
8194 <P>
8195        (B) If your local users are in many domains, it may be easier to use a
8196            <TT>condition</TT> option to test the domain and local part independently,
8197            along these lines:
8198
8199 </P>
8200 <PRE>
8201              condition = \
8202                ${lookup{${domain:$sender_address}}lsearch{/domain/list}\
8203                {\
8204                  ${lookup{${local_part:$sender_address}}lsearch\
8205                  {/permitted/senders}{yes}{no}}\
8206                }\
8207                {yes}}</PRE>
8208 <P>
8209            Obviously other means of testing the domain and local part could be
8210            substituted, for example, by having separate files of valid local
8211            parts for each local domain.
8212
8213 </P>
8214 <P>
8215        (C) If your local users are logged in to your host, you could use a
8216            special group for those that are permitted to mail to the world.
8217            Assuming your groups are defined in <B>/etc/group</B> you could arrange to
8218            look up the group in that file and then check that the sender was in
8219            the group,using something along these lines:
8220
8221 </P>
8222 <PRE>
8223              condition = \
8224                ${lookup{groupname}lsearch{/etc/group}\
8225                {${if match {$value}\
8226                {[:,]${rxquote:${local_part:$sender_address}}(,|\$)}\
8227                {yes}{no}}}{no}}</PRE>
8228 <P>
8229            This is checking the local part of the sender; a alternative might
8230            be to check <B><B>$sender_ident.</B></B> However, you should really also check
8231            that <B>$sender_host_address</B> is either unset or set to 127.0.0.1 or
8232            your IP address, so you check only locally-originated mail.
8233
8234 </P>
8235 <P>
8236            A block like this does not prevent a logged in user from sending
8237            mail by telnetting to another host's SMTP port, or indeed from
8238            installing a private version of Exim to do the job for her.
8239
8240 </P>
8241 <P>
8242        (D) On a gateway server that has no local users and so receives all the
8243            mail via SMTP from client hosts, you could use a rewriting rule to
8244            rewrite sender addresses in your local domain from a table of legal
8245            local parts, replacing any illegal addresses with an address such as
8246            <B><B>unknown@your.domain</B>.</B> If this is combined with <TT>sender_verify=true</TT>
8247            it causes messages from users that are not in the table to be
8248            refused, assuming that the gateway is capable of verifying the local
8249            part of <B><B>user@your.domain</B>.</B>
8250
8251 </P>
8252 <A NAME="SEC350" HREF="FAQ.html#TOC350">Q9803</A>: How do I configure Exim to run with SmartList?
8253
8254
8255 <P>
8256 A9803: This is what was done for Exim's own mailing list, using SmartList/
8257        procmail 3.11pre7. It runs as its own user - trying to manage mailing
8258        lists under your own ID can be hard work. Smartlist is installed into
8259        <B>/var/spool/slist</B>, and there is an slist user defined. Each list appears
8260        as a directory under <B>/var/spool/slist</B> (as per usual for Smarlist).
8261        Exim is configured like this:
8262
8263 </P>
8264 <PRE>
8265          # slist added to list of trusted users so it can
8266          # manipulate sender addresses</PRE>
8267 <PRE>
8268          trusted_users = exim:slist</PRE>
8269 <PRE>
8270          # in transports, a list transport is defined:</PRE>
8271 <PRE>
8272          list_transport:
8273            driver = pipe
8274            command = /var/spool/slist/.bin/flist \
8275                      ${local_part}${local_part_suffix}
8276            current_directory = /var/spool/slist
8277            home_directory = /var/spool/slist
8278            user = slist
8279            group = slist</PRE>
8280 <PRE>
8281          # in directors a list director is defined:</PRE>
8282 <PRE>
8283          list_director:
8284            driver = smartuser
8285            suffix = -request
8286            suffix_optional
8287            local_parts = !.bin:!.etc
8288            require_files = /var/spool/slist/${local_part}/rc.init
8289            transport = list_transport</PRE>
8290 <P>
8291        and thats it - no aliases, no special handling of out lists etc.
8292        What you do need is to ensure that choplist is used for distribution
8293        (that is, do not uncomment the <TT>alt_sendmail</TT> entry which is blank).
8294
8295 </P>
8296 <P>
8297        A couple of other things are forced - for example since the list runs in
8298        its own domain the domain value is forced to <B>exim.org.</B>
8299
8300 </P>
8301 <P>
8302        Then everything else is basic SmartList configuration - and that's
8303        moderately well documented. A confirmation stage on signup was added -
8304        now when you subscribe you are sent a confirmation which you must
8305        return before the system subscribes you (this prevents people
8306        subscribing their "friends" and makes sure that the addresses really do
8307        work). The confirm package is available at:
8308
8309 </P>
8310 <PRE>
8311           <A HREF="ftp://ftp.fatfree.com/confirm-1.1.tar.gz">ftp://ftp.fatfree.com/confirm-1.1.tar.gz</A></PRE>
8312 <P>
8313        and was written by Michelle Dick.
8314
8315 </P>
8316 <A NAME="SEC351" HREF="FAQ.html#TOC351">Q9804</A>: How do I configure Exim to minic PP's "tripnote" facility?
8317
8318
8319 <P>
8320 A9804: See C006.
8321
8322 </P>
8323 <A NAME="SEC352" HREF="FAQ.html#TOC352">Q9805</A>: How do I configure Exim to handle local parts with extensions?
8324
8325
8326 <P>
8327 A9805: See C010.
8328
8329 </P>
8330 <A NAME="SEC353" HREF="FAQ.html#TOC353">Q9806</A>: How do I configure Exim so that only a restricted list of users can
8331        receive mail from external domains?
8332
8333
8334 <P>
8335 A9806: See C013.
8336
8337 </P>
8338 <A NAME="SEC354" HREF="FAQ.html#TOC354">Q9807</A>: I have <B><B>someuser@mydomain.com</B></B> that I only want certain users to be able
8339        to mail to. How do I accomplish this?
8340
8341
8342 <P>
8343 A9807: This is a transport:
8344
8345 </P>
8346 <PRE>
8347          bounce:
8348            driver  = autoreply
8349            from    = postmaster@mydomain.com
8350            to      = $sender_address
8351            user    = exim
8352            subject = "Re: Your mail to ${local_part}"
8353            text    = "You are not allowed to mail to ${local_part}."</PRE>
8354 <P>
8355        This is a director that should come before all the others:
8356
8357 </P>
8358 <PRE>
8359          special_user:
8360            driver = smartuser
8361            local_parts = someuser
8362            transport = bounce
8363            senders = !: !lsearch;/list/of/permitted/senders</PRE>
8364 <P>
8365        Note that leading "!:" in senders. It allows the null sender &#60;&#62; to be
8366        valid (i.e. not to match this director). This is necessary, since bounce
8367        messages have null senders. All other permitted senders must be in the
8368        file as complete addresses, including a domain.
8369
8370 </P>
8371 <A NAME="SEC355" HREF="FAQ.html#TOC355">Q9808</A>: A site for which I provide secondary MX is down for some time. Is there
8372        a way to run the queue for that destination separately from the main
8373        queue?
8374
8375
8376 <P>
8377 A9808: No, because Exim does not have the concept of "the queue for that
8378        destination". It simply has a single pool of messages awaiting delivery
8379        (and some of them may have several destinations). The best approach to
8380        this is to arrange for all messages for the site to be saved somewhere
8381        other than the main spool, either on a separate dedicated MTA, or in
8382        BSMTP files. There is an example of the latter approach in C014.
8383
8384 </P>
8385 <A NAME="SEC356" HREF="FAQ.html#TOC356">Q9809</A>: How do I implement VERP (Variable Envelope Return Paths) in Exim?
8386
8387
8388 <P>
8389 A9809: See C017.
8390
8391 </P>
8392 <A NAME="SEC357" HREF="FAQ.html#TOC357">Q9810</A>: I'd like to make a copy of all outgoing messages to a local mailbox. Is
8393        there a solution for this using an Exim filter?
8394
8395
8396 <P>
8397 A9810: The following filter makes a copy of every message, except for delivery
8398        failure reports:
8399
8400 </P>
8401 <PRE>
8402          # Exim filter</PRE>
8403 <PRE>
8404          # Ignore error messages
8405          if error_message then finish endif</PRE>
8406 <PRE>
8407          # Copy if this is the first delivery attempt
8408          if first_delivery then
8409            unseen deliver copy@your.domain errors_to postmaster@your.domain
8410          endif</PRE>
8411 <P>
8412        The keyword "unseen" stops this being a "significant delivery", so that
8413        the message goes on to be delivered as normal. The <TT>errors_to</TT> setting
8414        changes the envelope sender on the copy so that if there is a problem
8415        delivering it, the bounce message is sent to postmaster.
8416
8417 </P>
8418 <P>
8419        You can add to the condition setting to select specific messages.
8420        To make a copy of outgoing messages only requires a definition
8421        of "outgoing". Because a message may have many recipients, simply
8422        testing for your own domain in both the From: and the To: headers is not
8423        enough. You can craft your own conditions, but here is one suggestion:
8424
8425 </P>
8426 <PRE>
8427          if $h_from: contains your.domain and
8428              foranyaddress $h_to:,$h_cc:
8429                ($thisaddress does not contain your.domain)
8430          then
8431            unseen deliver copy@your.domain errors_to postmaster@your.domain
8432          endif</PRE>
8433 <P>
8434        This takes copies of messages whose From: header contains <B>your.domain</B>
8435        and whose To: and Cc: headers contain at least one address that does not
8436        contain <B>your.domain.</B> See also 
8437         <A HREF="FAQ.html#SEC364">Q9817</A>.
8438
8439 </P>
8440 <A NAME="SEC358" HREF="FAQ.html#TOC358">Q9811</A>: I want to make a copy of outgoing messages to a specific file for each
8441        user in a specific directory, using a "save" command in a system filter.
8442        How can I arrange for Exim to write to these files under the correct
8443        UID/GID?
8444
8445
8446 <P>
8447 A9811: You need to set up a special transport and tell Exim to use it for
8448        file deliveries from the system filter. Add the following setting to
8449        your configuration:
8450
8451 </P>
8452 <PRE>
8453          message_filter_file_transport = copy_transport</PRE>
8454 <P>
8455        Then define <TT>copy_transport</TT> like this
8456
8457 </P>
8458 <PRE>
8459          copy_transport:
8460            driver = appendfile
8461            delivery_date_add
8462            envelope_to_add
8463            user = ${local_part:$sender_address}</PRE>
8464 <P>
8465        This assumes that you want to run the delivery under the uid associated
8466        with the local part of the sender address. Alternatively, you could just
8467        use <TT>user=exim</TT> and do all the writing under the same UID/GID.
8468
8469 </P>
8470 <A NAME="SEC359" HREF="FAQ.html#TOC359">Q9812</A>: How can I keep an archive of all mail for some specific local email
8471        addresses?
8472
8473
8474 <P>
8475 A9812: You could use a system filter, along the lines of
8476
8477 </P>
8478 <PRE>
8479          if
8480            first_delivery and &#60;tests for appropriate addresses&#62;
8481          then
8482            unseen save
8483              /mail/archive/${substr_0_10:$tod_log}
8484          endif</PRE>
8485 <P>
8486        That would create a new file for each day. However, in order to use
8487        this, you will need to set <TT>message_filter_file_transport</TT> to point to an
8488        appropriate transport which includes a setting of "user" to specify
8489        which uid to run the saving under, as is described in 
8490         <A HREF="FAQ.html#SEC358">Q9811</A>.
8491
8492 </P>
8493 <A NAME="SEC360" HREF="FAQ.html#TOC360">Q9813</A>: How can I configure Exim to provide a vacation message when there are
8494        no local users on my mail hub?
8495
8496
8497 <P>
8498 A9813: See C019.
8499
8500 </P>
8501 <A NAME="SEC361" HREF="FAQ.html#TOC361">Q9814</A>: We want to be able to temporarily lock out a user by disabling the
8502        password and moving the home directory to another place. How can we
8503        arrange to reject mail for users in this state?
8504
8505
8506 <P>
8507 A9814: Change the home directory pointer in the passwd file to something
8508        distinctive. For example, we use <B>/home/CANCELLED</B> for cancelled users.
8509        Then you can pick up such users with this director, which is placed
8510        immediately after <TT>system_aliases</TT>:
8511
8512 </P>
8513 <PRE>
8514          cancelled_users:
8515            driver = localuser
8516            transport = cancelleduser_pipe
8517            fail_verify
8518            match_directory = /home/CANCELLED</PRE>
8519 <P>
8520        This sends messages for cancelled users to the following special
8521        transport:
8522
8523 </P>
8524 <PRE>
8525          cancelleduser_pipe:
8526            driver = pipe
8527            command = "/opt/exim/util/cancelleduser.sh"
8528            ignore_status
8529            return_output
8530            user = nobody</PRE>
8531 <P>
8532        The script simply generates a message saying that the user is cancelled
8533        on its standard output. This gets returned to the original message
8534        sender in an error report.
8535
8536 </P>
8537 <P>
8538        If you don't want to change the home directory in the passwd file,
8539        an alternative is to check for the non-existence of the home directory
8540        with
8541
8542 </P>
8543 <PRE>
8544          require_files = +!$home</PRE>
8545 <P>
8546        instead of setting <TT>match_directory</TT>.
8547
8548 </P>
8549 <A NAME="SEC362" HREF="FAQ.html#TOC362">Q9815</A>: I need an alias, say "fakeaddress" that should receive a message,
8550        strip all reply-to: headers present, substitute another one pointing to
8551        "otheraddress" and forward a message to "realaddress".
8552
8553
8554 <P>
8555 A9815: Add this director:
8556
8557 </P>
8558 <PRE>
8559          fakeaddress_director:
8560            driver = smartuser
8561            domain = (if necessary to restrict the domain)
8562            local_parts = fakeaddress
8563            headers_remove = reply-to
8564            headers_add = reply-to: otheraddress
8565            new_address = realaddress</PRE>
8566 <P>
8567        If there are several of these aliases then you could list them in a file
8568        along with the corresponding other addresses, and use lookups instead of
8569        the fixed values shown above.
8570
8571 </P>
8572 <A NAME="SEC363" HREF="FAQ.html#TOC363">Q9816</A>: How can I set up Exim to work with Listar?
8573
8574
8575 <P>
8576 A9816: See <B><A HREF="http://www.cs.huji.ac.il/~vadik/listar-exim/.">http://www.cs.huji.ac.il/~vadik/listar-exim/.</A></B>
8577
8578 </P>
8579 <A NAME="SEC364" HREF="FAQ.html#TOC364">Q9817</A>: I need to take copies of all incoming and outgoing mail for certain
8580        users. For each user there may be a different monitoring address.
8581
8582
8583 <P>
8584 A9817: You can adapt the filter solution given in 
8585         <A HREF="FAQ.html#SEC357">Q9810</A> by adding a test for
8586        the relevant local parts. Create a file containing lines like this:
8587
8588 </P>
8589 <PRE>
8590          user1@domain1:   monitor1@monitor.domain1
8591          user2@domain2:   monitor2@monitor.domain2</PRE>
8592 <P>
8593        and then use the following command in a system filter:
8594
8595 </P>
8596 <PRE>
8597          if ${lookup{$sender_address}lsearch{/some/file}{$value}{}} is not ""
8598          then
8599            unseen deliver ${lookup{$sender_address}lsearch{/some/file}{$value}}
8600              errors_address = postmaster@your.domain
8601          else
8602            if foranyaddress $recipients
8603              (${lookup{$thisaddress}lsearch{/some/file}{$value}{}} is not "")
8604            then
8605              unseen deliver ${lookup{$thisaddress}lsearch{/some/file}{$value}}
8606                errors_address = postmaster@your.domain
8607            endif
8608          endif</PRE>
8609 <P>
8610        It is messy to have to repeat the lookups, but it won't be inefficient,
8611        because Exim caches the results of successful lookups.
8612
8613 </P>
8614 <A NAME="SEC365" HREF="FAQ.html#TOC365">Q9818</A>: How can I add a disclaimer to the end of every message?
8615
8616
8617 <P>
8618 A9818: See 
8619         <A HREF="FAQ.html#SEC265">Q1501</A>.
8620
8621 </P>
8622 <A NAME="SEC366" HREF="FAQ.html#TOC366">Q9819</A>: I would like to append a simple advertisement text to all outgoing
8623        and local mails.
8624
8625
8626 <P>
8627 A9819: See 
8628         <A HREF="FAQ.html#SEC265">Q1501</A>.
8629
8630 </P>
8631 <A NAME="SEC367" HREF="FAQ.html#TOC367">Q9820</A>: How can I configure Exim so that all mails adressed to
8632        <B><B>something@username.domain.net</B></B> get delivered to <B>/var/spool/mail/username</B>?
8633
8634
8635 <P>
8636 A9820: There are several possibilities, depending on exactly how you are set
8637        up. Here is one approach: First, arrange that all the domains you are
8638        interested in are local domains, for example, by listing them in a file:
8639
8640 </P>
8641 <PRE>
8642          local_domains = /list/of/domains</PRE>
8643 <P>
8644        If there are lots of them, a DBM or cdb file should be used for a faster
8645        lookup. Assuming that "username" is set up as a user on your system, and
8646        you have a configuration that can handle <B><B>username@domain.net</B></B> in the
8647        normal way, all you have to do is to arrange to convert the recipient
8648        address by means of a <B>smartuser</B> director like this:
8649
8650 </P>
8651 <PRE>
8652          user_in_domain:
8653            driver = smartuser
8654            domains = /list/of/domains
8655            new_address = ${if match{$domain}{^([^.]+)\\.domain\\.net\$}{$1}fail}@domain.net</PRE>
8656 <P>
8657        This should be the first director.
8658
8659 </P>
8660 <A NAME="SEC368" HREF="FAQ.html#TOC368">Q9821</A>: How do I get exim not to add a Sender: header to locally originated
8661        mail?
8662
8663
8664 <P>
8665 A9821: It only adds it if the From: header doesn't correspond to the user
8666        sending the message. From release 3.14 onwards, you can suppress this
8667        by setting <TT>no_local_from_check</TT>. Alternatively,
8668
8669 </P>
8670 <P>
8671        (1) You can get it removed later, by putting
8672
8673 </P>
8674 <PRE>
8675          headers_remove = Sender</PRE>
8676 <P>
8677        on all your transports. This doesn't test for locally originated mail,
8678        but you could use a more complicated expansion string to make that test.
8679        For example
8680
8681 </P>
8682 <PRE>
8683          headers_remove = ${if eq{$sender_host_address}{}{Sender}}</PRE>
8684 <P>
8685        which removes it only if there is no sending host address.
8686
8687 </P>
8688 <P>
8689        (2) If your <EM>real</EM> question "how do I submit mail from UUCP
8690        without it adding Sender:?" Then see 
8691         <A HREF="FAQ.html#SEC185">Q0603</A>.
8692
8693 </P>
8694 <A NAME="SEC369" HREF="FAQ.html#TOC369">Q9822</A>: How can I get Exim to work with mailman?
8695
8696
8697 <P>
8698 A9822: The configuration in <B><A HREF="http://www.exim.org/howto/mailman.html">http://www.exim.org/howto/mailman.html</A></B> was used for
8699        the Exim mailing list before it switched to SmartList.
8700
8701 </P>
8702 <A NAME="SEC370" HREF="FAQ.html#TOC370">Q9823</A>: Is there any way to have messages sent to a specific local address
8703        delayed by - say - 24 hours?
8704
8705
8706 <P>
8707 A9823: Using Exim 3.10 or later, the answer is "yes". Set up a <B>smartuser</B>
8708        director like this:
8709
8710 </P>
8711 <PRE>
8712          delay:
8713            driver = smartuser
8714            domains = the.domain
8715            local_parts = thelocalpart
8716            condition = ${if &#60; ${$message_age}{86400}{yes}{no}}
8717            new_address = :defer: message not old enough</PRE>
8718 <P>
8719        Of course, this will also have the effect of setting a retry time for
8720        the address. You may want to set a special retry rule for it.
8721
8722 </P>
8723 <A NAME="SEC371" HREF="FAQ.html#TOC371">Q9824</A>: I have a mailing list exploder on one host, and three other hosts where
8724        I want to do the actual deliveries from. How can I get Exim to split
8725        a message into groups of recipients between the three hosts?
8726
8727
8728 <P>
8729 A9824: Splitting into groups of recipients can be done by setting <TT>max_rcpt</TT> in
8730        the SMTP transport. Persuading Exim to spread the groups between three
8731        hosts is a little harder. Suppose you have 300 addresses, and <TT>max_rcpt</TT>
8732        is set to 100. One approach is to try <TT>hosts_randomize</TT> in a <B>domainlist</B>
8733        router, like this:
8734
8735 </P>
8736 <PRE>
8737          split:
8738            driver = domainlist
8739            transport = remote_smtp
8740            hosts_randomize
8741            route_list = *  hostA:hostB:hostC  byname</PRE>
8742 <P>
8743        Unfortunately, this doesn't work quite as you might expect. There are
8744        six different permutations of the host list, and so if the randomizing
8745        works perfectly, Exim will end up with
8746
8747 </P>
8748 <PRE>
8749          50 addresses routed to hostA:hostB:hostC
8750          50 addresses routed to hostA:hostC:hostB
8751          50 addresses routed to hostB:hostC:hostA
8752          50 addresses routed to hostB:hostA:hostC
8753          50 addresses routed to hostC:hostA:hostB
8754          50 addresses routed to hostC:hostB:hostA</PRE>
8755 <P>
8756        Although a total of 100 addresses have hostA as their first host, Exim
8757        will still send them in two separate SMTP calls, because it can only
8758        batch up addresses that have identical host lists. If hostA is down, it
8759        will send 50 of these to host B and 50 to host C. It will aways send six
8760        copies of the message.
8761
8762 </P>
8763 <P>
8764        With only three hosts, this isn't a major problem, but if the number of
8765        hosts increases, it becomes more serious. If there are four delivery
8766        hosts, there are 24 different permuations, and with five hosts there are
8767        120, so 120 messages are sent. When the hosts are not all of the same
8768        power, you might want to use a list like
8769
8770 </P>
8771 <PRE>
8772          hostA:hostA:hostA:hostB:hostB:hostC</PRE>
8773 <P>
8774        to send more to hostA, and this makes the situation worse. There is,
8775        however, a way to solve this. Instead of putting the host list on the
8776        router, put it on the transport. The router just contains one host:
8777
8778 </P>
8779 <PRE>
8780          split:
8781            driver = domainlist
8782            transport = special_smtp
8783            route_list = *  hostA  byname</PRE>
8784 <P>
8785        and the transport has the full list, set to override the router's host:
8786
8787 </P>
8788 <PRE>
8789          special_smtp:
8790            driver = smtp
8791            hosts = hostA:hostA:hostA:hostB:hostB:hostC
8792            hosts_override
8793            hosts_randomize
8794            max_rcpt = 100</PRE>
8795 <P>
8796        Now all 300 addresses are routed to the same host, so they are sent to
8797        the transport 100 at a time. The transport overrides the router's host
8798        with its own list, which it randomizes each time. (This works only for
8799        releases of Exim after 3.16 - up to and including that release, there is
8800        a bug that prevents it re-randomizing for each group.) See also C040.
8801
8802 </P>
8803 <BR><H2><A NAME="SEC372" HREF="FAQ.html#TOC372">99. LIST OF SAMPLE CONFIGURATIONS
8804
8805 </A></H2>
8806 <P>
8807 Each sample configuration is held in a separate file in the <B>config.samples</B>
8808 directory. Those with names of the form Cnnn are Exim configurations; those
8809 with names of the form Fnnn are filter file fragments.
8810
8811 </P>
8812 <P>
8813 C001:  "This config will support delivery across multiple systems using NIS to
8814        look up delivery addresses from the <B>mail.aliases</B> database."
8815
8816 </P>
8817 <P>
8818 C002:  "Although exim not intended for use in UUCP environment (it doesn't
8819        know anything about bang!path addresses), I'm successfully using it for
8820        delivering mail to UUCP clients."
8821
8822 </P>
8823 <P>
8824 C003:  "I've read down through 
8825         <A HREF="FAQ.html#SEC183">Q0601</A> and your request for UUCP examples. Here's
8826        how I'm doing it." (This example uses routers.)
8827
8828 </P>
8829 <P>
8830 C004:  "Here's a BSMTP over UUCP [configuration] - the transport is Taylor/GNU
8831        UUCP - which takes the long option types." (This example uses
8832        directors.)
8833
8834 </P>
8835 <P>
8836 C005:  "I am using a virus scanner program that is invoked by a pipe, scans the
8837        mail and re-invokes Exim to do the delivery. The pipe is invoking a perl
8838        script that tries to unpack and MIME, zip and other archives and then
8839        applies the McAfee scanner on the results."
8840
8841 </P>
8842 <P>
8843 C006:  "This is how I have configured a PP-inspired vacationnote, there is
8844        (was?) such a feature in PP. The user makes a file "tripnote" in his/her
8845        home directory, the message is passed to the sender once with a short
8846        leading text."
8847
8848 </P>
8849 <P>
8850 C007:  "If I host a domain <B>foo.dom</B> on my machine as a virtual domain I expect
8851        it to be completely virtual and separate from other mail domains that
8852        end up on my machine."
8853
8854 </P>
8855 <P>
8856 C008:  "And of course it is possible to do a very interesting solution to
8857        this [virtual domains] using LDAP."
8858
8859 </P>
8860 <P>
8861 C009:  "These are suggested parts of a configuration for looking up users in
8862        <B><B>/etc/passwd.domain</B></B> rather than in <B>/etc/passwd</B> ..."
8863
8864 </P>
8865 <P>
8866 C010:  "One of our customers is looking for us to support addresses of the form
8867        <B><B>username+extension@domain.com</B>,</B> primarily for use with procmail."
8868
8869 </P>
8870 <P>
8871 C011:  "Thanks to Philip and others I now have my ISP style config built and
8872        therefore am posting the final configuration fragments to the list in
8873        case anyone else wants to do a similar thing."
8874
8875 </P>
8876 <P>
8877 C012:  "I've written a small chapter how-to configure Exim for use with UUCP
8878        (mostly condensed from the exim-user mailing list plus some
8879        experimenting) and would be glad if it could be included in the Exim
8880        documentation."
8881
8882 </P>
8883 <P>
8884 C013:  "I've take some tips from the FAQ about permitting only certain users
8885        to send to external mail and came up with my own for the receiving
8886        part."
8887
8888 </P>
8889 <P>
8890 C014:  "If I have a situation where a site I MX for has a known outage I stash
8891        all their mail into a directory in BSMTP format."
8892
8893 </P>
8894 <P>
8895 C015:  "This approach to virtual domains has helped me a great deal, and is so
8896        easy to maintain (add and modify as appropriate)."
8897
8898 </P>
8899 <P>
8900 C016:  "Herewith my configuration." (A complete configuration, including simple
8901        virtual domains, along the lines of C015).
8902
8903 </P>
8904 <P>
8905 C017:  "I have gotten the new VERP feature of Exim 2.054 working in test, along
8906        with some supporting programs to handle bounces that do come back."
8907
8908 </P>
8909 <P>
8910 C018:  "This Majordomo configuration removes a lot of the aliases, and
8911        automates a lot of the other functions based on whether the files or
8912        directories exist."
8913
8914 </P>
8915 <P>
8916 C019:  "The following configuration file entries can be used to provide a
8917        'vacation'-style function for a mailhub which has no local users."
8918
8919 </P>
8920 <P>
8921 C020:  "I was asked for a copy of the programs we were using to mail
8922        everybody."
8923
8924 </P>
8925 <P>
8926 C021:  "Here is some sample code that might be useful for handling
8927        X-Failed-Recipients headers generated by Exim, with mailing lists."
8928
8929 </P>
8930 <P>
8931 C022:  "This is the Exim configuration file of a machine which delivers mail to
8932        several local domains where the mail is delivered locally, several hairy
8933        domains, handled as described below, and a half-virtual domain, which is
8934        first processed by its special alias file, then processed as other local
8935        domains (including the processing by the global alias file)."
8936
8937 </P>
8938 <P>
8939 C023:  A Perl script and instructions for hooking it into Exim in order to
8940        handle disposition-notification-to and return-receipt-to by using a
8941        shadow transport to send copies of delivered messages to the script.
8942
8943 </P>
8944 <P>
8945 C024:  "In case anybody wants to use a MySql database to store aliases this is
8946        how I managed to get my site working."
8947
8948 </P>
8949 <P>
8950 C025:  "As promised here is the way I got Exim to delver to Cyrus mailboxes if
8951        the user exists in the MySql database."
8952
8953 </P>
8954 <P>
8955 C026:  "The following configuration and program will allow messages going to
8956        AOL only, to be filtered thru a Perl script. This Perl script will
8957        convert any URL's to the HTML syntax. In addition, the transport will
8958        use VERP to send a unique envelope sender with each message."
8959
8960 </P>
8961 <P>
8962 C027:  "This is an FYI to demonstrate how to have exim work with SSL using the
8963        stunnel wrapper and its underlying OpenSSL libraries and toolkit."
8964
8965 </P>
8966 <P>
8967 C028:  "This Python script reads from stdin and writes to stdout. It strips all
8968        the MIME attachments from a mail message that are one of the mime types
8969        listed on the command line. Exim can use it in its configuration file,
8970        for example, as follows:"
8971
8972 </P>
8973 <P>
8974 C029:  "The standard way to connect one's MTA to a list manager seems to be to
8975        add a set of aliases for <EM>every</EM> list one creates. Once upon a time, I
8976        crufted a set of configs from Smail to work with majordomo, to
8977        automaticaly recognize the standard patterns, for all lists in
8978        existence...I have setup a set of transports and directors for Exim,
8979        which will do the same thing for mailman."
8980
8981 </P>
8982 <P>
8983 C030:  "I am currently configuring an exim for a site that will to mail
8984        hosting for several domains. I want the domain holders to have control
8985        over 'their' alias files, being able to create their own aliases.
8986        However, I don't want them to have postmaster, abuse and other role
8987        accounts under their control."
8988
8989 </P>
8990 <P>
8991 C031:  "These are config file snippets for handling certain remote addresses as
8992        local, and making only real external addresses visible to users."
8993
8994 </P>
8995 <P>
8996 C032:  "This is the Exim Nervous Mailbox Quota Suite.  It does not impose
8997        hard quotas on users' mailboxes, but it makes a user nervous by
8998        putting all his mail in a secondary mailbox, inaccessible to the
8999        user, when he is over his quota.  When the user clears his
9000        mailbox (i.<B>e.,</B> deletes mail to make his mailbox below the quota
9001        again), mail from his secondary mailbox is transferred back to
9002        his primary mailbox, in FIFO order."
9003
9004 </P>
9005 <P>
9006 C033:  "Here's our current automatic vacation recipe".
9007
9008 </P>
9009 <P>
9010 C034:  "This is a HOW-TO for setting up Exim to support SMTP authentication
9011        under different environments, including regular password files, PAM
9012        and NIS."
9013
9014 </P>
9015 <P>
9016 C035:  "These configurations enable exim and hylafax <B>(www.hylafax.org)</B>  work
9017        together, I mean sending fax by email <B><B>(user@123456.fax</B>)."</B>
9018
9019 </P>
9020 <P>
9021 C036:  "My aim was to have an LDAP-driven system for mail delivery."
9022
9023 </P>
9024 <P>
9025 C037:  An elegant way of using ETRN, which does immediate delivery if the host
9026        is online, but saves mail in a BSMTP file after some time on the queue.
9027        ETRN then re-injects the mail.
9028
9029 </P>
9030 <P>
9031 C038:  Amavis virus scanning: "Here ya go. This is the config we use... this
9032        box is our main MX host then relays it to our real server for delivery."
9033
9034 </P>
9035 <P>
9036 C039:  "For reference, this is how I got PAM authentication from a standard
9037        UNIX password database with Eudora 4.3 clients to work on a Debian 2.2
9038        (Intel) system. This configuration assumes that you are using standard
9039        UNIX crypt passwords; pam-pwdfile is NOT compatible with MD5 encrypted
9040        passwords."
9041
9042 </P>
9043 <P>
9044 C040:  "Exim 3.20 has a feature that allows a large mailing of a single message
9045        to be sent to many different relays. This is useful for mailing lists,
9046        as it allows the message to be relayed to multiple machines, in groups
9047        of 100 addresses, for final delivery."
9048
9049 </P>
9050 <P>
9051 C041:  "Attached you will find a plain text file where I explain how to set up
9052         mailman to use virtual environment (single setup for many domains)."
9053
9054 </P>
9055 <P>
9056 F001:  "I thought that the rest of the list may be interested in reviewing our
9057        filter as a starting point for their own system message filter."
9058
9059 </P>
9060 <P>
9061 F002:  "... program which refused mail from unknown addresses until they mailed
9062        me promising not to spam me ... since I'd already thought through how
9063        to do it in Exim, and knew it'd be slightly easier than falling out of
9064        bed, I went ahead and did it."
9065
9066 </P>
9067 <P>
9068 F003:  "Here's four checks installed in our system wide filter that knock out
9069        a lot of otherwise hard to detect rubbish."
9070
9071 </P>
9072 <P>
9073 F004:  "This is an Exim filter snippet to change locally-generated Message-Id:
9074        and Resent-Message-Id: headers to world-unique values."
9075
9076 </P>
9077 <HR>
9078
9079 </BODY>
9080 </HTML>