]> Pileus Git - ~andy/fetchmail/blob - fetchmail.man
gcc -Wall cleanup.
[~andy/fetchmail] / fetchmail.man
1 .\" For license terms, see the file COPYING in this directory.
2 .TH fetchmail LOCAL
3 .SH NAME
4 fetchmail \- fetch mail from a POP or IMAP server
5 .SH SYNOPSIS
6 .B fetchmail
7 [\fI options \fR] \fI [mailserver...]\fR
8 .SH DESCRIPTION
9 .I fetchmail
10 is a mail-retrieval and forwarding utility; it fetches
11 mail from remote mailservers and forwards it to your local (client)
12 machine's delivery system.  You can then handle the retrieved mail
13 using normal mail user agents such as \fIelm\fR(1) or \fIMail\fR(1).
14 The \fBfetchmail\fR utility can be run in a daemon mode to repeatedly
15 poll one or more systems at a specified interval.
16 .PP
17 The
18 .I fetchmail
19 program can gather mail from servers supporting any of the common
20 mail-retrieval protocols: POP2 (as specified in RFC 937), POP3 (RFC
21 1939), IMAP2bis (as implemented by the 4.4BSD imapd program), and
22 IMAP4 (as specified by RFC 1730).  It can use (but does not require)
23 the LAST facility removed from later POP3 versions.
24 .PP
25 While
26 .I fetchmail
27 is primarily intended to be used over on-demand TCP/IP links (such as
28 SLIP or PPP connections), it may also be useful as a message transfer
29 agent for sites which refuse for security reasons to permit
30 (sender-initiated) SMTP transactions with sendmail.
31 .PP
32 As each message is retrieved \fIfetchmail\fR normally delivers it via SMTP to
33 port 25 on the machine it is running on (localhost), just as though it
34 were being passed in over a normal TCP/IP link.  The mail will then be
35 delivered locally via your system's MDA (Mail Delivery Agent, usually
36 \fIsendmail\fR(8) but your system may use a different one such
37 as \fIsmail\fR, \fImmdf\fR, or \fIqmail\fR).  All the delivery-control
38 mechanisms (such as \fI.forward\fR files) normally available through
39 your system MDA will therefore work.
40 .PP
41 The behavior of
42 .I fetchmail
43 is controlled by command-line options and a run control file,
44 \fI~/.fetchmailrc\fR, the syntax of which we describe below.  Command-line
45 options override
46 .I ~/.fetchmailrc
47 declarations.
48 .PP
49 To facilitate the use of
50 .I fetchmail
51 In scripts, pipelines, etc., it returns an appropriate exit code upon 
52 termination -- see EXIT CODES below.
53 .SH OPTIONS
54 The following options modify the behavior of \fIfetchmail\fR.  It is
55 seldom necessary to specify any of these once you have a
56 working \fI.fetchmailrc\fR file set up.
57 .TP
58 .B \-a, --all
59 Retrieve both old (seen) and new messages from the mailserver.  The
60 default is to fetch only messages the server has not marked seen.
61 Note that POP2 retrieval behaves as though --all is always on (see
62 RETRIEVAL FAILURE MODES below).
63 .TP
64 .B \-l, --limit
65 Takes a maximum octet size argument.  Messages larger than this size
66 will not be fetched, not be marked seen, and will be left on the
67 server (in foreground sessions, the progress messages will note that
68 they are "oversized").  The --all option overrides this one.  This
69 option is intended for those need to strictly control fetch time
70 in interactive mode.  It may not be used with daemon mode,
71 as users would never receive a notification that messages were waiting.
72 .TP
73 .B \-S host, --smtphost host
74 Specify a host to forward mail to (other than localhost).
75 .TP
76 .B \-m, \--mda
77 You can force mail to be passed to an MDA directly (rather than
78 forwarded to port 25) with the -mda or -m option.  If \fIfetchmail\fR
79 is running as root, it sets its userid to that of the target user
80 while delivering mail through an MDA.  Some possible MDAs are
81 "/usr/sbin/sendmail -oem", "/usr/lib/sendmail -oem",
82 "/usr/bin/formail", and "/usr/bin/deliver".  Local delivery addresses
83 will be appended to the MDA command.  Do \fInot\fR use an MDA like
84 "sendmail -oem -t" that dispatches on the contents of To/Cc/Bcc, it
85 will create mail loops and bring the just wrath of many postmasters
86 down upon your head.
87 .TP
88 .B \-F, --flush
89 POP3/IMAP only.  Delete old (previously retrieved) messages from the mailserver
90 before retrieving new messages.
91 .TP
92 .B \-c, --check
93 Return a status code to indicate whether there is mail waiting,
94 without actually fetching or deleting mail (see EXIT CODES below).
95 This option doesn't play well with queries to multiple sites, and
96 is ignored in daemon mode.  It's also prone to false positives if
97 you leave read but undeleted mail in your server mailbox.
98 .TP
99 .B \-f pathname, --fetchmailrc pathname
100 Specify a non-default name for the 
101 .I .fetchmailrc
102 run control file.
103 .TP
104 .B \-i pathname, --idfile pathname
105 Specify an alternate name for the .fetchids file used to save POP3
106 UIDs. 
107 .TP
108 .B \-k, --keep
109 Keep retrieved messages on the remote mailserver.  Normally, messages 
110 are deleted from the folder on the mailserver after they have been retrieved.
111 Specifying the 
112 .B keep 
113 option causes retrieved messages to remain in your folder on the mailserver.
114 .TP
115 .B \-K, --kill
116 Delete retrieved messages from the remote mailserver.  This
117 option forces retrieved mail to be deleted.  It may be useful if
118 you have specified a default of \fBnokill\fR in your \fI.fetchmailrc\fR.
119 .TP
120 .B \-p, \--protocol proto
121 Specify the protocol to used when communicating with the remote 
122 mailserver.  If no protocol is specified,
123 .I fetchmail
124 will try each of the supported protocols in turn, terminating after
125 any successful attempt.
126 .I proto 
127 may be one of the following:
128 .RS
129 .IP IMAP
130 IMAP2bis, a compatible subset of IMAP4.
131 .IP POP2
132 Post Office Protocol 2
133 .IP POP3
134 Post Office Protocol 3
135 .IP APOP
136 Use POP3 with MD5 authentication.
137 .IP KPOP
138 Use POP3 with Kerberos authentication on port 1109.
139 .RE
140 .TP
141 .B \-P, --port
142 The  option permits you to specify a TCP/IP port to connect on. 
143 This option will seldom be necessary as all the supported protocols have
144 well-established default port numbers.
145 .TP
146 .B \-A, --auth
147 This option permits you to specify an authentication type (see USER
148 AUTHENTICATION below for details).  The possible values are
149 \&`\fBpassword\fR' and `\fBkerberos\fR'.  This option is provided
150 primarily for developers; choosing KPOP protocol automatically selects
151 Kerberos authentication, and all other alternatives use ordinary
152 password authentication (though APOP uses a generated one-time
153 key as the password).
154 .TP
155 .B \-r folder, --remote folder
156 Causes a specified non-default mail folder on the mailserver to be retrieved.
157 The syntax of the folder name is server dependent, as is the default
158 behavior when no folder is specified.  This option is not available
159 under POP3.
160 .TP
161 .B \-s, --silent
162 Silent mode.  Suppresses all progress/status messages that are normally
163 echoed to standard error during a fetch.  The --verbose option
164 overrides this.
165 .TP
166 .B \-v, --verbose
167 Verbose mode.  All control messages passed between 
168 .I fetchmail
169 and the mailserver are echoed to stderr.  Overrides --silent.
170 .TP
171 .B \-u name, --username name
172 Specifies the user identification to be used when logging in to the mailserver.
173 The appropriate user identification is both server and user-dependent.  
174 The default is your login name on the client machine that is running 
175 .I fetchmail.
176 See USER AUTHENTICATION below for a complete description.
177 .TP
178 .B \-n, --norewrite
179 Normally,
180 .I fetchmail
181 edits RFC-822 address headers (To, From, Cc, Bcc, and Reply-To) in
182 fetched mail so that any mail IDs local to the server are expanded to
183 full addresses (@ and the mailserver hostname are appended).  This enables 
184 replies on the client to get addressed correctly (otherwise your
185 mailer might think they should be addressed to local users on the
186 client machine).  This option disables the rewrite.
187 .TP
188 .B \-V, --version
189 Displays the version information for your copy of 
190 .I fetchmail.
191 No mail fetch is performed.
192 Instead, for each server specified, all option information
193 that would be computed if
194 .I fetchmail.
195 were connecting to that server is displayed.  Any non-printables in
196 passwords or other string names are shown as backslashed C-like
197 escape sequences.
198 .PP
199 Each server name that you specify following the options on the
200 command line will be queried.  If you don't specify any servers
201 on the command line, each server in your 
202 .I ~/.fetchmailrc
203 file will be queried.
204 .SH USER AUTHENTICATION
205 Normal user authentication in 
206 .I fetchmail
207 is very much like the authentication mechanism of 
208 .I ftp(1).
209 The correct user-id and password depend upon the underlying security
210 system at the mailserver.  
211 .PP
212 If the mailserver is a Unix machine on which you have an ordinary user 
213 account, your regular login name and password are used with 
214 .I fetchmail.
215 If you use the same login name on both the server and the client machines,
216 you needn't worry about specifying a user-id with the 
217 .B \-u
218 option \-\- 
219 the default behavior is to use your login name on the client machine as the 
220 user-id on the server machine.  If you use a different login name
221 on the server machine, specify that login name with the
222 .B \-u
223 option.  e.g. if your login name is 'jsmith' on a machine named 'mailgrunt',
224 you would start 
225 .I fetchmail 
226 as follows:
227 .IP
228 fetchmail -u jsmith mailgrunt
229 .PP
230 The default behavior of 
231 .I fetchmail
232 is to prompt you for your mailserver password before the connection is
233 established.  This is the safest way to use 
234 .I fetchmail
235 and ensures that your password will not be compromised.  You may also specify
236 your password in your
237 .I ~/.fetchmailrc
238 file.  This is convenient when using 
239 .I fetchmail
240 in daemon mode or with scripts.
241 .PP
242 On mailservers that do not provide ordinary user accounts, your user-id and 
243 password are usually assigned by the server administrator when you apply for 
244 a mailbox on the server.  Contact your server administrator if you don't know 
245 the correct user-id and password for your mailbox account.
246 .PP
247 RFC1460 introduced APOP authentication.  In this variant of POP3,
248 you register an APOP password on your server host (the program
249 to do this with on the server is probably called \fIpopauth\fR(8)).  You
250 put the same password in your 
251 .I .fetchmailrc
252 file.  Each time 
253 .I fetchmail
254 logs in, it sends a cryptographically secure hash of your password and
255 the server greeting time to the server, which can verify it by
256 checking its authorization database. 
257 .PP
258 If your \fIfetchmail\fR was built with Kerberos support and you specify 
259 Kerberos authentication (either with --auth or the \fI.fetchmailrc\fR
260 option \fBauthenticate kerberos\fR) it will try to get a Kerberos
261 ticket from the mailserver at the start of each query. 
262 .SH DAEMON MODE
263 The 
264 .B --daemon
265 or
266 .B -d 
267 option runs 
268 .I fetchmail
269 in daemon mode.  You must specify a numeric argument which is a
270 polling interval in seconds.
271 .PP
272 In daemon mode, 
273 .I fetchmail
274 puts itself in background and runs forever, querying each specified
275 host and then sleeping for the given polling interval.
276 .PP
277 Simply invoking
278 .IP
279 fetchmail -d 900
280 .PP
281 will, therefore, poll all the hosts described in your 
282 .I ~/.fetchmailrc
283 file (except those explicitly excluded with the `skip' option) once
284 every fifteen minutes.
285 .PP
286 Only one daemon process is permitted per user; in daemon mode,
287 .I fetchmail
288 makes a per-user lockfile to guarantee this.  The option
289 .B --quit
290 will kill a running daemon process.  Otherwise, calling fetchmail with
291 a daemon in the background sends a wakeup signal to the daemon,
292 forcing it to poll mailservers immediately.
293 .PP
294 The 
295 .B -t
296 or
297 .B --timeout
298 option allows you to set a server-nonresponse timeout in seconds.  If
299 a mailserver does not send a greeting message or respond to commands for
300 the given number of seconds, \fIfetchmail\fR will hang up on it.
301 Without such a timeout \fIfetchmail\fR might hang up indefinitely
302 trying to fetch mail from a down host.  This would be particularly
303 annoying for a \fIfetchmail\fR running in background.
304 .PP
305 The
306 .B -L
307 or
308 .B --logfile
309 option allows you to redirect status messages emitted while in daemon
310 mode into a specified logfile (follow the option with the logfile name).
311 The logfile is opened for append, so previous messages aren't deleted.
312 This is primarily useful for debugging configurations.
313 .SH RETRIEVAL FAILURE MODES
314 The protocols \fIfetchmail\fR uses to talk to mailservers are next to
315 bulletproof.  In normal operation forwarding to port 25, no message is
316 ever deleted (or even marked for deletion) on the host until the SMTP
317 listener on the client has acknowledged to \fIfetchmail\fR that the
318 message has been accepted for delivery.  When forwarding to an MDA,
319 however, there is more possibility of error (because there's no way
320 for fetchmail to get a reliable positive acknowledgement from the MDA).
321 .PP
322 The normal mode of \fIfetchmail\fR is to try to download only `new'
323 messages, leaving untouched (and undeleted) messages you have already
324 read directly on the server (or fetched with a previous \fIfetchmail
325 --keep\fR).  But you may find that messages you've already read on the
326 server are being fetched (and deleted) even when you don't specify
327 --all.  There are several reasons this can happen.
328 .PP
329 One could be that you're using POP2.  The POP2 protocol includes no
330 representation of `new' or `old' state in messages, so \fIfetchmail\fR
331 must treat all messages as new all the time.  But POP2 is obsolete, so
332 this is unlikely.
333 .PP
334 Under POP3, blame RFC1725.  That version of the POP3 protocol
335 specification removed the LAST command, and some POP servers follow it
336 (you can verify this by invoking \fIfetchmail -v\fR to the mailserver
337 and watching the response to LAST early in the query).  The
338 \fIfetchmail\fR code tries to compensate by using POP3's UID feature,
339 storing the identifiers of messages seen in each session until the
340 next session, in the \fI.fetchids\fR file.  But this doesn't track
341 messages seen with other clients, or read directly with a mailer on
342 the host but not deleted afterward.  A better solution would be to
343 switch to IMAP.
344 .PP
345 Another potential POP3 problem might be servers that insert messages
346 in the middle of mailboxes (some VMS implementations of mail are
347 rumored to do this).  The \fIfetchmail\fR code assumes that new
348 messages are appended to the end of the mailbox; when this is not true
349 it may treat some old messages as new and vice versa.  The only 
350 real fix for this problem is to  switch to IMAP.
351 .PP
352 The IMAP code uses the presence or absence of the server flag \eSeen
353 to decide whether or not a message is new.  Under Unix, it counts on
354 your IMAP server to notice the BSD-style Status flags set by mail user
355 agents and set the \Seen flag from them when appropriate.  All Unix
356 IMAP servers we know of do this, though it's not specified by the IMAP
357 RFCs.  If you ever trip over a server that doesn't, the symptom will
358 be that messages you have already read on your host will look new to
359 the server.  In this (unlikely) case, only messages you fetched with
360 \fIfetchmail --keep\fR will be both undeleted and marked old.
361 .SH THE RUN CONTROL FILE
362 The preferred way to set up fetchmail (and the only way if you want to
363 avoid specifying passwords each time it runs) is to write a
364 \fI.fetchmailrc\fR file in your home directory.  To protect the security
365 of your passwords, your \fI~/.fetchmailrc\fR may not have more than u+r,u+w
366 permissions;
367 .I fetchmail
368 will complain and exit otherwise.
369 .PP
370 Comments begin with a '#' and extend through the end of the line.
371 Otherwise the file consists of a series of free-format server entries.
372 Any amount of whitespace separates keywords, tokens, or strings in
373 server entries, but is otherwise ignored (except that whitespace
374 enclosed in double quotes is treated as part of the string).  Keywords
375 and identifiers are case sensitive.  You may use standard C-style
376 escapes (\en, \et, \eb, octal, and hex) to embed non-printable
377 characters or string delimiters in strings.  When there is a conflict
378 between the command-line arguments and the arguments in this file, the
379 command-line arguments take precedence.
380 .PP
381 Each server entry consists of the keyword `server', followed by a
382 server name, followed by server options, followed by any number of
383 user descriptions.
384 .PP
385 Legal server options are:
386
387     server
388     protocol (or proto)
389     port
390     skip
391     noskip
392     authenticate (or auth)
393     timeout
394
395 Legal user options are
396
397     username (or user)
398     is
399     to
400     password (or pass)
401     remotefolder (or remote)
402     smtphost (or smtp)
403     mda
404     keep
405     flush
406     fetchall
407     rewrite
408     nokeep
409     noflush
410     nofetchall
411     norewrite
412 .PP
413 All options correspond to the obvious command-line arguments except
414 five: `is', `to', `password', and `skip'.
415 .PP
416 The `is' or `to' keywords associate the following local (client)
417 name(s) (or server-name to client-name mappings separated by =) with
418 the mailserver user name in the entry.
419 .PP
420 A single local name can be used to support redirecting your mail when
421 your username on the client machine is different from your name on the
422 mailserver.  When there is only a single local name, mail is forwarded
423 to that local username regardless of the message's To, Cc, and Bcc headers.
424 .PP
425 When there is more than one local name (or name mapping) the
426 \fIfetchmail\fR code does look at the To, Cc, and Bcc headers of
427 retrieved mail. When a declared mailserver username is recognized, its
428 local mapping is added to the list of local recipients.  If
429 \fIfetchmail\fR cannot recognize any mailserver usernames, the default
430 recipient is the calling user, unless the calling user is root in
431 which case it is the remote user name of the current entry.
432 .PP
433 The \fBpassword\fR option requires a string argument, which is the password
434 to be used with the entry's server.
435 .PP
436 The \fBaliases\fR option declares names that are recognized as OK for
437 local delivery.  Your local name is automatically one of these; the
438 aliases directive can be used to declare others.   
439 .PP
440 The `skip' option tells
441 .I fetchmail 
442 not to query this host unless it is explicitly named on the command
443 line.  A host entry with this flag will be skipped when
444 .I fetchmail
445 called with no arguments steps through all hosts in the run control file.
446 (This option allows you to experiment with test entries safely, or easily
447 disable entries for hosts that are temporarily down.)
448 .PP
449 Legal protocol identifiers are
450
451     auto (or AUTO)
452     pop2 (or POP2)
453     pop3 (or POP3)
454     imap (or IMAP)
455     apop (or APOP)
456     kpop (or KPOP)
457
458 .PP
459 Legal authentication types are `password' or `kerberos'.  The former
460 specifies authentication by normal transmission of a password (the
461 password may be plaintext or subject to protocol-specific encryption
462 as in APOP); the second tells \fIfetchmail\fR to try to get a Kerberos
463 ticket at the start of each query instead, and send an arbitrary
464 string as the password.
465 .PP
466 Specifying `kpop' sets POP3 protocol over port 1109 with Kerberos
467 authentication.  These defaults may be overridden by later options.
468 .PP
469 You can use the noise keywords `and', `with',
470 `has', `wants', and `options' anywhere in an entry to make
471 it resemble English.  They're ignored, but but can make entries much
472 easier to read at a glance.  The punctuation characters ':', ';' and
473 ',' are also ignored.
474 .PP
475 The words `here' and `there' have useful English-like
476 significance.  Normally `user eric is esr' would mean that 
477 mail for the remote user `eric' is to be delivered to `esr',
478 but you can make this clearer by saying `user eric there is esr here',
479 or reverse it by saying `user esr here is eric there'
480 .PP
481 Finally, instead of saying `server fubar.com skip ...' you can say
482 \&`skip server fubar.com ...'
483 .PP
484 Basic format is:
485
486 .nf
487   server SERVERNAME protocol PROTOCOL username NAME password PASSWORD 
488 .fi
489 .PP
490 Example:
491
492 .nf
493   server pop.provider.net protocol pop3 username jsmith password secret1
494 .fi
495 .PP
496 Or, using some abbreviations:
497
498 .nf
499   server pop.provider.net proto pop3 user jsmith password secret1
500 .fi
501 .PP
502 Multiple servers may be listed:
503
504 .nf
505   server pop.provider.net proto pop3 user jsmith pass secret1
506   server other.provider.net proto pop2 user John.Smith pass My^Hat
507 .fi
508
509 Here's a version of those two with more whitespace and some noise words: 
510
511 .nf
512   server pop.provider.net proto pop3
513       user jsmith, with password secret1, is jsmith here;
514   server other.provider.net proto pop2:
515       user John.Smith with password My^Hat, is John.Smith here;
516 .fi
517
518 This version is much easier to read and doesn't cost significantly
519 more (parsing is done only once, at startup time).
520
521 .PP
522 If you need to include whitespace in a parameter string, enclose the
523 string in double quotes.  Thus:
524
525 .nf
526   server mail.provider.net with proto pop3:
527         user jsmith there has password "u can't krak this"
528                     is jws here and wants mda "/bin/mail"
529 .fi
530
531 You may have an initial server description headed by the keyword
532 `defaults' instead of `server' followed by a name.  Such a record
533 is interpreted as defaults for all queries to use. It may be overwritten
534 by individual server descriptions.  So, you could write:
535
536 .nf
537   defaults proto pop3
538         user jsmith
539   server pop.provider.net
540         pass secret1
541   server mail.provider.net
542         user jjsmith there has password secret2
543 .fi
544
545 It's possible to specify more than one user per server (this is only
546 likely to be useful when running fetchmail in daemon mode as root).
547 The `user' keyword leads off a user description, and every user
548 description except optionally the first one must include it.  (If the
549 first description lacks the `user' keyword, the name of the
550 invoking user is used.) Here's a contrived example:
551
552 .nf
553   server pop.provider.net proto pop3 port 3111
554         pass gumshoe
555         user jsmith with pass secret1 is smith here
556         user jones with pass secret2 is jjones here
557 .fi
558
559 This says that the user invoking \fIfetchmail\fR has the same username
560 on pop.provider.net, and password `gumshoe' there.
561 It also associates the local username `smith' with the pop.provider.net
562 username `jsmith' and the local username `jones' with the pop.provider.net
563 username `jjones'.
564 .PP
565 This example is contrived because, in practice, you are very unlikely
566 to be specifying multiple users per server unless running it as root
567 (thus the `pass gumshoe' would try to fetch root's mail on
568 pop-provider.net, which is probably not what you want).
569 In any case, we strongly recommend always having an explicit
570 \&`user' clause when specifying multiple users for server.
571 .PP
572 Here's what a simple retrieval configuration for a multi-drop mailbox
573 looks like:
574
575 .nf
576   server pop.provider.net:
577         user maildrop with pass secret1 to golux hurkle=happy snark here
578 .fi
579
580 This says that the mailbox of account `maildrop' on the server is a
581 multi-drop box, and that messages in it should be parsed for the
582 server user names `golux', `hurkle', and `snark'.  It further
583 specifies that `golux' and `snark' have the same name on the
584 client as on the server, but mail for server user `hurkle' should be
585 delivered to client user `happy'.
586 .PP
587 Local names can also be used to administer a mailing list from the
588 client side of a \fIfetchmail\fR collection.  Suppose your name is
589 \&`esr', and you want to both pick up your own mail and maintain a mailing
590 list called (say) "fetchmail-friends", and you want to keep the alias
591 list on your client machine.  On your server, you can alias
592 \&`fetchmail-friends' to `esr'; then, in your \fI.fetchmailrc\fR, declare
593 \&`to esr fetchmail-friends here'.  Then, when mail including `fetchmail'
594 in any of its recipient lines line gets fetched, the alias will be
595 appended to the list of recipients your SMTP listener sees.  Therefore
596 it will undergo alias expansion locally.
597 .SH EXIT CODES
598 To facilitate the use of 
599 .I fetchmail
600 in shell scripts, an exit code is returned to give an indication
601 of what occurred during a given connection.
602 .PP
603 The exit codes returned by 
604 .I fetchmail
605 are as follows:
606 .IP 0
607 One or more messages were successfully retrieved.
608 .IP 1
609 There was no mail awaiting retrieval.
610 .IP 2
611 An error was encountered when attempting to open a socket for the POP 
612 connection.  If you don't know what a socket is, don't worry about it --
613 just treat this as an 'unrecoverable error'.
614 .IP 3
615 The user authentication step failed.  This usually means that a bad 
616 user-id, password, or APOP id was specified.
617 .IP 4
618 Some sort of fatal protocol error was detected.
619 .IP 5
620 There was a syntax error in the arguments to 
621 .I fetchmail.
622 .IP 6
623 The run control file had bad permissions.
624 .IP 7
625 There was an error condition reported by the server (POP3 only).
626 .IP 8
627 Exclusion error.  This means 
628 .I fetchmail
629 either found another copy of itself already running, or failed in such
630 a way that it isn't sure whether another copy is running.
631 .IP 9
632 The 
633 .I fetchmail.
634 run failed while trying to do an SMTP port open or transaction.
635 .IP 10
636 Internal error.  You should see a message on standard error with
637 details.
638 .PP
639 When
640 .I fetchmail
641 queries more than one host, the returned status is that of the last
642 host queried.
643 .SH AUTHORS
644 .I fetchmail
645 was originated (under the name `popclient') by Carl Harris at Virginia
646 Polytechnic Institute and State University (a.k.a. Virginia Tech).
647 .PP
648 Version 3.0 of popclient was extensively rewritten and improved by
649 Eric S. Raymond <esr@snark.thyrsus.com>. The program's name was
650 then changed to
651 .I fetchmail
652 to reflect both the presence of IMAP support and the symmetry with sendmail
653 created by the new SMTP forwarding default.
654 .SH BACKWARD COMPATIBILITY
655 If called through a link named `popclient', \fIfetchmail\fR will
656 look in ~/.poprc for its run control file.  As long as the file does
657 not use the removed `limit' or `localfolder' options, this
658 will often work.  (The new run control file syntax also has to be a
659 little stricter about the order of options than the old, in order to
660 support multiple user desriptions per server; thus you may have to
661 rearrange things a bit.)
662 .SH FILES
663 .TP 5
664 ~/.fetchmailrc
665 default run control file
666 .TP 5
667 ~/.fetchids
668 default location of file associating hosts with last message IDs seen
669 (used only with newer RFC1725-compliant POP3 servers supporting the
670 UIDL command).
671 .TP 5
672 ${TMPDIR}/fetchmail-${USER}
673 lock file to help prevent concurrent runs.
674 .SH ENVIRONMENT
675 For correct initialization, 
676 .I fetchmail
677 requires either that both the USER and HOME environment variables are
678 correctly set, or that \fBgetpwuid\fR(3) be able to retrieve a password
679 entry from your user ID.
680 .SH BUGS AND KNOWN PROBLEMS
681 Use of any of the supported protocols other than APOP or KPOP requires
682 that the program send unencrypted passwords over the TCP/IP connection
683 to the mailserver.  This creates a risk that name/password pairs
684 might be snaffled with a packet sniffer or more sophisticated
685 monitoring software.
686 .PP
687 Retrieval and forwarding from multi-drop server mailboxes is at most
688 as reliable as your mail server host's DNS service.  Each host address
689 part in each message of a multi-drop mailbox is looked up through DNS
690 to see if it's an alias of the mail server.  If it is, but the lookup
691 fails due to network congestion or a crashed server, forwarding will
692 not get done correctly.  This check \fIwill\fR catch equivalences
693 created by MX records.
694 .PP
695 The multi-drop mailbox code was hard to test thoroughly and may have obscure
696 failure modes, especially in the presence of DNS flakiness.
697 .PP
698 Under Linux, if fetchmail is run in daemon mode with the network
699 inaccessible, each poll leaves a socket allocated but in CLOSE state
700 (this is visible in netstat(1)'s output).  For some reason, these
701 sockets aren't garbage-collected until \fIfetchmail\fR exits.  When
702 whatever kernel table is involved fills up, fetchmail can no longer
703 run even if the network is up.  This appears \fInot\fR to be a socket
704 leak in \fIfetchmail\fR, but rather some glitch or misfeature in the system
705 network code.  To avoid this problem, fetchmail commits seppuku after
706 too many unsuccessful socket opens.
707 .PP
708 Send comments, bug reports, gripes, and the like to Eric S. Raymond
709 <esr@thyrsus.com>.
710 .SH SEE ALSO
711 elm(1), mail(1), sendmail(8), popd(8), imapd(8);
712 RFC 937, RFC 1081, RFC1176, RFC 1225, RFC 1460, RFC 1725, RFC1939.