]> Pileus Git - ~andy/fetchmail/blob - fetchmail-FAQ.html
Try to fix the build code.
[~andy/fetchmail] / fetchmail-FAQ.html
1 <!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>The Fetchmail FAQ</TITLE>
5 <link rev=made href=mailto:esr@snark.thyrsus.com>
6 <meta name="description" content="Frequently asked questions about fetchmail.">
7 <meta name="keywords" content="fetchmail, POP, POP2, POP3, IMAP, remote mail"> 
8 </HEAD>
9 <BODY>
10 <H1>Frequently Asked Questions About Fetchmail</H1>
11
12 The current version of fetchmail is 4.0.1.<P>
13
14 New in the FAQ: A misfeature introduced in recent versions of smail
15 breaks fetchmail, but there is a workaround.  See question <a
16 href="#T3">T3</a>.<P>
17
18 Before reporting any bug, please read <a href="#G3">G3</a> for advice
19 on how to include diagnostic information that will get your bug fixed
20 as quickly as possible. <p>
21
22 If you have a question or answer you think ought to be added to this FAQ list,
23 mail it to fetchmail's maintainer, Eric S. Raymond, at
24 <A HREF="mailto:esr@thyrsus.com">esr@snark.thyrsus.com</A>.<p>
25
26 <a href="mailto:funk+@osu.edu">Rob Funk</a> and <a
27 href="mailto:alberty@apexxtech.com">Al Youngwerth</a> are fetchmail's
28 designated backup maintainers.  Other backup maintainers may be added
29 in the future, in order to ensure continued support should Eric S.
30 Raymond drop permanently off the net for any reason.<P>
31
32 There is a fetchmail-friends list for people who want to discuss fixes
33 and improvements in fetchmail and help co-develop it.  It's at 
34 <a href="mail:fetchmail-friends@thyrsus.com">fetchmail-friends@thyrsus.com</a>
35 and is a SmartList reflector; sign up in the usual way with a message
36 containing the word "subscribe" in the subject line sent to
37 to <a href="mail:fetchmail-friends-request@thyrsus.com">
38 fetchmail-friends-request@thyrsus.com</a>. (Similarly, "unsubscribe"
39 in the Subject line unsubscribes you, and "help" returns general list help) <p>
40
41 There is a fetchmail home page at <a href="http://www.ccil.org/~esr">
42 http://www.ccil.org/~esr</a>.<P>
43
44 <h1>General questions:</h1>
45
46 <a href="#G1">G1. What is fetchmail and why should I bother?</a><br>
47 <a href="#G2">G2. Where do I find the latest FAQ and fetchmail sources?</a><br>
48 <a href="#G3">G3. I think I've found a bug.  Will you fix it?</a><br>
49 <a href="#G4">G4. I have this idea for a neat feature. Will you add it?</a><br>
50 <a href="#G5">G5. So, what's this I hear about a fetchmail paper?</a><br>
51
52 <h1>Fetchmail configuration file grammar questions:</h1>
53
54 <a href="#F1">F1. Why does my .fetchmailrc from 3.9 or earlier no longer work?</a><br>
55 <a href="#F2">F2. The .fetchmailrc parser won't accept my all-numeric user name.</a><br>
56 <a href="#F3">F3. The .fetchmailrc parser won't accept my host or username beginning with `no'.</a><br>
57 <a href="#F4">F4. I'm migrating from popclient.  How do I need to modify my .poprc?</a><br>
58
59 <h1>Configuration questions:</h1>
60
61 <a href="#C1">C1. Why do I need a .fetchmailrc when running as root on my own machine?</a><br>
62 <a href="#C2">C2. How can I arrange for a fetchmail daemon to get killed when I log out?</a><br>
63 <a href="#C3">C3. How do I know what interface and address to use with --interface?</a><br>
64 <a href="#C4">C4. How can I get fetchmail to work with ssh?</a><br>
65 <a href="#C5">C5. How can I set up support for sendmail's anti-spam 571 response?</a><br>
66 <a href="#C6">C6. How can I do automatic startup/shutdown of fetchmail
67 when I may have multiple login sessions going?</a><br>
68
69 <h1>Configuration tips for non-sendmail MTAs</h1>
70
71 <a href="#T1">T1. How can I use fetchmail with qmail?</a><br>
72 <a href="#T2">T2. How can I use fetchmail with exim?</a><br>
73 <a href="#T3">T3. How can I use fetchmail with smail?</a><br>
74 <a href="#T4">T4. How can I use fetchmail with Lotus Notes?</a><br>
75
76 <h1>Runtime fatal errors:</h1>
77
78 <a href="#R1">R1. I think I've set up fetchmail correctly, but I'm not getting any mail.</a><br>
79 <a href="#R2">R2. Fetchmail isn't working, and -v shows `SMTP connect failed' messages.</a><br>
80 <a href="#R3">R3. When I try to configure an MDA, fetchmail doesn't work.</a><br>
81 <a href="#R4">R4. Fetchmail dumps core in -V mode, but operates normally otherwise.</a><br>
82 <a href="#R5">R5. Mail that was being fetched when I interrupted my fetchmail seems to have been vanished.</a></br>
83 <a href="#R6">R6. Fetchmail dumps core when I use a .netrc file but works otherwise.</a><br>
84 <a href="#R7">R7. All my mail seems to disappear after an interrupt.</a><br>
85
86 <h1>Multidrop-mode problems:</h1>
87
88 <a href="#M1">M1. I've declared local names, but all my multidrop mail is going to root anyway.</a><br>
89 <a href="#M2">M2. I can't seem to get fetchmail to route to a local domain properly.</a><br>
90 <a href="#M3">M3. I tried to run a mailing list using multidrop, and I have a mail loop!</a><br>
91 <a href="#M4">M4. My multidrop fetchmail seems to be having DNS problems.</a><br>
92 <a href="#M5">M5. I'm seeing long DNS delays before each message is processed.</a><br>
93 <a href="#M6">M6. How do I get multidrop mode to work with majordomo?</a>
94
95 <h1>Mangled mail:</h1>
96
97 <a href="#X1">X1. Why is fetched mail being logged with my name, not the real From address?</a><br>
98 <a href="#X2">X2. Spurious blank lines are appearing in the headers of fetched mail.</a><br>
99 <a href="#X3">X3. My mail client can't see a Subject line.</a><br>
100 <a href="#X4">X4. Messages containing "From" at start of line are being split.</a><br>
101
102 <h1>Other Problems:</h1>
103
104 <a href="#O1">O1. The --logfile option doesn't work if the logfile doesn't exist.</a><br>
105 <a href="#O2">O2. Every time I get a POP or IMAP message the header is
106 dumped to all my terminal sessions.</a><br>
107
108 <h1>Answers:</h1>
109 <hr>
110 <h2><a name="G1">G1. What is fetchmail and why should I bother?</a></h2>
111
112 Fetchmail is a one-stop solution to the remote mail retrieval problem
113 for Unix machines, quite useful to anyone with an intermittent PPP or
114 SLIP connection to a remote mailserver.  It can collect mail using any
115 variant of POP or IMAP and forwards via port 25 to the local SMTP
116 listener, enabling all the normal forwarding/filtering/aliasing
117 mechanisms that would apply to local mail or mail arriving via a
118 full-time TCP/IP connection.<p>
119
120 Fetchmail is not a toy or a coder's learning exercise, but an
121 industrial-strength tool capable of transparently handling every
122 retrieval demand from those of a simple single-user ISP connection up
123 to mail retrieval and rerouting for an entire client domain.
124 Fetchmail is easy to configure, unobtrusive in operation, powerful,
125 feature-rich, and well documented. Extensive testing by a large,
126 multi-platform user community has shown that it is as near bulletproof
127 as the underlying protocols permit.<p>
128
129 If you found this FAQ in the distribution, see the README for fetchmail's
130 full feature list.<p>
131
132 <hr>
133 <h2><a name="G2">G2. Where do I find the latest FAQ and fetchmail
134 sources?</a></h2> 
135
136 The latest HTML faq is available alongside the latest fetchmail
137 sources at the fetchmail home page:
138 <a href="http://www.ccil.org/~esr/fetchmail">
139 http://www.ccil.org/~esr/fetchmail</a>.  You can also find
140 both in the <a
141 href="http://sunsite.unc.edu/pub/Linux/system/mail/pop/!INDEX.html">POP
142 mail tools directory on Sunsite</a>.<p>
143
144 A text dump of this FAQ is included in the fetchmail
145 distribution. Because it freezes at distribution release time, it may
146 not be completely current.<p>
147
148 <hr>
149 <h2><a name="G3">G3.  I think I've found a bug.  Will you fix it?</a></h2>
150
151 Yes I will, provided you include enough diagnostic information for me
152 to go on.  When reporting bugs, please include the following:
153
154 <ol>
155 <li>Your operating system and compiler version.
156 <li>The release and patch level of the fetchmail you are running.  You can see
157     your patchlevel by typing `fetchmail -V'.
158 <li>The output of fetchmail -V (this will not reveal your password).
159 <li>Any command-line options you used.
160 </ol>
161
162 It is helpful if you include your .fetchmailrc, but not necessary
163 unless your symptom seems to involve an error in configuration parsing.<p>
164
165 A transcript of the failed session with -v on is almost always useful.
166 If the bug involves a core dump or hang, a gdb stack trace is good to have.
167 (Bear in mind that you can attach gdb to a running but hung process by
168 giving the process ID as a second argument.)  You will need to
169 reconfigure with <p>
170
171 <LISTING>
172 CFLAGS=-g LDFLAGS=" " ./configure
173 </LISTING>
174
175 and then rebuild in order to generate a version that can br gdb-traced.<p>
176
177 Best of all is a mail file which, when fetched, will reproduce the
178 bug under the latest (current) version.<p>
179
180 Any bug I can reproduce will usually get fixed very quickly, often
181 within 48 hours.  Bugs I can't reproduce are a crapshoot.  If the
182 solution isn't obvious when I first look, it may evade me for a long
183 time (or to put it another way, fetchmail is well enough tested that the
184 easy bugs have long since been found).  So if you want your bug fixed
185 rapidly, it is not just sufficient but nearly <em>necessary</em> that
186 you give me a way to reproduce it.<p>
187
188 <hr>
189 <h2><a name="G4">G4.  I have this idea for a neat feature.  Will you add it?</a></h2>
190
191 Probably not.  Most of the feature suggestions I get are for ways to
192 set various kinds of administrative policy or add more spam filtering
193 (the most common one, which I used to get about four million times a week
194 and got <em>really</em> tired of, is for tin-like kill files).<p>
195
196 You can do spam filtering better with procmail or mailagent on the
197 server side and (if you're the server sysadmin) sendmail.cf domain
198 exclusions.  You can do other policy things better with the
199 <CODE>mda</CODE> option and script wrappers around fetchmail.  If
200 it's a prime-time-vs.-non-prime-time issue, ask yourself whether a
201 wrapper script called from crontab would do the job.<p>
202
203 I'm not going to do these; fetchmail's job is transport, not policy, and I
204 refuse to change it from doing one thing well to attempting many things badly.
205 One of my objectives is to keep fetchmail simple so it stays reliable.<p>
206
207 All that said, if you have a feature idea that really is about a transport
208 problem that can't be handled anywhere but fetchmail, lay it on me.  I'm
209 very accommodating about good ideas.<p>
210
211 <hr>
212 <h2><a name="G5">G5. So, what's this I hear about a fetchmail paper?</a></h2>
213
214 Now it can be told!  The fetchmail development was also a sociological
215 experiment, an extended test to see if my theory about the critical
216 features of the Linux development model is correct.<p>
217
218 The experiment was a success.  I wrote a paper about it titled
219 <a href="http://www.ccil.org/~esr/writings/cathedral.html">The
220 Cathedral and the Bazaar</a> which was first presented at Linux
221 Kongress '97 in Bavaria and very well received there. <p>
222
223 If you're reading a non-HTML dump of this FAQ, you can find the paper 
224 on the Web with a search for that title.<p>
225
226 <hr>
227 <h2><a name="F1">F1. Why does my .fetchmailrc from 3.9 or earlier no longer work?</a></h2>
228
229 Probably it's because you're using a .fetchmailrc that's
230 written in the old popclient syntax without an explicit `username'
231 keyword leading the first user entry attached to a server entry.<p>
232
233 This error can be triggered by having a user option such as `<CODE>keep</CODE>'
234 or `<CODE>fetchall</CODE>' before the first explicit username.  For
235 example, if you write<p>
236
237 <pre>
238 poll openmail protocol pop3
239         keep user "Hal DeVore" there is hdevore here
240 </pre>
241
242 the `<CODE>keep</CODE>' option will generate an entire user entry with the default
243 username (the name of fetchmail's invoking user).<p>
244
245 The popclient compatibility syntax was removed in 4.0.  It complicated
246 the configuration file grammar and confused users.<p>
247
248 Also, the `<CODE>interface</CODE>', `<CODE>monitor</CODE>' and
249 `<CODE>batchlimit</CODE>' options changed after 2.8.<p>
250
251 They used to be global options with `set' syntax like the batchlimit
252 and logfile options.  Now they're per-server options, like `protocol'.<p>
253
254 If you had something like<p>
255
256 <pre>
257         set interface = "sl0/10.0.2.15"
258 </pre>
259
260 in your .fetchmailrc file, simply delete that line and insert 
261 `interface sl0/10.0.2.15' in the server options part of your `defaults'
262 declaration.<p>
263
264 Do similarly for any `<CODE>monitor</CODE>' or `<CODE>batchlimit</CODE>' options.<p>
265
266 <hr>
267 <h2><a name="F2">F2. The .fetchmailrc parser won't accept my all-numeric user name.</a></h2>
268
269 So put string quotes around it. :-)<p>
270
271 The configuration file parser treats any all-numeric token as a
272 number, which will confuse it when it's expecting a name.  String
273 quoting forces the token's class.<p>
274
275 <hr>
276 <h2><a name="F3">F3. The .fetchmailrc parser won't accept my host or username beginning with `no'.</a></h2>
277
278 You're caught in an unfortunate crack between the newer-style syntax
279 for negated options (`no keep', `no rewrite' etc.) and the older style
280 run-on syntax (`nokeep', `norewrite' etc.).<p>
281
282 You can work around this easily.  Just put string quotes around your
283 token.<p>
284
285 I haven't fixed this because there is no good fix for it short of
286 implementing a token pushback stack in the lexer.  That's more
287 additional complexity than I'm willing to add to banish a very
288 marginal bug with an easy workaround.<p>
289
290 <hr>
291 <h2><a name="F4">F4. I'm migrating from popclient.  How do I need to modify my .poprc?</a></h2>
292
293 If you have been using popclient (the ancestor of this program)
294 at version 3.0b6 or later, start with this<p>
295
296 <pre>
297 (cd ~; mv ~/.poprc ~/.fetchmailrc)
298 </pre>
299
300 in order to migrate.  Be aware that some of popclient's unnecessary
301 options have been removed (see the NOTES file in the distribution for
302 explanation).  You can't deliver to a local mail file anymore or to
303 standard output any more, and using an MDA for delivery is
304 discouraged.  If you throw those options away, fetchmail will now
305 forward your mail into your system's normal Internet-mail delivery
306 path.<p>
307
308 Actually, using an MDA is now almost always the wrong thing; the MDA
309 facility has been retained only for people who can't or won't run a
310 sendmail-like SMTP listener on port 25. The default, SMTP forwarding
311 to port 25, is better for at least two major reasons.  One: it feeds
312 retrieved POP and IMAP mail into your system's normal delivery path
313 along with local mail and normal Internet mail, so all your normal
314 filtering/aliasing/forwarding setup for local mail works.  Two:
315 because the port 25 listener returns a positive acknowledge, fetchmail
316 can be sure you're not going to lose mail to a disk-full or some other
317 resource-exhaustion problem.<p>
318
319 If you used to use <CODE>-mda "procmail -d</CODE>
320 <em>&lt;you&gt;</em><CODE>"</CODE> or something similar, forward to port
321 25 and do "<CODE>| procmail -d</CODE> <em>&lt;you&gt;</em><CODE>"</CODE> in
322 your ~/.forward file.<p>
323
324 As long as your new .fetchmailrc file does not use the removed
325 `localfolder' option or `<CODE>limit</CODE>' (which now takes a maximum byte size
326 rather than a line count), a straight move or copy of your .poprc will
327 often work.  (The new run control file syntax also has to be a little
328 stricter about the order of options than the old, in order to support
329 multiple user descriptions per server; thus you may have to rearrange
330 things a bit.)<p>
331
332 Run control files in the minimal .poprc format (without the `username'
333 token) will trigger a warning.  To eliminate this warning, add the
334 `<CODE>username</CODE>' keyword before your first user entry per server (it is
335 already required before second and subsequent user entries per server.<p>
336
337 In some future version the `<CODE>username</CODE>' keyword will be required.<p>
338
339 <hr>
340 <h2><a name="C1">C1. Why do I need a .fetchmailrc when running as root on my own machine?</a></h2>
341
342 Ian T. Zimmerman &lt;itz@rahul.net&gt; asked:<p>
343
344 On the machine where I'm the only real user, I run fetchmail as root
345 from a cron job, like this:<p>
346
347 <pre>
348     fetchmail -u "itz" -p POP3 -s bolero.rahul.net
349 </pre>
350
351 This used to work as is (with no .fetchmailrc file in root's home
352 directory) with the last version I had (1.7 or 1.8, I don't
353 remember).  But with 2.0, it RECPs all mail to the local root user,
354 unless I create a .fetchmailrc in root's home directory containing:<p>
355
356 <pre>
357      skip bolero.rahul.net proto POP3
358           user itz is itz
359 </pre>
360
361 It won't work if the second line is just "<CODE>user itz</CODE>".  This is silly.<p>
362
363 It seems fetchmail decides to RECP the `default local user' (ie. the
364 uid running fetchmail) unless there are local aliases, and the
365 `default' aliases (itz->itz) don't count.  They should.<p>
366
367 Answer:<p>
368
369 No they shouldn't.   I thought about this for a while, and I don't much
370 like the conclusion I reached, but it's unavoidable.  The problem is
371 that fetchmail has no way to know, in general, that a local user `itz'
372 actually exists.<p>
373
374 "Ah!" you say, "Why doesn't it check the password file to see if the remote
375 name matches a local one?"  Well, there are two reasons.<p>
376
377 One: it's not always possible.  Suppose you have an SMTP host declared
378 that's not the machine fetchmail is running on?  You lose.<p>
379
380 Two: How do you know server itz and SMTP-host itz are the same person?
381 They might not be, and fetchmail shouldn't assume they are unless
382 local-itz can explicitly produce credentials to prove it (that is, the
383 server-itz password in local-itz's .fetchmailrc file.).<p>
384
385 Once you start running down possible failure modes and thinking about
386 ways to tinker with the mapping rules, you'll quickly find that all the
387 alternatives to the present default are worse or unacceptably
388 more complicated or both.<p>
389
390 <hr>
391 <h2><a name="C2">C2. How can I arrange for a fetchmail daemon to get killed when I log out?</a></h2>
392
393 Fetchmail versions before 2.3 actually used SIGHUP as a wakeup signal.
394 Newer versions use SIGUSR1 for wakeup (and SIGHUP only in
395 background-daemon mode) in order to avoid any potential confusion
396 about logout-time behavior.  The right way to dispatch fetchmail on
397 logout is to arrange for the command `fetchmail -q' to be called on
398 logout.<p>
399
400 Under bash, you can arrange this by putting `fetchmail -q' in the file
401 `~/.bash_logout'.  Most csh variants execute `~/.logout' on logout.
402 For other shells, consult your shell manual page.<p>
403
404 <hr>
405 <h2><a name="C3">C3. How do I know what interface and address to use with --interface?</a></h2>
406
407 This depends a lot on your local networking configuration (and right
408 now you can't use it at all except under Linux).  However, here are
409 some important rules of thumb that can help.  If they don't work, ask
410 your local sysop or your Internet provider.<p>
411
412 First, you may not need to use --interface at all.  If your machine
413 only ever does SLIP or PPP to one provider, it's almost certainly by a
414 point to point modem connection to your provider's local subnet that's
415 pretty secure against snooping (unless someone can tap your phone or
416 the provider's local subnet!).  Under these circumstances, specifying
417 an interface address is fairly pointless.<p>
418
419 What the option is really for is sites that use more than one
420 provider.  Under these circumstances, typically one of your provider
421 IP addresses is your mailserver (reachable fairly securely via the
422 modem and provider's subnet) but the others might ship your packets
423 (including your password) over unknown portions of the general
424 Internet that could be vulnerable to snooping.  What you'll use
425 --interface for is to make sure your password only goes over the 
426 one secure link.<p>
427
428 To determine the device:<p>
429
430 <ol>
431 <li> If you're using a SLIP link, the correct device is probably sl0.
432 <li> If you're using a PPP link, the correct device is probably ppp0.  
433 <li> If you're using a direct connection over a local network such as
434      an ethernet, use the command `netstat -r' to look at your routing table. 
435      Try to match your mailserver name to a destination entry; if you don't
436      see it in the first column, use the `default' entry.  The device name
437      will be in the rightmost column.
438 </ol>
439
440 To determine the address and netmask:<p>
441
442 <ol>
443 <li> If you're talking to slirp, the correct address is probably 10.0.2.15,
444      with no netmask specified.  (It's possible to configure slirp to present
445      other addresses, but that's the default.)
446
447 <li> If you have a static IP address, run `ifconfig <device>', where <device>
448      is whichever one you've determined.  Use the IP address given after
449      "inet addr:".  That is the IP address for your end of the link, and is
450      what you need.  You won't need to specify a netmask.
451
452 <li> If you have a dynamic IP address, your connection IP will vary randomly
453      over some given range (that is, some number of the least significant bits
454      change from connection to connection).  You need to declare an address 
455      with the variable bits zero and a complementary netmask that sets
456      the range.
457 </ol>
458
459 To illustrate the rule for dynamic IP addresses, let's suppose you're
460 hooked up via SLIP and your IP provider tells you that the dynamic
461 address pool is 255 addresses ranging from 205.164.136.1 to
462 205.164.136.255.  Then<p>
463
464 <pre>
465         interface "sl0/205.164.136.0/255.255.255.0"
466 </pre>
467
468 would work.  To range over any value of the last two octets
469 (65536 addresses) you would use<p>
470
471 <pre>
472         interface "sl0/205.164.0.0/255.255.0.0"
473 </pre>
474
475 <hr>
476 <h2><a name="C4">C4. How can I get fetchmail to work with ssh?</a></h2>
477
478 We have two recipes for this.  The first is a little easier to set up,
479 but only supports one user at a time.<P>
480
481 First, a lightly edited version of a recipe from Masafumi NAKANE:<p>
482
483 1. You must have ssh (the ssh client) on the local host and sshd (ssh
484 server) on the remote mail server.  And you have to configure ssh so
485 you can login to the sshd server host without a password.  (Refer to ssh
486 man page for several authentication methods.)<p>
487
488 2. Add something like following to your .fetchmailrc file: <p>
489
490 <pre>
491 poll mailhost port 1234 via localhost with pop3:
492         preconnect "ssh -f -L 1234:mailhost:110 mailhost sleep 20 </dev/null >/dev/null";
493 </pre>
494
495 (Note that 1234 can be an arbitrary port number.  Privileged ports can
496 be specified only by root.)  The effect of this ssh command is to
497 forward connections made to localhost port 1234 (in above example) to
498 mailhost's 110.<p>
499
500 This configuration will enable secure mail transfer.  All the
501 conversation between fetchmail and remote pop server will be
502 encrypted.<p>
503
504 If sshd is not running on the remote mail server, you can specify
505 intermediate host running it.  If you do this, however, communication
506 between the machine running sshd and the POP server will not be encrypted.
507 And the preconnect line would be like this:<p>
508
509 <pre>
510 preconnect "ssh -f -L 1234:mailhost:110 sshdhost sleep 20 </dev/null >/dev/null"
511 </pre>
512
513 You can work this trick with IMAP too, but the port number 110 in the
514 above would need to become 143.<p>
515
516 Second, a recipe frm Charlie Brady &lt;cbrady@ind.tansu.com.au&gt;.
517
518 Charlie says: "The [previous] recipe certainly works, but
519 the solution I post here is better in a few respects":
520
521 <UL>
522 <LI>this method will not fail if two or more users attempt to use fetchmail
523     simultaneously.
524 <LI>you are able to use the full facilities of tcpd to control access
525 <LI>this method does not depend on the preconnect feature of fetchmail, so
526     can be used for tunneling of other services as well.
527 </UL>
528
529 Here are the steps:
530
531 <OL>
532 <LI>
533 Make sure that the "socket" program is installed on the server machine.
534 <LI>
535 Set up an unprivileged account on your system with a .ssh directory
536 containing an SSH identity file "identity" with no pass phrase,
537 "identity.pub" and "known_hosts" containing the host key of your
538 mailhost. Let's call this account "noddy".
539 <LI>
540 On mailhost, set up no-password access for noddy@yourhost. Add to your
541 SSH authorised_keys file:
542
543 <PRE>
544 command="socket localhost 110",no-port-forwarding 1024 ......
545 </PRE>
546
547 where "<code>1024</code> ......" is the content of noddy's identity.pub file.
548 <LI>
549 Create a script /usr/local/bin/ssh.fm and make it executable:
550
551 <PRE>
552 #! /bin/sh
553 exec ssh -q -C -l your.login.id -e none mailhost socket localhost 110
554 </PRE>
555 <LI>
556 Add an entry in inetd.conf for whatever port you choose to use - say:
557
558 <PRE>
559 1234 stream tcp nowait noddy /usr/sbin/tcpd /usr/local/bin/ssh.fm
560 </PRE>
561 <LI>
562 Send a HUP signal to your inetd.
563 </OL>
564
565 Now just use localhost:1234 to access your POP server.<P>
566
567 <hr>
568 <h2><a name="C5">C5. How can I set up support for sendmail's anti-spam 571 response?</a></h2>
569
570 Rachel Polanskis <r.polanskis@nepean.uws.edu.au> writes:<p>
571
572 Basically you need to use the "check_*" rules in sendmail.
573 These are rules introduced since version 8.8.2<p>
574
575 The idea is to generate a list of domains and addresses that are placed into 
576 a file - I call mine "sendmail.rej" and you place just one domain 
577 or email address on each line.   During the SMTP transaction, this file
578 is checked and if there is a match, the message is refused, with
579 a suitable "Service not available" message sent back to the sender.<p>
580
581 With the feature enabled in fetchmail, the mail is simply deleted, 
582 with no further processing.<p>
583
584 The only drawback when blocking spam with fetchmail is that you 
585 do not get the satisfaction of sending an error back to the sender.<p>
586
587 To actually use the check_mail rules in sendmail 8.8.2 or better, 
588 you need to know how to generate a sendmail.cf file from the m4 
589 config files distributed with sendmail.<p>
590
591 The actual rules can be found at the following URLS:<p>
592
593 <a href="http://www.informatik.uni-kiel.de/%7Eca/email/check.html">
594 http://www.informatik.uni-kiel.de/%7Eca/email/check.html</a><p>
595
596 This one is by Claus A&szlig;man, who has documented more of sendmail then
597 I can digest!
598
599 The actual setup I used though was by David Begley, who has put together 
600 a WWW page describing how to quickly implement these rules yourself.<p>
601
602 <a href="http://www.nepean.uws.edu.au/users/david/pe/blockmail.html">
603 http://www.nepean.uws.edu.au/users/david/pe/blockmail.html</a><p>
604
605 David's pages could be moving shortly.  I will post an update if it happens.<p>
606
607 Remember, when copying these rulesets off the web, that there are tabs 
608 embedded in them, that may not be preserved.  You <em>must</em> reintroduce
609 these tabs into the rules to make them work properly.  <p>
610
611 Once you have your ruleset in place, and have generated a nice sendmail.cf
612 file, and the list of blocked sites,  try telneting to your
613 SMTP port to test it, and send a message with a blocked address in it.<p>
614
615 You should see a message similar to:<p>
616
617 <pre>
618      "571 unsolicited email is refused"
619 </pre>
620
621 Next, if you have access to a host that you can send mail from, that
622 is <em>not</em> your mail host, add that host to your spamlist and
623 restart sendmail.<p>
624
625 Send a message to your mailing address from that host and then pop off
626 the message with fetchmail, using the -v argument.  You can monitor
627 the SMTP transaction, and when the FROM address is parsed, if sendmail
628 sees that it is an address in spamlist, fetchmail will flush and
629 delete it.<p>
630
631 Under no circumstances put your <strong>mailhost</strong> or <strong>any host
632 you accept mail from</strong> using fetchmail into your reject file.  You
633 <strong>will</strong> lose mail if you do this!!!<p>
634
635 The check_ rules work, and they work well. Coupled with fetchmail's
636 ability to respond to the appropriate error messages, you can be assured
637 of never seeing a spam from any address you put in the reject list.<p>
638
639 The only thing that is missing, as mentioned previously, is the ability
640 to allow sendmail to process the message further and generate an error
641 message to the sender.  <p>
642
643 <hr>
644 <h2><a name="C6">C6. How can I do automatic startup/shutdown of fetchmail
645 when I may have multiple login sessions going?</a></h2>
646
647 In the contrib subdirectory of the fetchmail distribution there is
648 some shell code you can add to your .bash_login and .bash_logout
649 profiles that will accomplish this.  Thank James Laferriere
650 &lt;babydr@nwrain.net&gt; for it.<p>
651
652 <hr>
653 <h2><a name="T1">T1. How can I use fetchmail with qmail?</a></h2>
654
655 Turn on the <CODE>forcecr</CODE> option; qmail's listener mode doesn't like 
656 header or message lines terminated with bare linefeeds.<p>
657
658 (This information is thanks to Robert de Bath 
659 &lt;robert@mayday.cix.co.uk&gt;.)<p>
660
661 If a mailhost is using the qmail package (see <a
662 href="http://pobox.com/~djb/qmail.html">http://pobox.com/~djb/qmail.html</a>)
663 then, providing the local hosts are also using qmail, it is possible
664 to setup one fetchmail link to be reliably collect the mail for an
665 entire domain.<p>
666
667 One of the basic features of qmail is the `Delivered-To:' message
668 header.  Whenever qmail deliver a message to a local mailbox it puts
669 the username and hostname of the envelope recipient on this line.  The
670 major reason for this is to prevent mail loops. <p>
671
672 To set up qmail to batch mail for a disconnected site the isp-mailhost
673 will have normally put that site in its `virtualhosts' control file so
674 it will add a prefix to all mail addresses for this site. This results
675 in mail sent to 'username@userhost.userdom.dom.com' having a
676 'Delivered-To:' line of the form:<p>
677
678 <pre>
679        Delivered-To: mbox-userstr-username@userhost.userdom.dom.com
680 </pre>
681
682 A single host maildrop will be slightly simpler:
683
684 <pre>
685        Delivered-To: mbox-userstr-username@userhost.dom.com
686 </pre>
687
688 The ISP can make the 'mbox-userstr-' prefix anything they choose
689 but a string matching the user host name is likely.<p>
690    
691 To use this line you must:<p>
692
693 <ol>
694 <li>Ensure the option `envelope Delivered-To:' is in the fetchmail
695     config file.
696
697 <li>Ensure you have a localdomains containing 'userdom.dom.com' or
698     `userhost.dom.com' respectively.
699 </ol>
700
701 So far this reliably delivers messages to the correct machine of the
702 local network, to deliver to the correct user the 'mbox-userstr-'
703 prefix must be stripped off of the user name. This can be done by
704 setting up an alias within the qmail MTA on each local machine.
705 Simply create a dot-qmail file called '.qmail-mbox-userstr-default'
706 in the alias directory (normally /var/qmail/alias) with the contents:<p>
707
708 <pre>
709       | ../bin/qmail-inject -a -f"$SENDER" "${LOCAL#mbox-userstr-}@$HOST}"
710 </pre>
711
712 Note this <em>does</em> require a modern /bin/sh.<p>
713
714 <hr>
715 <h2><a name="T2">T2. How can I use fetchmail with exim?</a></h2><p>
716
717 By default, the exim listener enforces the the RFC1123 requirement
718 that MAIL FROM addresses you pass to it have to be canonical
719 (e.g. with a fully qualified hostname part).  <p>
720
721 This is a potential problem if the MTAs upstream from your fetchmail
722 don't necessarily pass canonicalized From and Return-Path addresses,
723 and fetchmail's <CODE>rewrite</CODE> option is off.  The specific case
724 where this has come up involves bounce messages generated by sendmail
725 on your mailer host, which have the (un-canonicalized) origin address
726 MAILER-DAEMON.<p>
727
728 The right way to fix this is to enable the <CODE>rewrite</CODE> option and
729 have fetchmail canonicalize From and Return-Path addresses with the
730 mailserver hostname before exim sees them.<p>
731
732 If you must run with <CODE>rewrite</CODE> off, there is a switch in exim's
733 configuration files that allows it to accept domainless MAIL FROM
734 addresses; you will have to flip it by putting the line <p>
735
736 <pre>
737         sender_unqualified_hosts = localhost
738 </pre>
739
740 in the main section of the exim configuration file.  Note that this
741 will result in such messages having an incorrect domain name attached
742 to their return address (your SMTP listener's hostname rather than
743 that of the remote mail server). <p>
744
745 <hr>
746 <h2><a name="T3">T3. How can I use fetchmail with smail?</a></h2><p>
747
748 Smail 3.2 is very nearly plug-compatible with sendmail, and may work
749 fine out of the box.<P>
750
751 We have one report that when processing multiple messages from a
752 single fetchmail session, smail sometimes delivers them in an
753 order other than received-date order.  This can be annoying because it
754 scrambles conversational threads.  This is not fetchmail's problem,
755 it is an smail "feature" and has been reported to the maintainers
756 as a bug.<P>
757
758 Very recent smail versions require an <code>-smtp_hello_verify</code>
759 option in the smail config file.  This overrides smail's check to see
760 that the HELO address is actually that of the client machine, which
761 is never going to be the case when fetchmail is in the picture.
762 According to RFC1123 an SMTP listener <em>must</em> allow this
763 mismatch, so smail's new behavior (introduced sometime between
764 3.2.0.90 and 3.2.0.95) is a bug.<P>
765
766 <hr>
767 <h2><a name="T4">T4. How can I use fetchmail with Lotus Notes?</a></h2><p>
768
769 The Lotus Notes SMTP gateway tries to deduce when it should convert \n
770 to \r\n, but its rules are not intuitive.  Use `forcecr'.<P>
771
772 <hr>
773 <h2><a name="R1">R1. I think I've set up fetchmail correctly, but I'm not getting any mail.</a></h2>
774
775 Maybe you have a .forward or alias set up that you've forgotten about.  You
776 should probably remove it.<p>
777
778 Or maybe you're trying to run fetchmail in multidrop mode as root
779 without a .fetchmailrc file.  This doesn't do what you think it
780 should; see question <a href="#C1">C1</a>.<p>
781
782 Or you may not be connecting to the SMTP listener.   Run fetchmail -v
783 and see the next question.<p>
784
785 <hr>
786 <h2>R2. Fetchmail isn't working, and -v shows `SMTP connect failed' messages.</a></h2>
787
788 Fetchmail itself is probably working, but your SMTP port 25 listener
789 is down or inaccessible.<p>
790
791 The first thing to check is if you can telnet to port 25 on your smtp
792 host (which is normally `localhost' unless you've specified an smtp
793 option in your .fetchmailrc or on the command line) and get a greeting
794 line from the listener.  If the SMTP host is inaccessible or the listener
795 is down, fix that first.<p>
796
797 If the listener seems to be up when you test with telnet, the most
798 benign and typical problem is that the listener had a momentary seizure
799 due to resource exhaustion while fetchmail was polling it -- process
800 table full or some other problem that stopped the listener process
801 from forking.  If your SMTP host is not `localhost' or something else
802 in /etc/hosts, the fetchmail glitch could also have been caused by
803 transient nameserver failure. <p>
804
805 Try running fetchmail -v again; if it succeeds, you had one of these
806 kinds of transient glitch.  You can ignore these hiccups, because a
807 future fetchmail run will get the mail through. <p>
808
809 If the listener tests up, but you have chronic failures trying to
810 connect to it anyway, your problem is more serious.  One way to work
811 around chronic SMTP connect problems is to use --mda.  But this only
812 attacks the symptom; you may have a DNS or TCP routing problem.  You
813 should really try to figure out what's going on underneath before it
814 bites you some other way. <p>
815
816 We have one report (from toby@eskimo.com) that you can sometimes solve
817 such problems by doing an <CODE>smtp</CODE> declaration with an IP
818 address that your routing table maps to something other than the
819 loopback device (he used ppp0).<p>
820
821 We had another report from a Linux user of fetchmail 2.1 who solved his SMTP
822 connection problem by removing the reference to -lresolv from his link
823 line and relinking.  Apparently in some recent Linux distributions the
824 libc bind library version works better.<p>
825
826 As of 2.2, the configure script has been hacked so the bind library is
827 linked only if it is actually needed.  So under Linux it won't be, and
828 this particular cause should go away.<p>
829
830 <hr>
831 <h2><a name="R3">R3. When I try to configure an MDA, fetchmail doesn't work.</a></h2>
832
833 (I hear this one from people who have run into the blank-line problem in <a href="#X2">X2</a>.)<p>
834
835 Try sending yourself test mail and retrieving it using the
836 command-line options `<CODE>-k -m cat</CODE>'.  This will dump exactly what
837 fetchmail retrieves to standard output. <p>
838
839 If the dump doesn't match what shows up in your mailbox when you
840 configure an MDA, your MDA is mangling the message.  If it doesn't
841 match what you sent, then fetchmail or something on the server is
842 broken.<p>
843
844 <hr>
845 <h2><a name="R4">R4. Fetchmail dumps core in -V mode, but operates normally otherwise.</a></h2>
846
847 We've had this reported to us under Linux using libc-5.4.17 and gcc-2.7.2.
848 It does not occur with libc-5.3.12 or earlier versions.<p>
849
850 Workaround: link with GNU malloc rather than the stock C library malloc.<p>
851
852 We're told there is some problem with the malloc() code in that
853 version which makes it fragile in the presence of multiple free()
854 calls on the same pointer (the malloc arena gets corrupted).
855 Unfortunately it appears from doing gdb traces that whatever free()
856 calls producing the problem are being made by the C library itself, not the
857 fetchmail code (they're all from within fclose, and not an fclose called
858 by fetchmail, either).<p>
859
860 <hr>
861 <h2><a name="R5">R5. Mail that was being fetched when I interrupted my fetchmail seems to have been vanished.</a></h2>
862
863 Fetchmail only sends a delete mail request to the server when either
864 (a) it gets a positive delivery acknowledgement from the SMTP
865 listener, or (b) it gets an error 571 (the spam-filter error) from the
866 listener.  No interrupt can cause it to lose mail.<p>
867
868 However, POP3 has a design problem in that its servers mark a message
869 `seen' as soon as the fetch command to get it is sent down.  If for
870 some reason the message isn't actually delivered (you take a line hit
871 during the download, or your port 25 listener can't find enough free
872 disk space, or you interrupt the delivery in mid-message) that `seen'
873 message can lurk invisibly in your server mailbox forever.<p>
874
875 Workaround: add the `<CODE>fetchall</CODE>' keyword to your POP3 fetch options.<p>
876
877 Solution: switch to an <a
878 href="http://www.washington.edu/imap">IMAP</a> server.<p>
879
880 <hr>
881 <h2><a name="R6">R6. Fetchmail dumps core when I use a .netrc file but works otherwise.</a></h2>
882
883 We have a report that under Solaris 2.5 using gcc-2.7.2, if fetchmail
884 is compiled with -O or -O2, it segfaults on startup when reading a
885 .netrc.<p>
886
887 You can work around this by disabling optimization.<p>
888
889 There may be an actual bug here that the optimizer exposes; the stack
890 trace says the segfault is in free() and has all the earmarks of a heap-
891 corruption screw.  But the symptom doesn't reproduce under Linux with the
892 same .fetchmailrc and .netrc.<p>
893
894 <hr>
895 <h2><a name="R7">R7. All my mail seems to disappear after an interrupt.</a></h2>
896
897 One POP3 daemon used in the Berkeley Unix world that reports itself as
898 Pop3 version 1.004 actually throws the queue away. 1.005 fixed that.
899 If you're running this one, upgrade immediately.<P>
900
901 Many POP servers, if an interruption occurs, will restore the whole
902 mail queue after about 10 minutes.  Others will restore it right
903 away. If you have an interruption and don't see it right away, cross
904 your fingers and wait ten minutes brfore retrying.<P>
905
906 Some servers (such as Microsoft's NTMail) are mis-designed to restore
907 the entire queue, including messages you have deleted.  If you have
908 one of these and it flakes out on you a lot, try setting a small
909 <code>--fetchlimit</code> value.  This will result in more IP connects
910 to the server but will mean it actually executes changes to the queue
911 more often.<P>
912
913 Qualcomm's qpopper, used at many BSD Unix sites, is better behaved.
914 If its connection is dropped, it will first execute all DELE commands (as
915 though you had issued an QUIT -- this is a technical violation of
916 the RFCs, but a good idea in a world of flaky phone lines). Then it
917 will re-queue any message that was being downloaded at hangup time.
918 Still, qpopper may require a noticeable amount of time to do deletions
919 and clean up its queue.  (Fetchmail waits a bit before retrying in
920 order to avoid a `lock busy' error.)<P>
921
922 <hr>
923 <h2><a name="M1">M1. I've declared local names, but all my multidrop
924 mail is going to root anyway.</a></h2>
925
926 Somehow your fetchmail is never matching the hostname part of
927 recipient names to the name of the mailserver machine.  This probably
928 means it is unable to recognize hostname parts as being DNS names of
929 the mailserver, and indicates some kind of DNS configuration
930 problem either on the server or your client machine. <p>
931
932 The easiest workaround is to write enough aka declarations to cover
933 all of your mailserver's aliases, then say `no dns'.  This will take
934 DNS out of the picture (though it means mail may be uncollected if
935 it's sent to an alias of the server that you don't have listed). <p>
936
937 It would be better to fix your DNS, however.  DNS problems can hurt
938 you in lots of ways, for example by making your machines
939 intermittently or permanently unreachable to the rest of the net.<P>
940
941 <hr>
942 <h2><a name="M2">M2. I can't seem to get fetchmail to route to a local domain properly.</a></h2>
943
944 A lot of people want to use fetchmail as a poor man's internetwork
945 mail gateway, picking up mail accumulated for a whole domain in a single
946 server mailbox and then routing based on what's in the To/Cc/Bcc lines.<p>
947
948 In general, this is not really a good idea.  It would be smarter to
949 just let the mail sit in the mailserver's queue and use fetchmail's
950 ETRN mode to trigger SMTP sends periodically (of course, this means
951 you have to poll more frequently than the mailserver's expiry period).
952 If you can't arrange this, try setting up a UUCP feed.<P>
953
954 If neither of these alternatives is available, multidrop mode may do
955 (though you <em>are</em> going to get hurt by some mailing list
956 software; see the caveats under THE USE AND ABUSE OF MULTIDROP
957 MAILBOXES on the man page).  If you want to try it, the way to do it
958 is with the `<CODE>localdomains</CODE>' option.<p>
959
960 In general, if you use localdomains you need to make sure of two other
961 things: <p>
962
963 <strong>1. You've actually set up your .fetchmailrc entry to invoke multidrop mode.</strong><p>
964
965 Many people set a `<CODE>localdomains</CODE>' list and then forget
966 that fetchmail wants to see more than one name (or the wildcard `*')
967 in a `<CODE>here</CODE>' list before it will do multidrop routing.<p>
968
969 <strong>2. You may have to set `no envelope'.</strong><p>
970
971 Normally, multidrop mode tries to deduce an envelope address from a message
972 before parsing the To/Cc/Bcc lines (this enables it to avoid losing to mailing
973 list software that doesn't put a recipient addess in the To lines).<p>
974
975 Some ways of accumulating a whole domain's messages in a single server
976 mailbox mean it all ends up with a single envelope address that is
977 useless for rerouting purposes.  You may have to set `<CODE>no
978 envelope</CODE>' to prevent fetchmail from being bamboozled by this.<p>
979
980 <hr>
981 <h2><a name="M3">M3. I tried to run a mailing list using multidrop, and I have a mail loop!</a></h2>
982
983 This isn't fetchmail's fault.  Check your mailing list.  If the list
984 expansion includes yourself or anybody else at your mailserver (that is, not on
985 the client side) you've created a mail loop.  Just chop the host part off any
986 local addresses in the list.<p>
987
988 If you use sendmail, you can check the list expansion with
989 <CODE>sendmail -bv</CODE>.<p>
990
991 <hr>
992 <h2><a name="M4">M4. My multidrop fetchmail seems to be having DNS problems.</a></h2>
993
994 We have one report from a Linux user (not the same one as in <a
995 href="#R2">R2</a>!) who solved this problem by removing the reference
996 to -lresolv from his link line and relinking.  Apparently in some
997 recent Linux distributions the libc bind library version works
998 better.<p>
999
1000 As of 2.2, the configure script has been hacked so the bind library is linked
1001 only if it is actually needed.  So under Linux it won't be, and this problem
1002 should go away.<p>
1003
1004 <hr>
1005 <h2><a name="M5">M5. I'm seeing long DNS delays before each message is processed.</a></h2>
1006
1007 Use the `<CODE>aka</CODE>' option to pre-declare as many of your
1008 mailserver's DNS names as you can.  When an address's host part
1009 matches an aka name, no DNS lookup needs to be done to check it.<p>
1010
1011 If you're sure you've pre-declared all of your mailserver's DNS dames,
1012 you can use the `<CODE>no dns</CODE>' option to prevent other hostname
1013 parts from being looked up at all.<p>
1014
1015 Sometimes delays are unavoidable.  Some SMTP listeners try to call DNS
1016 on the From-address hostname as a way of checking that the address is valid.<p>
1017
1018 <hr>
1019 <h2><a name="M6">M6. How do I get multidrop mode to work with majordomo?</a></h2>
1020
1021 In order for sendmail to execute the command strings in the majordomo
1022 alias file, it is necessary for sendmail to think that the mail it
1023 receives via SMTP really is destined for a local user name.  A normal
1024 virtual-domain setup results in delivery to the default mailbox,
1025 rather than expansion through majordomo.<P>
1026
1027 Michael &lt;michael@bizsystems.com&gt; gave us a recipe for dealing
1028 with this case that pairs a run control file like this:<P>
1029
1030 <pre>
1031 poll your.pop3.server proto pop3:
1032     no envelope no dns
1033     localdomains virtual.localdomain1.com virtual.localdomain2.com ...
1034     user yourISPusername is root * here,
1035     password yourISPpassword fetchall
1036 </pre>
1037
1038 with a hack on your local sendmail.cf like this:<P>
1039
1040 <pre>
1041 #############################################
1042 #  virtual info, local hack for ruleset 98  #
1043 #############################################
1044
1045 # domains to treat as direct mapped local domain
1046
1047 CVvirtual.localdomain1.com virtual.localdomain2.com ...
1048 ---------------------------
1049 in ruleset 98 add
1050 -------------------------
1051 # handle virtual users
1052
1053 R$+ &lt;@ $=V . &gt;          $: $1 &lt; @ $j . &gt;
1054 R&lt; @ &gt; $+ &lt; @ $=V . &gt;   $: $1 &lt; @ $j . &gt;
1055 R&lt; @ &gt; $+               $: $1
1056 R&lt; error : $- $+ &gt; $*   $#error $@ $1 $: $2
1057 R&lt; $+ &gt; $+ &lt; @ $+ &gt;     $: $&gt;97 $1
1058 </pre>
1059
1060 This ruleset just strips virtual domain names off the addresses of incoming
1061 mail.  Your sendmail must be 8.8 or newer for this to work.  Michael
1062 says:<P>
1063
1064 <BLOCKQUOTE>
1065 I use this scheme with 2 virtual domains and the default ISP 
1066 user+domain and service about 30 mail accounts + majordomo on my 
1067 inside pop3 server with fetchmail and sendmail 8.83<P>
1068 </BLOCKQUOTE>
1069
1070 <hr>
1071 <h2><a name="X1">X1. Why is fetched mail being logged with my name, not the real From address?</a></h2>
1072
1073 Because logging is done based on the address indicated by the sending
1074 SMTP's MAIL FROM, and some listeners are picky about that address.<p>
1075
1076 Some SMTP listeners get upset if you try to hand them a MAIL FROM
1077 address naming a different host than the originating site for your
1078 connection.  This is a feature, not a bug -- it's supposed to help
1079 prevent people from forging mail with a bogus origin site.  (RFC 1123
1080 says you shouldn't do this exclusion...)<p>
1081
1082 Since the originating site of a fetchmail delivery connection is
1083 localhost, this effectively means these picky listeners will barf on
1084 any MAIL FROM address fetchmail hands them with an @ in it!<p>
1085
1086 In versions up to 1.9.9 this led to pesky errors at some sites.
1087 Because of this, I hacked 2.0 to just use the calling user ID
1088 as the MAIL FROM address.<p>
1089
1090 Versions 2.1 and up try the header From address first and fall back to
1091 the calling-user ID.  So if your SMTP listener isn't picky, the log
1092 will look right.<p>
1093
1094 <hr>
1095 <h2><a name="X2">X2. Spurious blank lines are appearing in the headers of fetched mail.</a></h2>
1096
1097 What's probably happening is that the POP/IMAP daemon on your
1098 mailserver is inserting a non-RFC822 header (like X-POP3-Rcpt:) and
1099 something in your delivery path (most likely an old version of the
1100 <em>deliver</em> program, which sendmail often calls to do local delivery) is
1101 failing to recognize it as a header.<p>
1102
1103 This is not fetchmail's problem.  The first thing to try is installing
1104 a current version of <em>deliver</em>.  If this doesn't work, try to
1105 figure out which other program in your mail path is inserting the
1106 blank line and replace that.  If you can't do either of these things,
1107 pick a different MDA (such as procmail) and declare it with the
1108 `<CODE>mda</CODE>' option.<p>
1109
1110 <hr>
1111 <h2><a name="X3">X3. My mail client can't see a Subject line.</a></h2>
1112
1113 First, see <a href="#X2">X2</a>.  This is quite probably the same
1114 problem (X-POP3-Rcpt header or something similar being inserted by
1115 the server and choked on by an old version of <em>deliver</em>).<p>
1116
1117 The O'Reilly sendmail book does warn that IDA sendmail doesn't process
1118 X- headers correctly.  If this is your problem, all I can suggest is
1119 replacing IDA sendmail, because it's broken and not RFC822 conformant.<p>
1120
1121 <hr>
1122 <h2><a name="X4">X4. Messages containing "From" at start of line are being split.</a></h2>
1123
1124 If you know the messages aren't split in your server mailbox, then this
1125 is a problem with your POP/IMAP server, your client-side SMTP listener or
1126 your local delivery agent.  Fetchmail cannot split messages.<p>
1127  
1128 Some POP daemons ignore Content-Length headers and split messages on
1129 From lines.  We have one report that the 2.1 version of the BSD popper
1130 program (as distributed on Solaris 2.5 and elsewhere) is broken this way.<p>
1131
1132 You can test this.  Declare an mda of `cat' and send yourself one
1133 piece of mail containing "From" at start of a line.  If you see a
1134 split message, your POP/IMAP server is at fault.  Upgrade to a more
1135 recent version.<p>
1136
1137 Sendmail and other SMTP listeners don't split RFC822 messages either.
1138 What's probably happening is either sendmail's local delivery agent or
1139 your mail reader are not quite RFC822-conformant and are breaking
1140 messages on what it thinks are Unix-style From headers.  You can
1141 figure out which by looking at your client-side mailbox with vi or
1142 more.  If the message is already split in your mailbox, your local
1143 delivery agent is the problem.  If it's not, your mailreader is the
1144 problem.<p>
1145
1146 If you can't replace the offending program, take a look at your
1147 sendmail.cf file.  There will likely be a line something like<p>
1148
1149 <pre>
1150 Mlocal, P=/usr/bin/procmail, F=lsDFMShP, S=10, R=20/40, A=procmail -Y -d $u
1151 </pre>
1152
1153 describing your local delivery agent.  Try inserting the `E' option in the
1154 flags part (the F= string).  This will make sendmail turn each dangerous
1155 start-of-line From into a >From, preventing programs further downstream
1156 from acting up.<p>
1157
1158 <hr>
1159 <h2><a name="O1">O1. The --logfile option doesn't work if the logfile doesn't exist.</a></h2>
1160
1161 This is a feature, not a bug.  It's in line with normal practice for
1162 system daemons and allows you to suppress logging by removing the log,
1163 without hacking potentially fragile startup scripts.  To get around
1164 it, just touch(1) the logfile before you run fetchmail (this will have
1165 no effect on the contents of the logfile if it already exists).<P>
1166
1167 <hr>
1168 <h2><a name="O2">O2. Every time I get a POP or IMAP message the header
1169 is dumped to all my terminal sessions.</a></h2>
1170
1171 fetchmail uses the local sendmail to perform final delivery, which
1172 Netscape and other clients doen't do; the announcement of new messages
1173 is done by a daemon that sendmail pokes. There should be a ``biff''
1174 command to control this.  Type
1175
1176 <PRE>
1177 biff n
1178 </PRE>
1179
1180 to turn it off. If this doesn't work, try the command 
1181
1182 <PRE>
1183 chmod -x `tty`
1184 </PRE>
1185
1186 which is essentially what <code>biff -n</code> will do. If this
1187 doesn't work, comment out any reference to ``comsat'' in your
1188 /etc/inetd.conf file and restart inetd.<P>
1189
1190 In Slackware Linux distributions, the last line in /etc/profile is
1191
1192 <PRE>
1193 biff y
1194 </PRE>
1195
1196 Change this to
1197
1198 <PRE>
1199 biff n
1200 </PRE>
1201
1202 to solve the problem system-wide.<P>
1203
1204 $Id: fetchmail-FAQ.html,v 1.50 1997/07/29 02:32:57 esr Exp $<p>
1205
1206 <HR>
1207 <ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com">&lt;esr@snark.thyrsus.com&gt;</A></ADDRESS>
1208 </BODY>
1209 </HTML>