]> Pileus Git - ~andy/fetchmail/blob - fetchmail.man
Let logfile take precedence over syslog if and only if logfile is effective.
[~andy/fetchmail] / fetchmail.man
1 '\" t
2 .\" ** The above line should force tbl to be used as a preprocessor **
3 .\"
4 .\" Manual page in man(7) format with tbl(1) and groff_www(7)
5 .\" macros for fetchmail
6 .\"
7 .\" For license terms, see the file COPYING in this directory.
8 .\"
9 .\"
10 .\" Load www macros to process .URL requests, this requires groff:
11 .mso www.tmac
12 .\"
13 .TH fetchmail 1 "fetchmail 6.3.10" "fetchmail" "fetchmail reference manual"
14
15 .SH NAME
16 fetchmail \- fetch mail from a POP, IMAP, ETRN, or ODMR-capable server
17
18 .SH SYNOPSIS
19 \fBfetchmail\fP [\fIoption...\fP] [\fImailserver...\fP]
20 .br
21 \fBfetchmailconf\fP
22
23 .SH DESCRIPTION
24 \fBfetchmail\fP is a mail-retrieval and forwarding utility; it fetches
25 mail from remote mailservers and forwards it to your local (client)
26 machine's delivery system.  You can then handle the retrieved mail using
27 normal mail user agents such as \fBmutt\fP(1), \fBelm\fP(1) or
28 \fBMail\fP(1).  The \fBfetchmail\fP utility can be run in a daemon mode
29 to repeatedly poll one or more systems at a specified interval.
30 .PP
31 The \fBfetchmail\fP program can gather mail from servers supporting any
32 of the common mail-retrieval protocols: POP2 (legacy, to be removed from
33 future release), POP3, IMAP2bis, IMAP4, and IMAP4rev1.  It can also use
34 the ESMTP ETRN extension and ODMR.  (The RFCs describing all these
35 protocols are listed at the end of this manual page.)
36 .PP
37 While \fBfetchmail\fP is primarily intended to be used over on-demand
38 TCP/IP links (such as SLIP or PPP connections), it may also be useful as
39 a message transfer agent for sites which refuse for security reasons to
40 permit (sender-initiated) SMTP transactions with sendmail.
41 .PP
42 If \fBfetchmail\fP is used with a POP or an IMAP server (but not with
43 ETRN or ODMR), it has two fundamental modes of operation for each user
44 account from which it retrieves mail: \fIsingledrop\fP- and
45 \fImultidrop\fP-mode.
46 .IP "In singledrop-mode,"
47 \fBfetchmail\fP assumes that all messages in the user's account
48 (mailbox) are intended for a single recipient.  The identity of the
49 recipient will either default to the local user currently executing
50 \fBfetchmail\fP, or will need to be explicitly specified in the
51 configuration file.
52 .IP
53 \fBfetchmail\fP uses singledrop-mode when the fetchmailrc configuration
54 contains at most a single local user specification for a given server
55 account.
56 .IP "In multidrop-mode,"
57 \fBfetchmail\fP assumes that the mail server account actually contains
58 mail intended for any number of different recipients.  Therefore,
59 \fBfetchmail\fP must attempt to deduce the proper "envelope recipient"
60 from the mail headers of each message.  In this mode of operation,
61 \fBfetchmail\fP almost resembles a mail transfer agent (MTA).
62 .IP
63 Note that neither the POP nor IMAP protocols were intended for use in
64 this fashion, and hence envelope information is often not directly
65 available.  The ISP must stores the envelope information in some message
66 header \fBand\fP. The ISP must also store one copy of the message per
67 recipient. If either of the conditions is not fulfilled, this process is
68 unreliable, because \fBfetchmail\fP must then resort to guessing the
69 true envelope recipient(s) of a message. This usually fails for mailing
70 list messages and Bcc:d mail, or mail for multiple recipients in your
71 domain.
72 .IP
73 \fBfetchmail\fP uses multidrop-mode when more than one local user and/or
74 a wildcard is specified for a particular server account in the
75 configuration file.
76 .IP "In ETRN and ODMR modes,"
77 these considerations do not apply, as these protocols are based on SMTP,
78 which provides explicit envelope recipient information. These protocols
79 always support multiple recipients.
80 .PP
81 As each message is retrieved, \fBfetchmail\fP normally delivers it via
82 SMTP to port 25 on the machine it is running on (localhost), just as
83 though it were being passed in over a normal TCP/IP link.
84 \fBfetchmail\fP provides the SMTP server with an envelope recipient
85 derived in the manner described previously.  The mail will then be
86 delivered according to your MTA's rules (the Mail Transfer Agent is
87 usually \fBsendmail\fP(8), \fBexim\fP(8), or \fBpostfix\fP(8)).
88 Invoking your system's MDA (Mail Delivery Agent) is the duty of your
89 MTA.  All the delivery-control mechanisms (such as \fI.forward\fP files)
90 normally available through your system MTA and local delivery agents
91 will therefore be applied as usual.
92 .PP
93 If your fetchmail configuration sets a local MDA (see the \-\-mda
94 option), it will be used directly instead of talking SMTP to port 25.
95 .PP
96 If the program \fBfetchmailconf\fP is available, it will assist you in
97 setting up and editing a fetchmailrc configuration.  It runs under the X
98 window system and requires that the language Python and the Tk toolkit
99 (with Python bindings) be present on your system.  If you are first
100 setting up fetchmail for single-user mode, it is recommended that you
101 use Novice mode.  Expert mode provides complete control of fetchmail
102 configuration, including the multidrop features.  In either case,
103 the 'Autoprobe' button will tell you the most capable protocol a given
104 mailserver supports, and warn you of potential problems with that
105 server.
106
107 .SH GENERAL OPERATION
108 The behavior of \fBfetchmail\fP is controlled by command-line options and a
109 run control file, \fI~/.fetchmailrc\fP,
110 the syntax of which we describe in a later section (this file is what
111 the \fBfetchmailconf\fP program edits).  Command-line options override
112 \fI~/.fetchmailrc\fP declarations.
113 .PP
114 Each server name that you specify following the options on the command
115 line will be queried.  If you don't specify any servers on the command
116 line, each 'poll' entry in your \fI~/.fetchmailrc\fP file will be
117 queried.
118 .PP
119 To facilitate the use of \fBfetchmail\fP in scripts and pipelines, it
120 returns an appropriate exit code upon termination -- see EXIT CODES
121 below.
122 .PP
123 The following options modify the behavior of \fBfetchmail\fP.  It is
124 seldom necessary to specify any of these once you have a
125 working \fI.fetchmailrc\fP file set up.
126 .PP
127 Almost all options have a corresponding keyword which can be used to
128 declare them in a \fI.fetchmailrc\fP file.
129 .PP
130 Some special options are not covered here, but are documented instead
131 in sections on AUTHENTICATION and DAEMON MODE which follow.
132 .SS General Options
133 .TP
134 .B \-V | \-\-version
135 Displays the version information for your copy of \fBfetchmail\fP.  No mail
136 fetch is performed.  Instead, for each server specified, all the option
137 information that would be computed if \fBfetchmail\fP were connecting to that
138 server is displayed.  Any non-printables in passwords or other string names
139 are shown as backslashed C-like escape sequences.  This option is useful for
140 verifying that your options are set the way you want them.
141 .TP
142 .B \-c | \-\-check
143 Return a status code to indicate whether there is mail waiting,
144 without actually fetching or deleting mail (see EXIT CODES below).
145 This option turns off daemon mode (in which it would be useless).  It
146 doesn't play well with queries to multiple sites, and doesn't work
147 with ETRN or ODMR.  It will return a false positive if you leave read but
148 undeleted mail in your server mailbox and your fetch protocol can't
149 tell kept messages from new ones.  This means it will work with IMAP,
150 not work with POP2, and may occasionally flake out under POP3.
151 .TP
152 .B \-s | \-\-silent
153 Silent mode.  Suppresses all progress/status messages that are
154 normally echoed to standard output during a fetch (but does not
155 suppress actual error messages).  The \-\-verbose option overrides this.
156 .TP
157 .B \-v | \-\-verbose
158 Verbose mode.  All control messages passed between \fBfetchmail\fP
159 and the mailserver are echoed to stdout.  Overrides \-\-silent.
160 Doubling this option (\-v \-v) causes extra diagnostic information
161 to be printed.
162 .TP
163 .B \-\-nosoftbounce
164 (since v6.3.10, Keyword: set no softbounce, since v6.3.10)
165 .br
166 Hard bounce mode. All permanent delivery errors cause messages to be
167 deleted from the upstream server, see "no softbounce" below.
168 .TP
169 .B \-\-softbounce
170 (since v6.3.10, Keyword: set softbounce, since v6.3.10)
171 .br
172 Soft bounce mode. All permanent delivery errors cause messages to be
173 left on the upstream server if the protocol supports that. Default to
174 match historic fetchmail documentation, to be changed to hard bounce
175 mode in the next fetchmail release.
176 .SS Disposal Options
177 .TP
178 .B \-a | \-\-all | (since v6.3.3) \-\-fetchall
179 (Keyword: fetchall, since v3.0)
180 .br
181 Retrieve both old (seen) and new messages from the mailserver.  The
182 default is to fetch only messages the server has not marked seen.
183 Under POP3, this option also forces the use of RETR rather than TOP.
184 Note that POP2 retrieval behaves as though \-\-all is always on (see
185 RETRIEVAL FAILURE MODES below) and this option does not work with ETRN
186 or ODMR.  While the \-a and \-\-all command-line and fetchall rcfile
187 options have been supported for a long time, the \-\-fetchall
188 command-line option was added in v6.3.3.
189 .TP
190 .B \-k | \-\-keep
191 (Keyword: keep)
192 .br
193 Keep retrieved messages on the remote mailserver.  Normally, messages
194 are deleted from the folder on the mailserver after they have been retrieved.
195 Specifying the \fBkeep\fP option causes retrieved messages to remain in
196 your folder on the mailserver.  This option does not work with ETRN or
197 ODMR. If used with POP3, it is recommended to also specify the \-\-uidl
198 option or uidl keyword.
199 .TP
200 .B \-K | \-\-nokeep
201 (Keyword: nokeep)
202 .br
203 Delete retrieved messages from the remote mailserver.  This
204 option forces retrieved mail to be deleted.  It may be useful if
205 you have specified a default of \fBkeep\fP in your
206 \&\fI.fetchmailrc\fP.  This option is forced on with ETRN and ODMR.
207 .TP
208 .B \-F | \-\-flush
209 (Keyword: flush)
210 .br
211 POP3/IMAP only.  This is a dangerous option and can cause mail loss when
212 used improperly. It deletes old (seen) messages from the mailserver
213 before retrieving new messages.  \fBWarning:\fP This can cause mail loss if
214 you check your mail with other clients than fetchmail, and cause
215 fetchmail to delete a message it had never fetched before.  It can also
216 cause mail loss if the mail server marks the message seen after
217 retrieval (IMAP2 servers). You should probably not use this option in your
218 configuration file. If you use it with POP3, you must use the 'uidl'
219 option. What you probably want is the default setting: if you don't
220 specify '\-k', then fetchmail will automatically delete messages after
221 successful delivery.
222 .TP
223 .B \-\-limitflush
224 POP3/IMAP only, since version 6.3.0.  Delete oversized messages from the
225 mailserver before retrieving new messages. The size limit should be
226 separately specified with the \-\-limit option.  This option does not
227 work with ETRN or ODMR.
228 .SS Protocol and Query Options
229 .TP
230 .B \-p <proto> | \-\-proto <proto> | \-\-protocol <proto>
231 (Keyword: proto[col])
232 .br
233 Specify the protocol to use when communicating with the remote
234 mailserver.  If no protocol is specified, the default is AUTO.
235 \fBproto\fP may be one of the following:
236 .RS
237 .IP AUTO
238 Tries IMAP, POP3, and POP2 (skipping any of these for which support
239 has not been compiled in).
240 .IP POP2
241 Post Office Protocol 2 (legacy, to be removed from future release)
242 .IP POP3
243 Post Office Protocol 3
244 .IP APOP
245 Use POP3 with old-fashioned MD5-challenge authentication.
246 Considered not resistant to man-in-the-middle attacks.
247 .IP RPOP
248 Use POP3 with RPOP authentication.
249 .IP KPOP
250 Use POP3 with Kerberos V4 authentication on port 1109.
251 .IP SDPS
252 Use POP3 with Demon Internet's SDPS extensions.
253 .IP IMAP
254 IMAP2bis, IMAP4, or IMAP4rev1 (\fBfetchmail\fP automatically detects their capabilities).
255 .IP ETRN
256 Use the ESMTP ETRN option.
257 .IP ODMR
258 Use the the On-Demand Mail Relay ESMTP profile.
259 .RE
260 .PP
261 All these alternatives work in basically the same way (communicating
262 with standard server daemons to fetch mail already delivered to a
263 mailbox on the server) except ETRN and ODMR.  The ETRN mode
264 allows you to ask a compliant ESMTP server (such as BSD sendmail at
265 release 8.8.0 or higher) to immediately open a sender-SMTP connection
266 to your client machine and begin forwarding any items addressed to
267 your client machine in the server's queue of undelivered mail.   The
268 ODMR mode requires an ODMR-capable server and works similarly to
269 ETRN, except that it does not require the client machine to have
270 a static DNS.
271 .TP
272 .B \-U | \-\-uidl
273 (Keyword: uidl)
274 .br
275 Force UIDL use (effective only with POP3).  Force client-side tracking
276 of 'newness' of messages (UIDL stands for "unique ID listing" and is
277 described in RFC1939).  Use with 'keep' to use a mailbox as a baby
278 news drop for a group of users. The fact that seen messages are skipped
279 is logged, unless error logging is done through syslog while running in
280 daemon mode.  Note that fetchmail may automatically enable this option
281 depending on upstream server capabilities.  Note also that this option
282 may be removed and forced enabled in a future fetchmail version. See
283 also: \-\-idfile.
284 .TP
285 .B \-\-idle (since 6.3.3)
286 (Keyword: idle, since before 6.0.0)
287 .br
288 Enable IDLE use (effective only with IMAP). Note that this works with
289 only one folder at a given time.  While the idle rcfile keyword had been
290 supported for a long time, the \-\-idle command-line option was added in
291 version 6.3.3. IDLE use means that fetchmail tells the IMAP server to
292 send notice of new messages, so they can be retrieved sooner than would
293 be possible with regular polls.
294 .TP
295 .B \-P <portnumber> | \-\-service <servicename>
296 (Keyword: service) Since version 6.3.0.
297 .br
298 The service option permits you to specify a service name to connect to.
299 You can specify a decimal port number here, if your services database
300 lacks the required service-port assignments. See the FAQ item R12 and
301 the \-\-ssl documentation for details. This replaces the older \-\-port
302 option.
303 .TP
304 .B \-\-port <portnumber>
305 (Keyword: port)
306 .br
307 Obsolete version of \-\-service that does not take service names.
308 \fBNote:\fP this option may be removed from a future version.
309 .TP
310 .B \-\-principal <principal>
311 (Keyword: principal)
312 .br
313 The principal option permits you to specify a service principal for
314 mutual authentication.  This is applicable to POP3 or IMAP with Kerberos
315 authentication.
316 .TP
317 .B \-t <seconds> | \-\-timeout <seconds>
318 (Keyword: timeout)
319 .br
320 The timeout option allows you to set a server-nonresponse
321 timeout in seconds.  If a mailserver does not send a greeting message
322 or respond to commands for the given number of seconds,
323 \fBfetchmail\fP will hang up on it.  Without such a timeout
324 \fBfetchmail\fP might hang indefinitely trying to fetch mail from a
325 down host.  This would be particularly annoying for a \fBfetchmail\fP
326 running in the background.  There is a default timeout which fetchmail\~\-V
327 will report.  If a given connection receives too many timeouts in
328 succession, fetchmail will consider it wedged and stop retrying.
329 The calling user will be notified by email if this happens.
330 .TP
331 .B \-\-plugin <command>
332 (Keyword: plugin)
333 .br
334 The plugin option allows you to use an external
335 program to establish the TCP connection.  This is useful if you want
336 to use ssh, or need some special firewalling setup.  The
337 program will be looked up in $PATH and can optionally be passed the
338 hostname and port as arguments using "%h" and "%p" respectively (note
339 that the interpolation logic is rather primitive, and these tokens must
340 be bounded by whitespace or beginning of string or end of string).
341 Fetchmail will write to the plugin's stdin and read from the plugin's
342 stdout.
343 .TP
344 .B \-\-plugout <command>
345 (Keyword: plugout)
346 .br
347 Identical to the plugin option above, but this one is used for the SMTP
348 connections.
349 .TP
350 .B \-r <name> | \-\-folder <name>
351 (Keyword: folder[s])
352 .br
353 Causes a specified non-default mail folder on the mailserver (or
354 comma-separated list of folders) to be retrieved.  The syntax of the
355 folder name is server-dependent.  This option is not available under
356 POP3, ETRN, or ODMR.
357 .TP
358 .B \-\-tracepolls
359 (Keyword: tracepolls)
360 .br
361 Tell fetchmail to poll trace information in the form 'polling 
362 account %s' and 'folder %s' to the Received line it generates,
363 where the %s parts are replaced by the user's remote name, the poll
364 label, and the folder (mailbox) where available (the Received header
365 also normally includes the server's true name).  This can be used to
366 facilitate mail filtering based on the account it is being received
367 from. The folder information is written only since version 6.3.4.
368 .TP
369 .B \-\-ssl
370 (Keyword: ssl)
371 .br
372 Causes the connection to the mail server to be encrypted
373 via SSL.  Connect to the server using the specified base protocol over a
374 connection secured by SSL. This option defeats opportunistic starttls
375 negotiation. It is highly recommended to use \-\-sslproto 'SSL3'
376 \-\-sslcertck to validate the certificates presented by the server and
377 defeat the obsolete SSLv2 negotiation. More information is available in
378 the \fIREADME.SSL\fP file that ships with fetchmail.
379 .IP
380 Note that fetchmail may still try to negotiate SSL through starttls even
381 if this option is omitted. You can use the \-\-sslproto option to defeat
382 this behavior or tell fetchmail to negotiate a particular SSL protocol.
383 .IP
384 If no port is specified, the connection is attempted to the well known
385 port of the SSL version of the base protocol.  This is generally a
386 different port than the port used by the base protocol.  For IMAP, this
387 is port 143 for the clear protocol and port 993 for the SSL secured
388 protocol, for POP3, it is port 110 for the clear text and port 995 for
389 the encrypted variant.
390 .IP
391 If your system lacks the corresponding entries from /etc/services, see
392 the \-\-service option and specify the numeric port number as given in
393 the previous paragraph (unless your ISP had directed you to different
394 ports, which is uncommon however).
395 .TP
396 .B \-\-sslcert <name>
397 (Keyword: sslcert)
398 .br
399 For certificate-based client authentication.  Some SSL encrypted servers
400 require client side keys and certificates for authentication.  In most
401 cases, this is optional.  This specifies the location of the public key
402 certificate to be presented to the server at the time the SSL session is
403 established.  It is not required (but may be provided) if the server
404 does not require it.  It may be the same file as the private key
405 (combined key and certificate file) but this is not recommended. Also
406 see \-\-sslkey below.
407 .sp
408 \fBNOTE:\fP If you use client authentication, the user name is fetched
409 from the certificate's CommonName and overrides the name set with
410 \-\-user.
411 .TP
412 .B \-\-sslkey <name>
413 (Keyword: sslkey)
414 .br
415 Specifies the file name of the client side private SSL key.  Some SSL
416 encrypted servers require client side keys and certificates for
417 authentication.  In most cases, this is optional.  This specifies
418 the location of the private key used to sign transactions with the server
419 at the time the SSL session is established.  It is not required (but may
420 be provided) if the server does not require it. It may be the same file
421 as the public key (combined key and certificate file) but this is not
422 recommended.
423 .IP
424 If a password is required to unlock the key, it will be prompted for at
425 the time just prior to establishing the session to the server.  This can
426 cause some complications in daemon mode.
427 .IP
428 Also see \-\-sslcert above.
429 .TP
430 .B \-\-sslproto <name>
431 (Keyword: sslproto)
432 .br
433 Forces an SSL/TLS protocol. Possible values are \fB''\fP,
434 \&'\fBSSL2\fP', '\fBSSL23\fP', (use of these two values is discouraged
435 and should only be used as a last resort) \&'\fBSSL3\fP', and
436 \&'\fBTLS1\fP'.  The default behaviour if this option is unset is: for
437 connections without \-\-ssl, use \&'\fBTLS1\fP' that fetchmail will
438 opportunistically try STARTTLS negotiation with TLS1. You can configure
439 this option explicitly if the default handshake (TLS1 if \-\-ssl is not
440 used, does not work for your server.
441 .IP
442 Use this option with '\fBTLS1\fP' value to enforce a STARTTLS
443 connection. In this mode, it is highly recommended to also use
444 \-\-sslcertck (see below).
445 .IP
446 To defeat opportunistic TLSv1 negotiation when the server advertises
447 STARTTLS or STLS, use \fB''\fP.  This option, even if the argument is
448 the empty string, will also suppress the diagnostic 'SERVER:
449 opportunistic upgrade to TLS.' message in verbose mode. The default is
450 to try appropriate protocols depending on context.
451 .TP
452 .B \-\-sslcertck
453 (Keyword: sslcertck)
454 .br
455 Causes fetchmail to strictly check the server certificate against a set of
456 local trusted certificates (see the \fBsslcertpath\fP option). If the server
457 certificate cannot be obtained or is not signed by one of the trusted ones
458 (directly or indirectly), the SSL connection will fail, regardless of
459 the \fBsslfingerprint\fP option.
460 .IP
461 Note that CRL (certificate revocation lists) are only supported in
462 OpenSSL 0.9.7 and newer! Your system clock should also be reasonably
463 accurate when using this option.
464 .IP
465 Note that this optional behavior may become default behavior in future
466 fetchmail versions.
467 .TP
468 .B \-\-sslcertpath <directory>
469 (Keyword: sslcertpath)
470 .br
471 Sets the directory fetchmail uses to look up local certificates. The default
472 is your OpenSSL default one. The directory must be hashed as OpenSSL expects
473 it - every time you add or modify a certificate in the directory, you need
474 to use the \fBc_rehash\fP tool (which comes with OpenSSL in the tools/
475 subdirectory).
476 .TP
477 .B \-\-sslcommonname <common name>
478 (Keyword: sslcommonname)
479 .br
480 Use of this option is discouraged. Before using it, contact the
481 administrator of your upstream server and ask for a proper SSL
482 certificate to be used. If that cannot be attained, this option can be
483 used to specify the name (CommonName) that fetchmail expects on the
484 server certificate.  A correctly configured server will have this set to
485 the hostname by which it is reached, and by default fetchmail will
486 expect as much. Use this option when the CommonName is set to some other
487 value, to avoid the "Server CommonName mismatch" warning, and only if
488 the upstream server can't be made to use proper certificates.
489 .TP
490 .B \-\-sslfingerprint <fingerprint>
491 (Keyword: sslfingerprint)
492 .br
493 Specify the fingerprint of the server key (an MD5 hash of the key) in
494 hexadecimal notation with colons separating groups of two digits. The letter
495 hex digits must be in upper case. This is the default format OpenSSL uses,
496 and the one fetchmail uses to report the fingerprint when an SSL connection
497 is established. When this is specified, fetchmail will compare the server key
498 fingerprint with the given one, and the connection will fail if they do not
499 match regardless of the \fBsslcertck\fP setting. The connection will
500 also fail if fetchmail cannot obtain an SSL certificate from the server.
501 This can be used to prevent man-in-the-middle attacks, but the finger
502 print from the server needs to be obtained or verified over a secure
503 channel, and certainly not over the same Internet connection that
504 fetchmail would use.
505 .IP
506 Using this option will prevent printing certificate verification errors
507 as long as \-\-sslcertck is unset.
508 .IP
509 To obtain the fingerprint of a certificate stored in the file cert.pem,
510 try:
511 .sp
512 .nf
513         openssl x509 \-in cert.pem \-noout \-md5 \-fingerprint
514 .fi
515 .sp
516 For details, see
517 .BR x509 (1ssl).
518 .SS Delivery Control Options
519 .TP
520 .B \-S <hosts> | \-\-smtphost <hosts>
521 (Keyword: smtp[host])
522 .br
523 Specify a hunt list of hosts to forward mail to (one or more
524 hostnames, comma-separated). Hosts are tried in list order; the first
525 one that is up becomes the forwarding target for the current run.  If
526 this option is not specified, 'localhost' is used as the default.
527 Each hostname may have a port number following the host name.  The
528 port number is separated from the host name by a slash; the default
529 port is "smtp".  If you specify an absolute path name (beginning with
530 a /), it will be interpreted as the name of a UNIX socket accepting
531 LMTP connections (such as is supported by the Cyrus IMAP daemon)
532 Example:
533 .sp
534 .nf
535         \-\-smtphost server1,server2/2525,server3,/var/imap/socket/lmtp
536 .fi
537 .sp
538 This option can be used with ODMR, and will make fetchmail a relay
539 between the ODMR server and SMTP or LMTP receiver.
540 .TP
541 .B \-\-fetchdomains <hosts>
542 (Keyword: fetchdomains)
543 .br
544 In ETRN or ODMR mode, this option specifies the list of domains the
545 server should ship mail for once the connection is turned around.  The
546 default is the FQDN of the machine running \fBfetchmail\fP.
547 .TP
548 .B \-D <domain> | \-\-smtpaddress <domain>
549 (Keyword: smtpaddress)
550 .br
551 Specify the domain to be appended to addresses
552 in RCPT TO lines shipped to SMTP. When this is not specified, the name
553 of the SMTP server (as specified by \-\-smtphost) is used for SMTP/LMTP
554 and 'localhost' is used for UNIX socket/BSMTP.
555 .TP
556 .B \-\-smtpname <user@domain>
557 (Keyword: smtpname)
558 .br
559 Specify the domain and user to be put in RCPT TO lines shipped to SMTP.
560 The default user is the current local user.
561 .TP
562 .B \-Z <nnn> | \-\-antispam <nnn[, nnn]...>
563 (Keyword: antispam)
564 .br
565 Specifies the list of numeric SMTP errors that are to be interpreted
566 as a spam-block response from the listener.  A value of \-1 disables
567 this option.  For the command-line option, the list values should
568 be comma-separated.
569 .TP
570 .B \-m <command> | \-\-mda <command>
571 (Keyword: mda)
572 .br
573 You can force mail to be passed to an MDA directly
574 (rather than forwarded to port 25) with the \-\-mda or \-m option.
575
576 To
577 avoid losing mail, use this option only with MDAs like maildrop or
578 MTAs like sendmail that return a nonzero status on disk-full and other
579 resource-exhaustion errors; the nonzero status tells fetchmail that
580 delivery failed and prevents the message from being deleted off the
581 server.
582
583 If \fBfetchmail\fP is running as root, it sets its user id to
584 that of the target user while delivering mail through an MDA.  Some
585 possible MDAs are "/usr/sbin/sendmail \-i \-f %F \-\- %T" (\fBNote:\fP
586 some several older or vendor sendmail versions mistake \-\- for an
587 address, rather than an indicator to mark the end of the option arguments),
588 "/usr/bin/deliver" and "/usr/bin/maildrop \-d %T".  Local delivery
589 addresses will be inserted into the MDA command wherever you place a
590 %T; the mail message's From address will be inserted where you place
591 an %F.
592
593 \fBDo NOT enclose the %F or %T string in single quotes!\fP
594 For both %T and %F, fetchmail encloses the addresses in single quotes 
595 ('), after removing any single quotes they may contain, before the MDA 
596 command is passed to the shell.
597
598 \fBDo NOT use an MDA invocation that dispatches on the contents of 
599 To/Cc/Bcc,\fP like "sendmail \-i \-t" or "qmail-inject", it will create 
600 mail loops and bring the just wrath of many postmasters down upon your 
601 head.  This is one of the most frequent configuration errors!
602
603 Also, do \fInot\fP try to combine multidrop mode with an MDA such 
604 as maildrop that can only accept one address, unless your upstream 
605 stores one copy of the message per recipient and transports the envelope 
606 recipient in a header; you will lose mail.
607
608 The well-known
609 .BR procmail (1)
610 package is very hard to configure properly, it has a very nasty "fall
611 through to the next rule" behavior on delivery errors (even temporary
612 ones, such as out of disk space if another user's mail daemon copies the
613 mailbox around to purge old messages), so your mail will end up in the
614 wrong mailbox sooner or later. The proper procmail configuration is
615 outside the scope of this document. Using
616 .BR maildrop (1)
617 is usually much easier, and many users find the filter syntax used by
618 maildrop easier to understand.
619
620 Finally, we strongly advise that you do \fBnot\fP use qmail-inject.  The
621 command line interface is non-standard without providing benefits for
622 typical use, and fetchmail makes no attempts to accomodate
623 qmail-inject's deviations from the standard. Some of qmail-inject's
624 command-line and environment options are actually dangerous and can
625 cause broken threads, non-detected duplicate messages and forwarding
626 loops.
627
628 .TP
629 .B \-\-lmtp
630 (Keyword: lmtp)
631 .br
632 Cause delivery via LMTP (Local Mail Transfer Protocol).  A service
633 host and port \fBmust\fP be explicitly specified on each host in the
634 smtphost hunt list (see above) if this option is selected; the default
635 port 25 will (in accordance with RFC 2033) not be accepted.
636 .TP
637 .B \-\-bsmtp <filename>
638 (Keyword: bsmtp)
639 .br
640 Append fetched mail to a BSMTP file.  This simply contains the SMTP
641 commands that would normally be generated by fetchmail when passing
642 mail to an SMTP listener daemon.  An argument of '\-' causes the mail
643 to be written to standard output.  Note that fetchmail's
644 reconstruction of MAIL FROM and RCPT TO lines is not guaranteed
645 correct; the caveats discussed under THE USE AND ABUSE OF MULTIDROP
646 MAILBOXES below apply.
647 .SS Resource Limit Control Options
648 .TP
649 .B \-l <maxbytes> | \-\-limit <maxbytes>
650 (Keyword: limit)
651 .br
652 Takes a maximum octet size argument, where 0 is the
653 default and also the special value designating "no limit".
654 If nonzero, messages larger than this size will not be fetched and will
655 be left on the server (in foreground sessions, the progress messages
656 will note that they are "oversized").  If the fetch protocol permits (in
657 particular, under IMAP or POP3 without the fetchall option) the message
658 will not be marked seen.
659 .sp
660 An explicit \-\-limit of 0 overrides any limits set in your
661 run control file. This option is intended for those needing to
662 strictly control fetch time due to expensive and variable phone rates.
663 .sp
664 Combined with \-\-limitflush, it can be used to delete oversized
665 messages waiting on a server.  In daemon mode, oversize notifications
666 are mailed to the calling user (see the \-\-warnings option). This
667 option does not work with ETRN or ODMR.
668 .TP
669 .B \-w <interval> | \-\-warnings <interval>
670 (Keyword: warnings)
671 .br
672 Takes an interval in seconds.  When you call \fBfetchmail\fP
673 with a 'limit' option in daemon mode, this controls the interval at
674 which warnings about oversized messages are mailed to the calling user
675 (or the user specified by the 'postmaster' option).  One such
676 notification is always mailed at the end of the the first poll that
677 the oversized message is detected.  Thereafter, re-notification is
678 suppressed until after the warning interval elapses (it will take
679 place at the end of the first following poll).
680 .TP
681 .B \-b <count> | \-\-batchlimit <count>
682 (Keyword: batchlimit)
683 .br
684 Specify the maximum number of messages that will be shipped to an SMTP
685 listener before the connection is deliberately torn down and rebuilt
686 (defaults to 0, meaning no limit).  An explicit \-\-batchlimit of 0
687 overrides any limits set in your run control file.  While
688 \fBsendmail\fP(8) normally initiates delivery of a message immediately
689 after receiving the message terminator, some SMTP listeners are not so
690 prompt.  MTAs like \fBsmail\fP(8) may wait till the
691 delivery socket is shut down to deliver.  This may produce annoying
692 delays when \fBfetchmail\fP is processing very large batches.  Setting
693 the batch limit to some nonzero size will prevent these delays.  This
694 option does not work with ETRN or ODMR.
695 .TP
696 .B \-B <number> | \-\-fetchlimit <number>
697 (Keyword: fetchlimit)
698 .br
699 Limit the number of messages accepted from a given server in a single
700 poll.  By default there is no limit. An explicit \-\-fetchlimit of 0
701 overrides any limits set in your run control file.
702 This option does not work with ETRN or ODMR.
703 .TP
704 .B \-\-fetchsizelimit <number>
705 (Keyword: fetchsizelimit)
706 .br
707 Limit the number of sizes of messages accepted from a given server in
708 a single transaction.  This option is useful in reducing the delay in
709 downloading the first mail when there are too many mails in the
710 mailbox.  By default, the limit is 100.  If set to 0, sizes of all
711 messages are downloaded at the start.
712 This option does not work with ETRN or ODMR.  For POP3, the only valid
713 non-zero value is 1.
714 .TP
715 .B \-\-fastuidl <number>
716 (Keyword: fastuidl)
717 .br
718 Do a binary instead of linear search for the first unseen UID. Binary
719 search avoids downloading the UIDs of all mails. This saves time
720 (especially in daemon mode) where downloading the same set of UIDs in
721 each poll is a waste of bandwidth. The number 'n' indicates how rarely
722 a linear search should be done. In daemon mode, linear search is used
723 once followed by binary searches in 'n-1' polls if 'n' is greater than
724 1; binary search is always used if 'n' is 1; linear search is always
725 used if 'n' is 0. In non-daemon mode, binary search is used if 'n' is
726 1; otherwise linear search is used. The default value of 'n' is 4.
727 This option works with POP3 only.
728 .TP
729 .B \-e <count> | \-\-expunge <count>
730 (Keyword: expunge)
731 .br
732 Arrange for deletions to be made final after a given number of
733 messages.  Under POP2 or POP3, fetchmail cannot make deletions final
734 without sending QUIT and ending the session -- with this option on,
735 fetchmail will break a long mail retrieval session into multiple
736 sub-sessions, sending QUIT after each sub-session. This is a good
737 defense against line drops on POP3 servers.  Under IMAP,
738 \fBfetchmail\fP normally issues an EXPUNGE command after each deletion
739 in order to force the deletion to be done immediately.  This is safest
740 when your connection to the server is flaky and expensive, as it avoids
741 resending duplicate mail after a line hit.  However, on large
742 mailboxes the overhead of re-indexing after every message can slam the
743 server pretty hard, so if your connection is reliable it is good to do
744 expunges less frequently.  Also note that some servers enforce a delay
745 of a few seconds after each quit, so fetchmail may not be able to get
746 back in immediately after an expunge -- you may see "lock busy" errors
747 if this happens. If you specify this option to an integer N,
748 it tells \fBfetchmail\fP to only issue expunges on every Nth delete.  An
749 argument of zero suppresses expunges entirely (so no expunges at all
750 will be done until the end of run).  This option does not work with ETRN
751 or ODMR.
752
753 .SS Authentication Options
754 .TP
755 .B \-u <name> | \-\-user <name> | \-\-username <name>
756 (Keyword: user[name])
757 .br
758 Specifies the user identification to be used when logging in to the mailserver.
759 The appropriate user identification is both server and user-dependent.
760 The default is your login name on the client machine that is running
761 \fBfetchmail\fP.
762 See USER AUTHENTICATION below for a complete description.
763 .TP
764 .B \-I <specification> | \-\-interface <specification>
765 (Keyword: interface)
766 .br
767 Require that a specific interface device be up and have a specific local
768 or remote IPv4 (IPv6 is not supported by this option yet) address (or
769 range) before polling.  Frequently \fBfetchmail\fP
770 is used over a transient point-to-point TCP/IP link established directly
771 to a mailserver via SLIP or PPP.  That is a relatively secure channel.
772 But when other TCP/IP routes to the mailserver exist (e.g. when the link
773 is connected to an alternate ISP), your username and password may be
774 vulnerable to snooping (especially when daemon mode automatically polls
775 for mail, shipping a clear password over the net at predictable
776 intervals).  The \-\-interface option may be used to prevent this.  When
777 the specified link is not up or is not connected to a matching IP
778 address, polling will be skipped.  The format is:
779 .sp
780 .nf
781         interface/iii.iii.iii.iii[/mmm.mmm.mmm.mmm]
782 .fi
783 .sp
784 The field before the first slash is the interface name (i.e. sl0, ppp0
785 etc.).  The field before the second slash is the acceptable IP address.
786 The field after the second slash is a mask which specifies a range of
787 IP addresses to accept.  If no mask is present 255.255.255.255 is
788 assumed (i.e. an exact match).  This option is currently only supported
789 under Linux and FreeBSD. Please see the \fBmonitor\fP section for below
790 for FreeBSD specific information.
791 .sp
792 Note that this option may be removed from a future fetchmail version.
793 .TP
794 .B \-M <interface> | \-\-monitor <interface>
795 (Keyword: monitor)
796 .br
797 Daemon mode can cause transient links which are automatically taken down
798 after a period of inactivity (e.g. PPP links) to remain up
799 indefinitely.  This option identifies a system TCP/IP interface to be
800 monitored for activity.  After each poll interval, if the link is up but
801 no other activity has occurred on the link, then the poll will be
802 skipped.  However, when fetchmail is woken up by a signal, the
803 monitor check is skipped and the poll goes through unconditionally.
804 This option is currently only supported under Linux and FreeBSD.
805 For the \fBmonitor\fP and \fBinterface\fP options to work for non root
806 users under FreeBSD, the fetchmail binary must be installed SGID kmem.
807 This would be a security hole, but fetchmail runs with the effective GID
808 set to that of the kmem group \fIonly\fP when interface data is being
809 collected.
810 .sp
811 Note that this option may be removed from a future fetchmail version.
812 .TP
813 .B \-\-auth <type>
814 (Keyword: auth[enticate])
815 .br
816 This option permits you to specify an authentication type (see USER
817 AUTHENTICATION below for details).  The possible values are \fBany\fP,
818 \&\fBpassword\fP, \fBkerberos_v5\fP, \fBkerberos\fP (or, for
819 excruciating exactness, \fBkerberos_v4\fP), \fBgssapi\fP,
820 \fBcram\-md5\fP, \fBotp\fP, \fBntlm\fP, \fBmsn\fP (only for POP3),
821 \fBexternal\fP (only IMAP) and \fBssh\fP.
822 When \fBany\fP (the default) is specified, fetchmail tries
823 first methods that don't require a password (EXTERNAL, GSSAPI, KERBEROS\ IV,
824 KERBEROS\ 5); then it looks for methods that mask your password
825 (CRAM-MD5, X\-OTP - note that NTLM and MSN are not autoprobed for POP3
826 and MSN is only supported for POP3); and only if the server doesn't
827 support any of those will it ship your password en clair.  Other values
828 may be used to force various authentication methods
829 (\fBssh\fP suppresses authentication and is thus useful for IMAP PREAUTH).
830 (\fBexternal\fP suppresses authentication and is thus useful for IMAP EXTERNAL).
831 Any value other than \fBpassword\fP, \fBcram\-md5\fP, \fBntlm\fP,
832 \&\fBmsn\fP or \fBotp\fP suppresses fetchmail's normal inquiry for a
833 password.  Specify \fBssh\fP when you are using an end-to-end secure
834 connection such as an ssh tunnel; specify \fBexternal\fP when you use
835 TLS with client authentication and specify \fBgssapi\fP or
836 \&\fBkerberos_v4\fP if you are using a protocol variant that employs
837 GSSAPI or K4.  Choosing KPOP protocol automatically selects Kerberos
838 authentication.  This option does not work with ETRN.
839 .SS Miscellaneous Options
840 .TP
841 .B \-f <pathname> | \-\-fetchmailrc <pathname>
842 Specify a non-default name for the \fI~/.fetchmailrc\fP
843 run control file.  The pathname argument must be either "-" (a single
844 dash, meaning to read the configuration from standard input) or a
845 filename.  Unless the \-\-version option is also on, a named file
846 argument must have permissions no more open than 0700 (u=rwx,g=,o=) or
847 else be /dev/null.
848 .TP
849 .B \-i <pathname> | \-\-idfile <pathname>
850 (Keyword: idfile)
851 .br
852 Specify an alternate name for the .fetchids file used to save message
853 UIDs. NOTE: since fetchmail 6.3.0, write access to the directory
854 containing the idfile is required, as fetchmail writes a temporary file
855 and renames it into the place of the real idfile only if the temporary
856 file has been written successfully. This avoids the truncation of
857 idfiles when running out of disk space.
858 .TP
859 .B \--pidfile <pathname>
860 (Keyword: pidfile; since fetchmail v6.3.4)
861 .br
862 Override the default location of the PID file. Default: see
863 "ENVIRONMENT" below.
864 .TP
865 .B \-n | \-\-norewrite
866 (Keyword: no rewrite)
867 .br
868 Normally, \fBfetchmail\fP edits RFC-822 address headers (To, From, Cc,
869 Bcc, and Reply\-To) in fetched mail so that any mail IDs local to the
870 server are expanded to full addresses (@ and the mailserver hostname are
871 appended).  This enables replies on the client to get addressed
872 correctly (otherwise your mailer might think they should be addressed to
873 local users on the client machine!).  This option disables the rewrite.
874 (This option is provided to pacify people who are paranoid about having
875 an MTA edit mail headers and want to know they can prevent it, but it is
876 generally not a good idea to actually turn off rewrite.)
877 When using ETRN or ODMR, the rewrite option is ineffective.
878 .TP
879 .B \-E <line> | \-\-envelope <line>
880 (Keyword: envelope; Multidrop only)
881 .br
882 In the configuration file, an enhanced syntax is used:
883 .br
884 \fBenvelope [<count>] <line>\fP
885 .sp
886 This option changes the header \fBfetchmail\fP assumes will carry a copy
887 of the mail's envelope address.  Normally this is 'X\-Envelope\-To'.
888 Other typically found headers to carry envelope information are
889 \&'X\-Original\-To' and 'Delivered\-To'.  Now, since these headers are
890 not standardized, practice varies. See the discussion of multidrop
891 address handling below.  As a special case, 'envelope "Received"'
892 enables parsing of sendmail-style Received lines.  This is the default,
893 but discouraged because it is not fully reliable.
894
895 Note that fetchmail expects the Received-line to be in a specific
896 format: It must contain "by \fIhost\fP for \fIaddress\fP", where
897 \fIhost\fP must match one of the mailserver names that fetchmail
898 recognizes for the account in question.
899 .sp
900 The optional count argument (only available in the configuration file)
901 determines how many header lines of this kind are skipped. A count of 1
902 means: skip the first, take the second. A count of 2 means: skip the
903 first and second, take the third, and so on.
904 .TP
905 .B \-Q <prefix> | \-\-qvirtual <prefix>
906 (Keyword: qvirtual; Multidrop only)
907 .br
908 The string prefix assigned to this option will be removed from the user
909 name found in the header specified with the \fIenvelope\fP option
910 (\fIbefore\fP doing multidrop name mapping or localdomain checking,
911 if either is applicable). This option is useful if you are using
912 \fBfetchmail\fP to collect the mail for an entire domain and your ISP
913 (or your mail redirection provider) is using qmail.
914 One of the basic features of qmail is the \fIDelivered\-To:\fP
915 message header.  Whenever qmail delivers a message to a local mailbox
916 it puts the username and hostname of the envelope recipient on this
917 line.  The major reason for this is to prevent mail loops.  To set up
918 qmail to batch mail for a disconnected site the ISP-mailhost will have
919 normally put that site in its 'Virtualhosts' control file so it will
920 add a prefix to all mail addresses for this site. This results in mail
921 .\" The \&@\& tries to stop HTML converters from making a mailto URL here.
922 sent to 'username\&@\&userhost.userdom.dom.com' having a
923 \fIDelivered\-To:\fR line of the form:
924 .IP
925 Delivered\-To: mbox\-userstr\-username\&@\&userhost.example.com
926 .PP
927 The ISP can make the 'mbox\-userstr\-' prefix anything they choose
928 but a string matching the user host name is likely.
929 By using the option 'envelope Delivered\-To:' you can make fetchmail reliably
930 identify the original envelope recipient, but you have to strip the
931 \&'mbox\-userstr\-' prefix to deliver to the correct user.
932 This is what this option is for.
933 .TP
934 .B \-\-configdump
935 Parse the \fI~/.fetchmailrc\fP file, interpret any command-line options
936 specified, and dump a configuration report to standard output.  The
937 configuration report is a data structure assignment in the language
938 Python.  This option is meant to be used with an interactive
939 \fI~/.fetchmailrc\fP editor like \fBfetchmailconf\fP, written in Python.
940
941 .SS Removed Options
942 .TP
943 .B \-T | \-\-netsec
944 Removed before version 6.3.0, the required underlying inet6_apps library
945 had been discontinued and is no longer available.
946
947 .SH USER AUTHENTICATION AND ENCRYPTION
948 All modes except ETRN require authentication of the client to the server.
949 Normal user authentication in \fBfetchmail\fP is very much like the
950 authentication mechanism of
951 .BR ftp (1).
952 The correct user-id and password depend upon the underlying security
953 system at the mailserver.
954 .PP
955 If the mailserver is a Unix machine on which you have an ordinary user
956 account, your regular login name and password are used with
957 .BR fetchmail .
958 If you use the same login name on both the server and the client machines,
959 you needn't worry about specifying a user-id with the
960 .B \-u
961 option -- the default behavior is to use your login name on the
962 client machine as the user-id on the server machine.  If you use a
963 different login name on the server machine, specify that login name
964 with the
965 .B \-u
966 option.  e.g. if your login name is 'jsmith' on a machine named 'mailgrunt',
967 you would start \fBfetchmail\fP as follows:
968 .IP
969 fetchmail \-u jsmith mailgrunt
970 .PP
971 The default behavior of \fBfetchmail\fP is to prompt you for your
972 mailserver password before the connection is established.  This is the
973 safest way to use \fBfetchmail\fP and ensures that your password will
974 not be compromised.  You may also specify your password in your
975 \fI~/.fetchmailrc\fP file.  This is convenient when using
976 \fBfetchmail\fP in daemon mode or with scripts.
977
978 .SS Using netrc files
979 .PP
980 If you do not specify a password, and \fBfetchmail\fP cannot extract one
981 from your \fI~/.fetchmailrc\fP file, it will look for a \fI~/.netrc\fP
982 file in your home directory before requesting one interactively; if an
983 entry matching the mailserver is found in that file, the password will
984 be used.  Fetchmail first looks for a match on poll name; if it finds none,
985 it checks for a match on via name.  See the
986 .BR ftp (1)
987 man page for details of the syntax of the \fI~/.netrc\fP
988 file.  To show a practical example, a .netrc might look like
989 this:
990 .IP
991 .nf
992 machine hermes.example.org
993 login joe
994 password topsecret
995 .fi
996 .PP
997 You can repeat this block with different user information if you need to
998 provide more than one password.
999 .PP
1000 This feature may allow you to avoid duplicating password
1001 information in more than one file.
1002 .PP
1003 On mailservers that do not provide ordinary user accounts, your user-id and
1004 password are usually assigned by the server administrator when you apply for
1005 a mailbox on the server.  Contact your server administrator if you don't know
1006 the correct user-id and password for your mailbox account.
1007 .SH POP3 VARIANTS
1008 .PP
1009 Early versions of POP3 (RFC1081, RFC1225) supported a crude form of
1010 independent authentication using the \fI.rhosts\fP file on the
1011 mailserver side.  Under this RPOP variant, a fixed per-user ID
1012 equivalent to a password was sent in clear over a link to a reserved
1013 port, with the command RPOP rather than PASS to alert the server that it
1014 should do special checking.  RPOP is supported by \fBfetchmail\fP
1015 (you can specify 'protocol RPOP' to have the program send 'RPOP'
1016 rather than 'PASS') but its use is strongly discouraged, and support
1017 will be removed from a future fetchmail version.  This
1018 facility was vulnerable to spoofing and was withdrawn in RFC1460.
1019 .PP
1020 RFC1460 introduced APOP authentication.  In this variant of POP3,
1021 you register an APOP password on your server host (on some servers, the
1022 program to do this is called \fBpopauth\fP(8)).  You put the same
1023 password in your \fI~/.fetchmailrc\fP file.  Each time \fBfetchmail\fP
1024 logs in, it sends an MD5 hash of your password and the server greeting
1025 time to the server, which can verify it by checking its authorization
1026 database.
1027
1028 \fBNote that APOP is no longer considered resistant against
1029 man-in-the-middle attacks.\fP
1030 .SS RETR or TOP
1031 \fBfetchmail\fP makes some efforts to make the server believe messages
1032 had not been retrieved, by using the TOP command with a large number of
1033 lines when possible.  TOP is a command that retrieves the full header
1034 and a \fBfetchmail\fP-specified amount of body lines. It is optional and
1035 therefore not implemented by all servers, and some are known to
1036 implement it improperly. On many servers however, the RETR command which
1037 retrieves the full message with header and body, sets the "seen" flag
1038 (for instance, in a web interface), whereas the TOP command does not do
1039 that.
1040 .PP
1041 \fBfetchmail\fP will always use the RETR command if "fetchall" is set.
1042 \fBfetchmail\fP will also use the RETR command if "keep" is set and
1043 "uidl" is unset.  Finally, \fBfetchmail\fP will use the RETR command on
1044 Maillennium POP3/PROXY servers (used by Comcast) to avoid a deliberate
1045 TOP misinterpretation in this server that causes message corruption.
1046 .PP
1047 In all other cases, \fBfetchmail\fP will use the TOP command. This
1048 implies that in "keep" setups, "uidl" must be set if "TOP" is desired.
1049 .PP
1050 \fBNote\fP that this description is true for the current version of
1051 fetchmail, but the behavior may change in future versions. In
1052 particular, fetchmail may prefer the RETR command because the TOP
1053 command causes much grief on some servers and is only optional.
1054 .SH ALTERNATE AUTHENTICATION FORMS
1055 .PP
1056 If your \fBfetchmail\fP was built with Kerberos support and you specify
1057 Kerberos authentication (either with \-\-auth or the \fI.fetchmailrc\fP
1058 option \fBauthenticate kerberos_v4\fP) it will try to get a Kerberos
1059 ticket from the mailserver at the start of each query.  Note: if
1060 either the pollname or via name is 'hesiod', fetchmail will try to use
1061 Hesiod to look up the mailserver.
1062 .PP
1063 If you use POP3 or IMAP with GSSAPI authentication, \fBfetchmail\fP will
1064 expect the server to have RFC1731- or RFC1734-conforming GSSAPI
1065 capability, and will use it.  Currently this has only been tested over
1066 Kerberos V, so you're expected to already have a ticket-granting
1067 ticket. You may pass a username different from your principal name
1068 using the standard \fB\-\-user\fP command or by the \fI.fetchmailrc\fP
1069 option \fBuser\fP.
1070 .PP
1071 If your IMAP daemon returns the PREAUTH response in its greeting line,
1072 fetchmail will notice this and skip the normal authentication step.
1073 This can be useful, e.g. if you start imapd explicitly using ssh.
1074 In this case you can declare the authentication value 'ssh' on that
1075 site entry to stop \fI.fetchmail\fP from asking you for a password
1076 when it starts up.
1077 .PP
1078 If you use client authentication with \fITLS1\fP and your IMAP daemon
1079 returns the \fIAUTH=EXTERNAL\fP response, fetchmail will notice this
1080 and will use the authentication shortcut and will not send the
1081 passphrase. In this case you can declare the authentication value 'external'
1082  on that site to stop \fBfetchmail\fP from asking you for a password
1083 when it starts up.
1084 .PP
1085 If you are using POP3, and the server issues a one-time-password
1086 challenge conforming to RFC1938, \fBfetchmail\fP will use your
1087 password as a pass phrase to generate the required response. This
1088 avoids sending secrets over the net unencrypted.
1089 .PP
1090 Compuserve's RPA authentication is supported. If you
1091 compile in the support, \fBfetchmail\fP will try to perform an RPA pass-phrase
1092 authentication instead of sending over the password en clair if it
1093 detects "@compuserve.com" in the hostname.
1094 .PP
1095 If you are using IMAP, Microsoft's NTLM authentication (used by Microsoft
1096 Exchange) is supported. If you compile in the support, \fBfetchmail\fP
1097 will try to perform an NTLM authentication (instead of sending over the
1098 password en clair) whenever the server returns AUTH=NTLM in its
1099 capability response. Specify a user option value that looks like
1100 \&'user@domain': the part to the left of the @ will be passed as the
1101 username and the part to the right as the NTLM domain.
1102
1103 .SS Secure Socket Layers (SSL) and Transport Layer Security (TLS)
1104 .PP
1105 You can access SSL encrypted services by specifying the \-\-ssl option.
1106 You can also do this using the "ssl" user option in the .fetchmailrc
1107 file. With SSL encryption enabled, queries are initiated over a
1108 connection after negotiating an SSL session, and the connection fails if
1109 SSL cannot be negotiated.  Some services, such as POP3 and IMAP, have
1110 different well known ports defined for the SSL encrypted services.  The
1111 encrypted ports will be selected automatically when SSL is enabled and
1112 no explicit port is specified. The \-\-sslproto 'SSL3' option should be
1113 used to select the SSLv3 protocol (default if unset: v2 or v3).  Also,
1114 the \-\-sslcertck command line or sslcertck run control file option
1115 should be used to force strict certificate checking - see below.
1116 .PP
1117 If SSL is not configured, fetchmail will usually opportunistically try to use
1118 STARTTLS. STARTTLS can be enforced by using \-\-sslproto "TLS1". TLS
1119 connections use the same port as the unencrypted version of the
1120 protocol and negotiate TLS via special command. The \-\-sslcertck
1121 command line or sslcertck run control file option should be used to
1122 force strict certificate checking - see below.
1123 .PP
1124 .B \-\-sslcertck is recommended: When connecting to an SSL or TLS encrypted server, the 
1125 server presents a certificate to the client for validation.  The
1126 certificate is checked to verify that the common name in the certificate
1127 matches the name of the server being contacted and that the effective
1128 and expiration dates in the certificate indicate that it is currently
1129 valid.  If any of these checks fail, a warning message is printed, but
1130 the connection continues.  The server certificate does not need to be
1131 signed by any specific Certifying Authority and may be a "self-signed"
1132 certificate. If the \-\-sslcertck command line option or sslcertck run
1133 control file option is used, fetchmail will instead abort if any of
1134 these checks fail, because it must assume that there is a
1135 man-in-the-middle attack in this scenario, hence fetchmail must not
1136 expose cleartest passwords. Use of the sslcertck or \-\-sslcertck option
1137 is therefore advised.
1138 .PP
1139 Some SSL encrypted servers may request a client side certificate.  A client
1140 side public SSL certificate and private SSL key may be specified.  If
1141 requested by the server, the client certificate is sent to the server for
1142 validation.  Some servers may require a valid client certificate and may
1143 refuse connections if a certificate is not provided or if the certificate
1144 is not valid.  Some servers may require client side certificates be signed
1145 by a recognized Certifying Authority.  The format for the key files and
1146 the certificate files is that required by the underlying SSL libraries
1147 (OpenSSL in the general case).
1148 .PP
1149 A word of care about the use of SSL: While above mentioned
1150 setup with self-signed server certificates retrieved over the wires
1151 can protect you from a passive eavesdropper, it doesn't help against an
1152 active attacker. It's clearly an improvement over sending the
1153 passwords in clear, but you should be aware that a man-in-the-middle
1154 attack is trivially possible (in particular with tools such as
1155 .URL "http://monkey.org/~dugsong/dsniff/" "dsniff" ,
1156 ).  Use of strict certificate checking with a certification authority
1157 recognized by server and client, or perhaps of an SSH tunnel (see below
1158 for some examples) is preferable if you care seriously about the
1159 security of your mailbox and passwords.
1160
1161 .SS ESMTP AUTH
1162 .PP
1163 \fBfetchmail\fP also supports authentication to the ESMTP server on the
1164 client side according to RFC 2554.  You can specify a name/password pair
1165 to be used with the keywords 'esmtpname' and 'esmtppassword'; the former
1166 defaults to the username of the calling user.
1167
1168 .SH DAEMON MODE
1169 .SS Introducing the daemon mode
1170 In daemon mode, \fBfetchmail\fP puts itself into the background and runs
1171 forever, querying each specified host and then sleeping for a given
1172 polling interval.
1173 .SS Starting the daemon mode
1174 There are several ways to make fetchmail work in daemon mode. On the
1175 command line, \fB\-\-daemon\ <interval>\fP or \fB\-d\ <interval>\fP
1176 option runs \fBfetchmail\fP in daemon mode.  You must specify a numeric
1177 argument which is a polling interval (time to wait after completing a 
1178 whole poll cycle with the last server and before starting the next poll 
1179 cycle with the first server) in seconds.
1180 .PP
1181 Example: simply invoking
1182 .IP
1183 fetchmail \-d 900
1184 .PP
1185 will, therefore, poll all the hosts described in your \fI~/.fetchmailrc\fP
1186 file (except those explicitly excluded with the 'skip' verb) a bit less 
1187 often than once every 15 minutes (exactly: 15 minutes + time that the 
1188 poll takes).
1189 .PP
1190 It is also possible to set a polling interval
1191 in your \fI~/.fetchmailrc\fP file by saying 'set\ daemon\ <interval>',
1192 where <interval> is an integer number of seconds.  If you do this,
1193 fetchmail will always start in daemon mode unless you override it with
1194 the command-line option \-\-daemon 0 or \-d0.
1195 .PP
1196 Only one daemon process is permitted per user; in daemon mode,
1197 \fBfetchmail\fP sets up a per-user lockfile to guarantee this.
1198 (You can however cheat and set the FETCHMAILHOME environment variable to
1199 overcome this setting, but in that case, it is your responsibility to
1200 make sure you aren't polling the same server with two processes at the
1201 same time.)
1202 .SS Awakening the background daemon
1203 .PP
1204 Normally, calling fetchmail with a daemon in the background sends a
1205 wake-up signal to the daemon and quits without output. The background
1206 daemon then starts its next poll cycle immediately.  The wake-up signal,
1207 SIGUSR1, can also be sent manually. The wake-up action also clears any
1208 \&'wedged' flags indicating that connections have wedged due to failed
1209 authentication or multiple timeouts.
1210 .SS Terminating the background daemon
1211 .PP
1212 The option
1213 .B \-\-quit
1214 will kill a running daemon process instead of waking it up (if there
1215 is no such process, \fBfetchmail\fP will notify you).
1216 If the \-\-quit option appears last on the command line, \fBfetchmail\fP
1217 will kill the running daemon process and then quit. Otherwise,
1218 \fBfetchmail\fP will first kill a running daemon process and then
1219 continue running with the other options.
1220 .SS Useful options for daemon mode
1221 .PP
1222 The
1223 .B \-L <filename>
1224 or
1225 .B \-\-logfile <filename>
1226 option (keyword: set logfile) is only effective when fetchmail is
1227 detached and in daemon mode. Note that \fBthe logfile must exist
1228 before\fP fetchmail is run, you can use the
1229 .BR touch (1)
1230 command with the filename as its sole argument to create it.
1231 .br
1232 This option allows you to redirect status messages
1233 into a specified logfile (follow the option with the logfile name).  The
1234 logfile is opened for append, so previous messages aren't deleted.  This
1235 is primarily useful for debugging configurations. Note that fetchmail
1236 does not detect if the logfile is rotated, the logfile is only opened
1237 once when fetchmail starts. You need to restart fetchmail after rotating
1238 the logfile and before compressing it (if applicable).
1239 .PP
1240 The
1241 .B \-\-syslog
1242 option (keyword: set syslog) allows you to redirect status and error
1243 messages emitted to the
1244 .BR syslog (3)
1245 system daemon if available.
1246 Messages are logged with an id of \fBfetchmail\fP, the facility \fBLOG_MAIL\fP,
1247 and priorities \fBLOG_ERR\fP, \fBLOG_ALERT\fP or \fBLOG_INFO\fP.
1248 This option is intended for logging status and error messages which
1249 indicate the status of the daemon and the results while fetching mail
1250 from the server(s).
1251 Error messages for command line options and parsing the \fI.fetchmailrc\fP
1252 file are still written to stderr, or to the specified log file.
1253 The
1254 .B \-\-nosyslog
1255 option turns off use of
1256 .BR syslog (3),
1257 assuming it's turned on in the \fI~/.fetchmailrc\fP file.
1258 .PP
1259 The
1260 .B \-N
1261 or
1262 .B \-\-nodetach
1263 option suppresses backgrounding and detachment of the daemon process
1264 from its control terminal.  This is useful for debugging or when
1265 fetchmail runs as the child of a supervisor process such as
1266 .BR init (8)
1267 or Gerrit Pape's
1268 .BR runit (8).
1269 Note that this also causes the logfile option to be ignored (though
1270 perhaps it shouldn't).
1271 .PP
1272 Note that while running in daemon mode polling a POP2 or IMAP2bis server,
1273 transient errors (such as DNS failures or sendmail delivery refusals)
1274 may force the fetchall option on for the duration of the next polling
1275 cycle.  This is a robustness feature.  It means that if a message is
1276 fetched (and thus marked seen by the mailserver) but not delivered
1277 locally due to some transient error, it will be re-fetched during the
1278 next poll cycle.  (The IMAP logic doesn't delete messages until
1279 they're delivered, so this problem does not arise.)
1280 .PP
1281 If you touch or change the \fI~/.fetchmailrc\fP file while fetchmail is
1282 running in daemon mode, this will be detected at the beginning of the
1283 next poll cycle.  When a changed \fI~/.fetchmailrc\fP is detected,
1284 fetchmail rereads it and restarts from scratch (using exec(2); no state
1285 information is retained in the new instance).  Note that if fetchmail
1286 needs to query for passwords, of that if you break the
1287 \fI~/.fetchmailrc\fP file's syntax, the new instance will softly and
1288 silently vanish away on startup.
1289
1290 .SH ADMINISTRATIVE OPTIONS
1291 .PP
1292 The
1293 .B \-\-postmaster <name>
1294 option (keyword: set postmaster) specifies the last-resort username to
1295 which multidrop mail is to be forwarded if no matching local recipient
1296 can be found. It is also used as destination of undeliverable mail if
1297 the 'bouncemail' global option is off and additionally for spam-blocked
1298 mail if the 'bouncemail' global option is off and the 'spambounce'
1299 global option is on. This option defaults to the user who invoked
1300 \fBfetchmail\fP.
1301 If the invoking user is root, then the default of this option is
1302 the user 'postmaster'.  Setting postmaster to the empty string causes
1303 such mail as described above to be discarded - this however is usually a
1304 bad idea.
1305 See also the description of the 'FETCHMAILUSER' environment variable in
1306 the ENVIRONMENT section below.
1307 .PP
1308 The
1309 .B \-\-nobounce
1310 behaves like the "set no bouncemail" global option, which see.
1311 .PP
1312 The
1313 .B \-\-invisible
1314 option (keyword: set invisible) tries to make fetchmail invisible.
1315 Normally, fetchmail behaves like any other MTA would -- it generates a
1316 Received header into each message describing its place in the chain of
1317 transmission, and tells the MTA it forwards to that the mail came from
1318 the machine fetchmail itself is running on.  If the invisible option
1319 is on, the Received header is suppressed and fetchmail tries to spoof
1320 the MTA it forwards to into thinking it came directly from the
1321 mailserver host.
1322 .PP
1323 The
1324 .B \-\-showdots
1325 option (keyword: set showdots) forces fetchmail to show progress dots
1326 even if the output goes to a file or fetchmail is not in verbose mode.
1327 Fetchmail shows the dots by default when run in \-\-verbose mode 
1328 \fIand\fP output goes to console. This option is ignored in \-\-silent mode.
1329 .PP
1330 By specifying the
1331 .B \-\-tracepolls
1332 option, you can ask fetchmail to add information to the Received
1333 header on the form "polling {label} account {user}", where {label} is
1334 the account label (from the specified rcfile, normally ~/.fetchmailrc)
1335 and {user} is the username which is used to log on to the mail
1336 server. This header can be used to make filtering email where no
1337 useful header information is available and you want mail from
1338 different accounts sorted into different mailboxes (this could, for
1339 example, occur if you have an account on the same server running a
1340 mailing list, and are subscribed to the list using that account). The
1341 default is not adding any such header.  In
1342 .IR .fetchmailrc ,
1343 this is called 'tracepolls'.
1344
1345 .SH RETRIEVAL FAILURE MODES
1346 The protocols \fBfetchmail\fP uses to talk to mailservers are next to
1347 bulletproof.  In normal operation forwarding to port 25, no message is
1348 ever deleted (or even marked for deletion) on the host until the SMTP
1349 listener on the client side has acknowledged to \fBfetchmail\fP that
1350 the message has been either accepted for delivery or rejected due to a
1351 spam block.
1352 .PP
1353 When forwarding to an MDA, however, there is more possibility
1354 of error.  Some MDAs are 'safe' and reliably return a nonzero status
1355 on any delivery error, even one due to temporary resource limits.
1356 The
1357 .BR maildrop (1)
1358 program is like this; so are most programs designed as mail transport
1359 agents, such as
1360 .BR sendmail (1),
1361 including the sendmail wrapper of Postfix and
1362 .BR exim (1).
1363 These programs give back a reliable positive acknowledgement and
1364 can be used with the mda option with no risk of mail loss.  Unsafe
1365 MDAs, though, may return 0 even on delivery failure.  If this
1366 happens, you will lose mail.
1367 .PP
1368 The normal mode of \fBfetchmail\fP is to try to download only 'new'
1369 messages, leaving untouched (and undeleted) messages you have already
1370 read directly on the server (or fetched with a previous \fIfetchmail
1371 \-\-keep\fP).  But you may find that messages you've already read on the
1372 server are being fetched (and deleted) even when you don't specify
1373 \-\-all.  There are several reasons this can happen.
1374 .PP
1375 One could be that you're using POP2.  The POP2 protocol includes no
1376 representation of 'new' or 'old' state in messages, so \fBfetchmail\fP
1377 must treat all messages as new all the time.  But POP2 is obsolete, so
1378 this is unlikely.
1379 .PP
1380 A potential POP3 problem might be servers that insert messages
1381 in the middle of mailboxes (some VMS implementations of mail are
1382 rumored to do this).  The \fBfetchmail\fP code assumes that new
1383 messages are appended to the end of the mailbox; when this is not true
1384 it may treat some old messages as new and vice versa.  Using UIDL whilst
1385 setting fastuidl 0 might fix this, otherwise, consider switching to IMAP.
1386 .PP
1387 Yet another POP3 problem is that if they can't make tempfiles in the
1388 user's home directory, some POP3 servers will hand back an
1389 undocumented response that causes fetchmail to spuriously report "No
1390 mail".
1391 .PP
1392 The IMAP code uses the presence or absence of the server flag \eSeen
1393 to decide whether or not a message is new.  This isn't the right thing
1394 to do, fetchmail should check the UIDVALIDITY and use UID, but it
1395 doesn't do that yet. Under Unix, it counts on your IMAP server to notice
1396 the BSD-style Status flags set by mail user agents and set the \eSeen
1397 flag from them when appropriate.  All Unix IMAP servers we know of do
1398 this, though it's not specified by the IMAP RFCs.  If you ever trip over
1399 a server that doesn't, the symptom will be that messages you have
1400 already read on your host will look new to the server.  In this
1401 (unlikely) case, only messages you fetched with \fIfetchmail \-\-keep\fP
1402 will be both undeleted and marked old.
1403 .PP
1404 In ETRN and ODMR modes, \fBfetchmail\fP does not actually retrieve messages;
1405 instead, it asks the server's SMTP listener to start a queue flush
1406 to the client via SMTP.  Therefore it sends only undelivered messages.
1407
1408 .SH SPAM FILTERING
1409 Many SMTP listeners allow administrators to set up 'spam filters' that
1410 block unsolicited email from specified domains.  A MAIL FROM or DATA line that
1411 triggers this feature will elicit an SMTP response which
1412 (unfortunately) varies according to the listener.
1413 .PP
1414 Newer versions of
1415 \fBsendmail\fP
1416 return an error code of 571.
1417 .PP
1418 According to RFC2821, the correct thing to return in this situation is
1419 550 "Requested action not taken: mailbox unavailable" (the draft adds
1420 "[E.g., mailbox not found, no access, or command rejected for policy
1421 reasons].").
1422 .PP
1423 Older versions of the
1424 \fBexim\fP
1425 MTA return 501 "Syntax error in parameters or arguments".
1426 .PP
1427 The
1428 \fBpostfix\fP
1429 MTA runs 554 as an antispam response.
1430 .PP
1431 \fBZmailer\fP
1432 may reject code with a 500 response (followed by an enhanced status
1433 code that contains more information).
1434 .PP
1435 Return codes which
1436 \fBfetchmail\fP
1437 treats as antispam responses and discards
1438 the message can be set with the 'antispam' option.  This is one of the
1439 \fIonly\fP
1440 three circumstance under which fetchmail ever discards mail (the others
1441 are the 552 and 553 errors described below, and the suppression of
1442 multidropped messages with a message-ID already seen).
1443 .PP
1444 If
1445 \fBfetchmail\fP
1446 is fetching from an IMAP server, the antispam response will be detected and
1447 the message rejected immediately after the headers have been fetched,
1448 without reading the message body.  Thus, you won't pay for downloading
1449 spam message bodies.
1450 .PP
1451 By default, the list of antispam responses is empty.
1452 .PP
1453 If the \fIspambounce\fP global option is on, mail that is spam-blocked
1454 triggers an RFC1892/RFC1894 bounce message informing the originator that
1455 we do not accept mail from it. See also BUGS.
1456
1457 .SH SMTP/ESMTP ERROR HANDLING
1458 Besides the spam-blocking described above, fetchmail takes special
1459 actions on the following SMTP/ESMTP error responses
1460 .TP 5
1461 452 (insufficient system storage)
1462 Leave the message in the server mailbox for later retrieval.
1463 .TP 5
1464 552 (message exceeds fixed maximum message size)
1465 Delete the message from the server.  Send bounce-mail to the
1466 originator.
1467 .TP 5
1468 553 (invalid sending domain)
1469 Delete the message from the server.  Don't even try to send
1470 bounce-mail to the originator.
1471 .PP
1472 Other errors trigger bounce mail back to the originator. See also BUGS.
1473
1474 .SH THE RUN CONTROL FILE
1475 The preferred way to set up fetchmail is to write a
1476 \&\fI.fetchmailrc\fP file in your home directory (you may do this
1477 directly, with a text editor, or indirectly via \fBfetchmailconf\fP).
1478 When there is a conflict between the command-line arguments and the
1479 arguments in this file, the command-line arguments take precedence.
1480 .PP
1481 To protect the security of your passwords,
1482 your \fI~/.fetchmailrc\fP may not normally have more than 0700 (u=rwx,g=,o=) permissions;
1483 \fBfetchmail\fP
1484 will complain and exit otherwise (this check is suppressed when
1485 \-\-version is on).
1486 .PP
1487 You may read the \fI.fetchmailrc\fP file as a list of commands to
1488 be executed when
1489 \fBfetchmail\fP
1490 is called with no arguments.
1491 .SS Run Control Syntax
1492 .PP
1493 Comments begin with a '#' and extend through the end of the line.
1494 Otherwise the file consists of a series of server entries or global
1495 option statements in a free-format, token-oriented syntax.
1496 .PP
1497 There are four kinds of tokens: grammar keywords, numbers
1498 (i.e. decimal digit sequences), unquoted strings, and quoted strings.
1499 A quoted string is bounded by double quotes and may contain
1500 whitespace (and quoted digits are treated as a string).  Note that
1501 quoted strings will also contain line feed characters if they run across
1502 two or more lines, unless you use a backslash to join lines (see below).
1503 An unquoted string is any whitespace-delimited token that is neither
1504 numeric, string quoted nor contains the special characters ',', ';',
1505 \&':', or '='.
1506 .PP
1507 Any amount of whitespace separates tokens in server entries, but is
1508 otherwise ignored. You may use backslash escape sequences (\en for LF,
1509 \&\et for HT, \eb for BS, \er for CR, \e\fInnn\fP for decimal (where
1510 nnn cannot start with a 0), \e0\fIooo\fP for octal, and \ex\fIhh\fP for
1511 hex) to embed non-printable characters or string delimiters in strings.
1512 In quoted strings, a backslash at the very end of a line will cause the
1513 backslash itself and the line feed (LF or NL, new line) character to be
1514 ignored, so that you can wrap long strings. Without the backslash at the
1515 line end, the line feed character would become part of the string.
1516 .PP
1517 \fBWarning:\fP
1518 while these resemble C-style escape sequences, they are not the same.
1519 fetchmail only supports these eight styles. C supports more escape
1520 sequences that consist of backslash (\e) and a single character, but
1521 does not support decimal codes and does not require the leading 0 in
1522 octal notation.  Example: fetchmail interprets \e233 the same as \exE9
1523 (Latin small letter e with acute), where C would interpret \e233 as
1524 octal 0233 = \ex9B (CSI, control sequence introducer).
1525 .PP
1526 Each server entry consists of one of the keywords 'poll' or 'skip',
1527 followed by a server name, followed by server options, followed by any
1528 number of user (or username) descriptions, followed by user options.
1529 Note: the most common cause of syntax errors is mixing up user and
1530 server options or putting user options before the user descriptions.
1531 .PP
1532 For backward compatibility, the word 'server' is a synonym for 'poll'.
1533 .PP
1534 You can use the noise keywords 'and', 'with',
1535 \&'has', 'wants', and 'options' anywhere in an entry to make
1536 it resemble English.  They're ignored, but but can make entries much
1537 easier to read at a glance.  The punctuation characters ':', ';' and
1538 \&',' are also ignored.
1539 .PP
1540 .SS Poll vs. Skip
1541 The 'poll' verb tells fetchmail to query this host when it is run with
1542 no arguments.  The 'skip' verb tells
1543 \fBfetchmail\fP
1544 not to poll this host unless it is explicitly named on the command
1545 line.  (The 'skip' verb allows you to experiment with test entries
1546 safely, or easily disable entries for hosts that are temporarily down.)
1547 .PP
1548 .SS Keyword/Option Summary
1549 Here are the legal options.  Keyword suffixes enclosed in
1550 square brackets are optional.  Those corresponding to short command-line
1551 options are followed by '\-' and the appropriate option letter.  If
1552 option is only relevant to a single mode of operation, it is noted as
1553 \&'s' or 'm' for singledrop- or multidrop-mode, respectively.
1554
1555 Here are the legal global options:
1556
1557 .TS
1558 l l l lw34.
1559 Keyword         Opt     Mode    Function
1560 _
1561 set daemon      \-d     \&      T{
1562 Set a background poll interval in seconds.
1563 T}
1564 set postmaster          \&      \&      T{
1565 Give the name of the last-resort mail recipient (default: user running
1566 fetchmail, "postmaster" if run by the root user)
1567 T}
1568 set    bouncemail       \&      \&      T{
1569 Direct error mail to the sender (default)
1570 T}
1571 set no bouncemail       \&      \&      T{
1572 Direct error mail to the local postmaster (as per the 'postmaster'
1573 global option above).
1574 T}
1575 set no spambounce       \&      \&      T{
1576 Do not bounce spam-blocked mail (default).
1577 T}
1578 set    spambounce       \&      \&      T{
1579 Bounce blocked spam-blocked mail (as per the 'antispam' user option)
1580 back to the destination as indicated by the 'bouncemail' global option.
1581 Warning: Do not use this to bounce spam back to the sender - most spam
1582 is sent with false sender address and thus this option hurts innocent
1583 bystanders.
1584 T}
1585 set no softbounce       \&      \&      T{
1586 Delete permanently undeliverable mail. It is recommended to use this
1587 option if the configuration has been thoroughly tested.
1588 T}
1589 set    spambounce       \&      \&      T{
1590 Keep permanently undeliverable mail as though a temporary error had
1591 occurred (default).
1592 T}
1593 set logfile     \-L     \&      T{
1594 Name of a file to append error and status messages to.
1595 T}
1596 set idfile      \-i     \&      T{
1597 Name of the file to store UID lists in.
1598 T}
1599 set    syslog   \&      \&      T{
1600 Do error logging through syslog(3).
1601 T}
1602 set no syslog   \&      \&      T{
1603 Turn off error logging through syslog(3). (default)
1604 T}
1605 set properties  \&      \&      T{
1606 String value that is ignored by fetchmail (may be used by extension
1607 scripts).
1608 T}
1609 .TE
1610
1611 Here are the legal server options:
1612
1613 .TS
1614 l l l lw34.
1615 Keyword         Opt     Mode    Function
1616 _
1617 via             \&      \&      T{
1618 Specify DNS name of mailserver, overriding poll name
1619 T}
1620 proto[col]      \-p     \&      T{
1621 Specify protocol (case insensitive):
1622 POP2, POP3, IMAP, APOP, KPOP
1623 T}
1624 local[domains]  \&      m       T{
1625 Specify domain(s) to be regarded as local
1626 T}
1627 port            \&      \&      T{
1628 Specify TCP/IP service port (obsolete, use 'service' instead).
1629 T}
1630 service         \-P     \&      T{
1631 Specify service name (a numeric value is also allowed and
1632 considered a TCP/IP port number).
1633 T}
1634 auth[enticate]  \&      \&      T{
1635 Set authentication type (default 'any')
1636 T}
1637 timeout         \-t     \&      T{
1638 Server inactivity timeout in seconds (default 300)
1639 T}
1640 envelope        \-E     m       T{
1641 Specify envelope-address header name
1642 T}
1643 no envelope     \&      m       T{
1644 Disable looking for envelope address
1645 T}
1646 qvirtual        \-Q     m       T{
1647 Qmail virtual domain prefix to remove from user name
1648 T}
1649 aka             \&      m       T{
1650 Specify alternate DNS names of mailserver
1651 T}
1652 interface       \-I     \&      T{
1653 specify IP interface(s) that must be up for server poll to take place
1654 T}
1655 monitor         \-M     \&      T{
1656 Specify IP address to monitor for activity
1657 T}
1658 plugin          \&      \&      T{
1659 Specify command through which to make server connections.
1660 T}
1661 plugout         \&      \&      T{
1662 Specify command through which to make listener connections.
1663 T}
1664 dns             \&      m       T{
1665 Enable DNS lookup for multidrop (default)
1666 T}
1667 no dns          \&      m       T{
1668 Disable DNS lookup for multidrop
1669 T}
1670 checkalias      \&      m       T{
1671 Do comparison by IP address for multidrop
1672 T}
1673 no checkalias   \&      m       T{
1674 Do comparison by name for multidrop (default)
1675 T}
1676 uidl            \-U     \&      T{
1677 Force POP3 to use client-side UIDLs (recommended)
1678 T}
1679 no uidl         \&      \&      T{
1680 Turn off POP3 use of client-side UIDLs (default)
1681 T}
1682 interval        \&      \&      T{
1683 Only check this site every N poll cycles; N is a numeric argument.
1684 T}
1685 tracepolls      \&      \&      T{
1686 Add poll tracing information to the Received header
1687 T}
1688 principal       \&      \&      T{
1689 Set Kerberos principal (only useful with IMAP and kerberos)
1690 T}
1691 esmtpname       \&      \&      T{
1692 Set name for RFC2554 authentication to the ESMTP server.
1693 T}
1694 esmtppassword   \&      \&      T{
1695 Set password for RFC2554 authentication to the ESMTP server.
1696 T}
1697 .TE
1698
1699 Here are the legal user descriptions and options:
1700
1701 .TS
1702 l l l lw34.
1703 Keyword         Opt     Mode    Function
1704 _
1705 user[name]      \-u     \&      T{
1706 This is the user description and must come first after server
1707 description and after possible server options, and before user options.
1708 .br
1709 It sets the remote user name if by itself or followed by 'there', or the
1710 local user name if followed by 'here'.
1711 T}
1712 is              \&      \&      T{
1713 Connect local and remote user names
1714 T}
1715 to              \&      \&      T{
1716 Connect local and remote user names
1717 T}
1718 pass[word]      \&      \&      T{
1719 Specify remote account password
1720 T}
1721 ssl             \&      \&      T{
1722 Connect to server over the specified base protocol using SSL encryption
1723 T}
1724 sslcert         \&      \&      T{
1725 Specify file for client side public SSL certificate
1726 T}
1727 sslkey          \&      \&      T{
1728 Specify file for client side private SSL key
1729 T}
1730 sslproto        \&      \&      T{
1731 Force ssl protocol for connection
1732 T}
1733 folder          \-r     \&      T{
1734 Specify remote folder to query
1735 T}
1736 smtphost        \-S     \&      T{
1737 Specify smtp host(s) to forward to
1738 T}
1739 fetchdomains    \&      m       T{
1740 Specify domains for which mail should be fetched
1741 T}
1742 smtpaddress     \-D     \&      T{
1743 Specify the domain to be put in RCPT TO lines
1744 T}
1745 smtpname        \&      \&      T{
1746 Specify the user and domain to be put in RCPT TO lines
1747 T}
1748 antispam        \-Z     \&      T{
1749 Specify what SMTP returns are interpreted as spam-policy blocks
1750 T}
1751 mda             \-m     \&      T{
1752 Specify MDA for local delivery
1753 T}
1754 bsmtp           \-o     \&      T{
1755 Specify BSMTP batch file to append to
1756 T}
1757 preconnect      \&      \&      T{
1758 Command to be executed before each connection
1759 T}
1760 postconnect     \&      \&      T{
1761 Command to be executed after each connection
1762 T}
1763 keep            \-k     \&      T{
1764 Don't delete seen messages from server (for POP3, uidl is recommended)
1765 T}
1766 flush           \-F     \&      T{
1767 Flush all seen messages before querying (DANGEROUS)
1768 T}
1769 limitflush      \&      \&      T{
1770 Flush all oversized messages before querying
1771 T}
1772 fetchall        \-a     \&      T{
1773 Fetch all messages whether seen or not
1774 T}
1775 rewrite         \&      \&      T{
1776 Rewrite destination addresses for reply (default)
1777 T}
1778 stripcr         \&      \&      T{
1779 Strip carriage returns from ends of lines
1780 T}
1781 forcecr         \&      \&      T{
1782 Force carriage returns at ends of lines
1783 T}
1784 pass8bits       \&      \&      T{
1785 Force BODY=8BITMIME to ESMTP listener
1786 T}
1787 dropstatus      \&      \&      T{
1788 Strip Status and X-Mozilla-Status lines out of incoming mail
1789 T}
1790 dropdelivered   \&      \&      T{
1791 Strip Delivered-To lines out of incoming mail
1792 T}
1793 mimedecode      \&      \&      T{
1794 Convert quoted-printable to 8-bit in MIME messages
1795 T}
1796 idle            \&      \&      T{
1797 Idle waiting for new messages after each poll (IMAP only)
1798 T}
1799 no keep         \-K     \&      T{
1800 Delete seen messages from server (default)
1801 T}
1802 no flush        \&      \&      T{
1803 Don't flush all seen messages before querying (default)
1804 T}
1805 no fetchall     \&      \&      T{
1806 Retrieve only new messages (default)
1807 T}
1808 no rewrite      \&      \&      T{
1809 Don't rewrite headers
1810 T}
1811 no stripcr      \&      \&      T{
1812 Don't strip carriage returns (default)
1813 T}
1814 no forcecr      \&      \&      T{
1815 Don't force carriage returns at EOL (default)
1816 T}
1817 no pass8bits    \&      \&      T{
1818 Don't force BODY=8BITMIME to ESMTP listener (default)
1819 T}
1820 no dropstatus   \&      \&      T{
1821 Don't drop Status headers (default)
1822 T}
1823 no dropdelivered        \&      \&      T{
1824 Don't drop Delivered\-To headers (default)
1825 T}
1826 no mimedecode   \&      \&      T{
1827 Don't convert quoted-printable to 8-bit in MIME messages (default)
1828 T}
1829 no idle         \&      \&      T{
1830 Don't idle waiting for new messages after each poll (IMAP only)
1831 T}
1832 limit           \-l     \&      T{
1833 Set message size limit
1834 T}
1835 warnings        \-w     \&      T{
1836 Set message size warning interval
1837 T}
1838 batchlimit      \-b     \&      T{
1839 Max # messages to forward in single connect
1840 T}
1841 fetchlimit      \-B     \&      T{
1842 Max # messages to fetch in single connect
1843 T}
1844 fetchsizelimit  \&      \&      T{
1845 Max # message sizes to fetch in single transaction
1846 T}
1847 fastuidl        \&      \&      T{
1848 Use binary search for first unseen message (POP3 only)
1849 T}
1850 expunge         \-e     \&      T{
1851 Perform an expunge on every #th message (IMAP and POP3 only)
1852 T}
1853 properties      \&      \&      T{
1854 String value is ignored by fetchmail (may be used by extension scripts)
1855 T}
1856 .TE
1857 .PP
1858 All user options must begin with a user description (user or username
1859 option) and \fIfollow\fP all server descriptions and options.
1860 .PP
1861 In the .fetchmailrc file, the 'envelope' string argument may be
1862 preceded by a whitespace-separated number.  This number, if specified,
1863 is the number of such headers to skip over (that is, an argument of 1
1864 selects the second header of the given type).  This is sometime useful
1865 for ignoring bogus envelope headers created by an ISP's local delivery
1866 agent or internal forwards (through mail inspection systems, for
1867 instance).
1868 .SS Keywords Not Corresponding To Option Switches
1869 .PP
1870 The 'folder' and 'smtphost' options (unlike their command-line
1871 equivalents) can take a space- or comma-separated list of names
1872 following them.
1873 .PP
1874 All options correspond to the obvious command-line arguments, except
1875 the following: 'via', 'interval', 'aka', 'is', 'to', 'dns'/'no dns',
1876 \&'checkalias'/'no checkalias', 'password', 'preconnect', 'postconnect',
1877 \&'localdomains', 'stripcr'/'no stripcr', 'forcecr'/'no forcecr',
1878 \&'pass8bits'/'no pass8bits' 'dropstatus/no dropstatus',
1879 \&'dropdelivered/no dropdelivered', 'mimedecode/no mimedecode', 'no idle',
1880 and 'no envelope'.
1881 .PP
1882 The 'via' option is for if you want to have more
1883 than one configuration pointing at the same site.  If it is present,
1884 the string argument will be taken as the actual DNS name of the
1885 mailserver host to query.
1886 This will override the argument of poll, which can then simply be a
1887 distinct label for the configuration (e.g. what you would give on the
1888 command line to explicitly query this host).
1889 .PP
1890 The 'interval' option (which takes a numeric argument) allows you to poll a
1891 server less frequently than the basic poll interval.  If you say
1892 \&'interval N' the server this option is attached to will only be
1893 queried every N poll intervals.
1894 .SS Singledrop vs. Multidrop options
1895 .PP
1896 Please ensure you read the section titled
1897 \fBTHE USE AND ABUSE OF MULTIDROP MAILBOXES \fP
1898 if you intend to use multidrop mode.
1899 .PP
1900 The 'is' or 'to' keywords associate the following local (client)
1901 name(s) (or server-name to client-name mappings separated by =) with
1902 the mailserver user name in the entry.  If an is/to list has '*' as
1903 its last name, unrecognized names are simply passed through. Note that
1904 until \fBfetchmail\fP version 6.3.4 inclusively, these lists could only
1905 contain local parts of user names (fetchmail would only look at the part
1906 before the @ sign). \fBfetchmail\fP versions 6.3.5 and
1907 newer support full addresses on the left hand side of these mappings,
1908 and they take precedence over any 'localdomains', 'aka', 'via' or
1909 similar mappings.
1910 .PP
1911 A single local name can be used to support redirecting your mail when
1912 your username on the client machine is different from your name on the
1913 mailserver.  When there is only a single local name, mail is forwarded
1914 to that local username regardless of the message's Received, To, Cc,
1915 and Bcc headers.  In this case,
1916 \fBfetchmail\fP
1917 never does DNS lookups.
1918 .PP
1919 When there is more than one local name (or name mapping),
1920 \fBfetchmail\fP looks at the envelope header, if configured, and
1921 otherwise at the Received, To, Cc, and Bcc headers of retrieved mail
1922 (this is 'multidrop mode').  It looks for addresses with hostname parts
1923 that match your poll name or your 'via', 'aka' or 'localdomains'
1924 options, and usually also for hostname parts which DNS tells it are
1925 aliases of the mailserver.  See the discussion of 'dns', 'checkalias',
1926 \&'localdomains', and 'aka' for details on how matching addresses are
1927 handled.
1928 .PP
1929 If \fBfetchmail\fP cannot match any mailserver usernames or
1930 localdomain addresses, the mail will be bounced.
1931 Normally it will be bounced to the sender, but if the 'bouncemail'
1932 global option is off, the mail will go to the local postmaster instead.
1933 (see the 'postmaster' global option). See also BUGS.
1934 .PP
1935 The 'dns' option (normally on) controls the way addresses from
1936 multidrop mailboxes are checked.  On, it enables logic to check each
1937 host address that does not match an 'aka' or 'localdomains' declaration
1938 by looking it up with DNS.  When a mailserver username is recognized
1939 attached to a matching hostname part, its local mapping is added to
1940 the list of local recipients.
1941 .PP
1942 The 'checkalias' option (normally off) extends the lookups performed
1943 by the 'dns' keyword in multidrop mode, providing a way to cope with
1944 remote MTAs that identify themselves using their canonical name, while
1945 they're polled using an alias.
1946 When such a server is polled, checks to extract the envelope address
1947 fail, and \fBfetchmail\fP reverts to delivery using the To/Cc/Bcc
1948 headers (See below \&'Header vs. Envelope addresses').
1949 Specifying this option instructs \fBfetchmail\fP to retrieve all the IP
1950 addresses associated with both the poll name and the name used by the
1951 remote MTA and to do a comparison of the IP addresses.  This comes in
1952 handy in situations where the remote server undergoes frequent canonical
1953 name changes, that would otherwise require modifications to the rcfile.
1954 \&'checkalias' has no effect if \&'no dns' is specified in the rcfile.
1955 .PP
1956 The 'aka' option is for use with multidrop mailboxes.  It allows you
1957 to pre-declare a list of DNS aliases for a server.  This is an
1958 optimization hack that allows you to trade space for speed.  When
1959 \fBfetchmail\fP, while processing a multidrop mailbox, grovels through
1960 message headers looking for names of the mailserver, pre-declaring
1961 common ones can save it from having to do DNS lookups.  Note: the names
1962 you give as arguments to 'aka' are matched as suffixes -- if you specify
1963 (say) 'aka netaxs.com', this will match not just a hostname netaxs.com,
1964 but any hostname that ends with '.netaxs.com'; such as (say)
1965 pop3.netaxs.com and mail.netaxs.com.
1966 .PP
1967 The 'localdomains' option allows you to declare a list of domains
1968 which fetchmail should consider local.  When fetchmail is parsing
1969 address lines in multidrop modes, and a trailing segment of a host
1970 name matches a declared local domain, that address is passed through
1971 to the listener or MDA unaltered (local-name mappings are \fInot\fP
1972 applied).
1973 .PP
1974 If you are using 'localdomains', you may also need to specify 'no
1975 envelope', which disables \fBfetchmail\fP's normal attempt to deduce
1976 an envelope address from the Received line or X-Envelope-To header or
1977 whatever header has been previously set by 'envelope'.  If you set 'no
1978 envelope' in the defaults entry it is possible to undo that in
1979 individual entries by using 'envelope <string>'.  As a special case,
1980 \&'envelope "Received"' restores the default parsing of
1981 Received lines.
1982 .PP
1983 The \fBpassword\fP option requires a string argument, which is the password
1984 to be used with the entry's server.
1985 .PP
1986 The 'preconnect' keyword allows you to specify a shell command to be
1987 executed just before each time
1988 \fBfetchmail\fP
1989 establishes a mailserver connection.  This may be useful if you are
1990 attempting to set up secure POP connections with the aid of
1991 .BR ssh (1).
1992 If the command returns a nonzero status, the poll of that mailserver
1993 will be aborted.
1994 .PP
1995 Similarly, the 'postconnect' keyword similarly allows you to specify a
1996 shell command to be executed just after each time a mailserver
1997 connection is taken down.
1998 .PP
1999 The 'forcecr' option controls whether lines terminated by LF only are
2000 given CRLF termination before forwarding.  Strictly speaking RFC821
2001 requires this, but few MTAs enforce the requirement it so this option
2002 is normally off (only one such MTA, qmail, is in significant use at
2003 time of writing).
2004 .PP
2005 The 'stripcr' option controls whether carriage returns are stripped
2006 out of retrieved mail before it is forwarded.  It is normally not
2007 necessary to set this, because it defaults to 'on' (CR stripping
2008 enabled) when there is an MDA declared but 'off' (CR stripping
2009 disabled) when forwarding is via SMTP.  If 'stripcr' and 'forcecr' are
2010 both on, 'stripcr' will override.
2011 .PP
2012 The 'pass8bits' option exists to cope with Microsoft mail programs that
2013 stupidly slap a "Content-Transfer-Encoding: 7bit" on everything.  With
2014 this option off (the default) and such a header present,
2015 \fBfetchmail\fP
2016 declares BODY=7BIT to an ESMTP-capable listener; this causes problems for
2017 messages actually using 8-bit ISO or KOI-8 character sets, which will
2018 be garbled by having the high bits of all characters stripped.  If
2019 \&'pass8bits' is on,
2020 \fBfetchmail\fP
2021 is forced to declare BODY=8BITMIME to any ESMTP-capable listener.  If
2022 the listener is 8-bit-clean (as all the major ones now are) the right
2023 thing will probably result.
2024 .PP
2025 The 'dropstatus' option controls whether nonempty Status and
2026 X-Mozilla-Status lines are retained in fetched mail (the default) or
2027 discarded.  Retaining them allows your MUA to see what messages (if
2028 any) were marked seen on the server.  On the other hand, it can
2029 confuse some new-mail notifiers, which assume that anything with a
2030 Status line in it has been seen.  (Note: the empty Status lines
2031 inserted by some buggy POP servers are unconditionally discarded.)
2032 .PP
2033 The 'dropdelivered' option controls whether Delivered\-To headers will
2034 be kept in fetched mail (the default) or discarded. These headers are
2035 added by Qmail and Postfix mailservers in order to avoid mail loops but
2036 may get in your way if you try to "mirror" a mailserver within the same
2037 domain. Use with caution.
2038 .PP
2039 The 'mimedecode' option controls whether MIME messages using the
2040 quoted-printable encoding are automatically converted into pure 8-bit
2041 data. If you are delivering mail to an ESMTP-capable, 8-bit-clean
2042 listener (that includes all of the major MTAs like sendmail), then
2043 this will automatically convert quoted-printable message headers and
2044 data into 8-bit data, making it easier to understand when reading
2045 mail. If your e-mail programs know how to deal with MIME messages,
2046 then this option is not needed.  The mimedecode option is off by
2047 default, because doing RFC2047 conversion on headers throws away
2048 character-set information and can lead to bad results if the encoding
2049 of the headers differs from the body encoding.
2050 .PP
2051 The 'idle' option is intended to be used with IMAP servers supporting
2052 the RFC2177 IDLE command extension, but does not strictly require it.
2053 If it is enabled, and fetchmail detects that IDLE is supported, an
2054 IDLE will be issued at the end of each poll.  This will tell the IMAP
2055 server to hold the connection open and notify the client when new mail
2056 is available.  If IDLE is not supported, fetchmail will simulate it by
2057 periodically issuing NOOP. If you need to poll a link frequently, IDLE
2058 can save bandwidth by eliminating TCP/IP connects and LOGIN/LOGOUT
2059 sequences. On the other hand, an IDLE connection will eat almost all
2060 of your fetchmail's time, because it will never drop the connection
2061 and allow other polls to occur unless the server times out the IDLE.
2062 It also doesn't work with multiple folders; only the first folder will
2063 ever be polled.
2064
2065 .PP
2066 The 'properties' option is an extension mechanism.  It takes a string
2067 argument, which is ignored by fetchmail itself.  The string argument may be
2068 used to store configuration information for scripts which require it.
2069 In particular, the output of '\-\-configdump' option will make properties
2070 associated with a user entry readily available to a Python script.
2071 .PP
2072 .SS Miscellaneous Run Control Options
2073 The words 'here' and 'there' have useful English-like
2074 significance.  Normally 'user eric is esr' would mean that
2075 mail for the remote user 'eric' is to be delivered to 'esr',
2076 but you can make this clearer by saying 'user eric there is esr here',
2077 or reverse it by saying 'user esr here is eric there'
2078 .PP
2079 Legal protocol identifiers for use with the 'protocol' keyword are:
2080 .sp
2081 .nf
2082     auto (or AUTO) (legacy, to be removed from future release)
2083     pop2 (or POP2) (legacy, to be removed from future release)
2084     pop3 (or POP3)
2085     sdps (or SDPS)
2086     imap (or IMAP)
2087     apop (or APOP)
2088     kpop (or KPOP)
2089 .fi
2090 .sp
2091 .PP
2092 Legal authentication types are 'any', 'password', 'kerberos',
2093 \&'kerberos_v4', 'kerberos_v5' and 'gssapi', 'cram\-md5', 'otp', 'msn'
2094 (only for POP3), 'ntlm', 'ssh', 'external' (only IMAP).
2095 The 'password' type specifies
2096 authentication by normal transmission of a password (the password may be
2097 plain text or subject to protocol-specific encryption as in CRAM-MD5);
2098 \&'kerberos' tells \fBfetchmail\fP to try to get a Kerberos ticket at the
2099 start of each query instead, and send an arbitrary string as the
2100 password; and 'gssapi' tells fetchmail to use GSSAPI authentication.
2101 See the description of the 'auth' keyword for more.
2102 .PP
2103 Specifying 'kpop' sets POP3 protocol over port 1109 with Kerberos V4
2104 authentication.  These defaults may be overridden by later options.
2105 .PP
2106 There are some global option statements: 'set logfile'
2107 followed by a string sets the same global specified by \-\-logfile.  A
2108 command-line \-\-logfile option will override this. Note that \-\-logfile is
2109 only effective if fetchmail detaches itself from the terminal and the
2110 logfile already exists before fetchmail is run, and it overrides
2111 \-\-syslog in this case.  Also,
2112 \&'set daemon' sets the poll interval as \-\-daemon does.  This can be
2113 overridden by a command-line \-\-daemon option; in particular \-\-daemon\~0
2114 can be used to force foreground operation. The 'set postmaster'
2115 statement sets the address to which multidrop mail defaults if there are
2116 no local matches.  Finally, 'set syslog' sends log messages to
2117 syslogd(8).
2118
2119 .SH DEBUGGING FETCHMAIL
2120 .SS Fetchmail crashing
2121 There are various ways in that fetchmail may "crash", i. e. stop
2122 operation suddenly and unexpectedly. A "crash" usually refers to an
2123 error condition that the software did not handle by itself. A well-known
2124 failure mode is the "segmentation fault" or "signal 11" or "SIGSEGV" or
2125 just "segfault" for short. These can be caused by hardware or by software
2126 problems. Software-induced segfaults can usually be reproduced easily
2127 and in the same place, whereas hardware-induced segfaults can go away if
2128 the computer is rebooted, or powered off for a few hours, and can happen
2129 in random locations even if you use the software the same way.
2130
2131 For solving hardware-induced segfaults, find the faulty component and repair or
2132 replace it.
2133 .URL http://www.bitwizard.nl/sig11/ "The Sig11 FAQ"
2134 may help you with details.
2135
2136 For solving software-induced segfaults, the developers may need a "stack
2137 backtrace".
2138
2139 .SS Enabling fetchmail core dumps
2140 By default, fetchmail suppresses core dumps as these might contain
2141 passwords and other sensitive information. For debugging fetchmail
2142 crashes, obtaining a "stack backtrace" from a core dump is often the
2143 quickest way to solve the problem, and when posting your problem on a
2144 mailing list, the developers may ask you for a "backtrace".
2145
2146 1. To get useful backtraces, fetchmail needs to be installed without
2147 getting stripped of its compilation symbols.  Unfortunately, most
2148 binary packages that are installed are stripped, and core files from
2149 symbol-stripped programs are worthless. So you may need to recompile
2150 fetchmail. On many systems, you can type
2151 .sp
2152 .nf
2153         file `which fetchmail`
2154 .fi
2155 .sp
2156 to find out if fetchmail was symbol-stripped or not. If yours was
2157 unstripped, fine, proceed, if it was stripped, you need to recompile the
2158 source code first. You do not usually need to install fetchmail in order
2159 to debug it.
2160
2161 2. The shell environment that starts fetchmail needs to enable core
2162 dumps. The key is the "maximum core (file) size" that can usually be
2163 configured with a tool named "limit" or "ulimit". See the documentation
2164 for your shell for details. In the popular bash shell, "ulimit \-Sc
2165 unlimited" will allow the core dump.
2166
2167 3. You need to tell fetchmail, too, to allow core dumps. To do
2168 this, run fetchmail with the \fB\-d0 \-v\fP options.  It is often easier
2169 to also add \fB\-\-nosyslog \-N\fP as well.
2170
2171 Finally, you need to reproduce the crash. You can just start fetchmail
2172 from the directory where you compiled it by typing \fB./fetchmail\fP,
2173 so the complete command line will start with \fB./fetchmail \-Nvd0
2174 \&\-\-nosyslog\fP and perhaps list your other options.
2175
2176 After the crash, run your debugger to obtain the core dump.  The
2177 debugger will often be GNU GDB, you can then type (adjust paths as
2178 necessary) \fBgdb ./fetchmail fetchmail.core\fP and then, after GDB
2179 has started up and read all its files, type \fBbacktrace full\fP, save
2180 the output (copy & paste will do, the backtrace will be read by a human)
2181 and then type \fBquit\fP to leave gdb.
2182 \fBNote:\fP
2183 on some systems, the core
2184 files have different names, they might contain a number instead of the
2185 program name, or number and name, but it will usually have "core" as
2186 part of their name.
2187
2188 .SH INTERACTION WITH RFC 822
2189 When trying to determine the originating address of a message,
2190 fetchmail looks through headers in the following order:
2191 .sp
2192 .nf
2193         Return-Path:
2194         Resent-Sender: (ignored if it doesn't contain an @ or !)
2195         Sender: (ignored if it doesn't contain an @ or !)
2196         Resent-From:
2197         From:
2198         Reply-To:
2199         Apparently-From:
2200 .fi
2201 .sp
2202 The originating address is used for logging, and to set the MAIL FROM
2203 address when forwarding to SMTP.  This order is intended to cope
2204 gracefully with receiving mailing list messages in multidrop mode. The
2205 intent is that if a local address doesn't exist, the bounce message
2206 won't be returned blindly to the author or to the list itself, but
2207 rather to the list manager (which is less annoying).
2208
2209 In multidrop mode, destination headers are processed as follows:
2210 First, fetchmail looks for the header specified by the 'envelope' option
2211 in order to determine the local recipient address. If the mail is
2212 addressed to more than one recipient, the Received line won't contain
2213 any information regarding recipient addresses.
2214
2215 Then fetchmail looks for the Resent-To:, Resent-Cc:, and Resent-Bcc:
2216 lines.  If they exist, they should contain the final recipients and
2217 have precedence over their To:/Cc:/Bcc: counterparts.  If the Resent\-*
2218 lines don't exist, the To:, Cc:, Bcc: and Apparently-To: lines are
2219 looked for. (The presence of a Resent\-To: is taken to imply that the
2220 person referred by the To: address has already received the original
2221 copy of the mail.)
2222
2223 .SH CONFIGURATION EXAMPLES
2224 Note that although there are password declarations in a good many
2225 of the examples below, this is mainly for illustrative purposes.
2226 We recommend stashing account/password pairs in your $HOME/.netrc
2227 file, where they can be used not just by fetchmail but by ftp(1) and
2228 other programs.
2229
2230 The basic format is:
2231
2232 .IP
2233 poll \fISERVERNAME\fP protocol \fIPROTOCOL\fP username \fINAME\fP
2234 password \fIPASSWORD\fP
2235
2236 .PP
2237 Example:
2238
2239 .IP
2240 .nf
2241 poll pop.provider.net protocol pop3 username "jsmith" password "secret1"
2242 .fi
2243
2244 .PP
2245 Or, using some abbreviations:
2246
2247 .IP
2248 .nf
2249 poll pop.provider.net proto pop3 user "jsmith" password "secret1"
2250 .fi
2251
2252 .PP
2253 Multiple servers may be listed:
2254
2255 .IP
2256 .nf
2257 poll pop.provider.net proto pop3 user "jsmith" pass "secret1"
2258 poll other.provider.net proto pop2 user "John.Smith" pass "My^Hat"
2259 .fi
2260
2261 .PP
2262 Here's the same version with more whitespace and some noise words:
2263
2264 .IP
2265 .nf
2266 poll pop.provider.net proto pop3
2267      user "jsmith", with password secret1, is "jsmith" here;
2268 poll other.provider.net proto pop2:
2269      user "John.Smith", with password "My^Hat", is "John.Smith" here;
2270 .fi
2271
2272 .PP
2273 If you need to include whitespace in a parameter string or start the
2274 latter with a number, enclose the string in double quotes.  Thus:
2275
2276 .IP
2277 .nf
2278 poll mail.provider.net with proto pop3:
2279      user "jsmith" there has password "4u but u can't krak this"
2280      is jws here and wants mda "/bin/mail"
2281 .fi
2282
2283 .PP
2284 You may have an initial server description headed by the keyword
2285 \&'defaults' instead of 'poll' followed by a name.  Such a record
2286 is interpreted as defaults for all queries to use. It may be overwritten
2287 by individual server descriptions.  So, you could write:
2288
2289 .IP
2290 .nf
2291 defaults proto pop3
2292      user "jsmith"
2293 poll pop.provider.net
2294      pass "secret1"
2295 poll mail.provider.net
2296      user "jjsmith" there has password "secret2"
2297 .fi
2298
2299 .PP
2300 It's possible to specify more than one user per server.
2301 The 'user' keyword leads off a user description, and every user specification
2302 in a multi-user entry must include it.  Here's an example:
2303
2304 .IP
2305 .nf
2306 poll pop.provider.net proto pop3 port 3111
2307      user "jsmith" with pass "secret1" is "smith" here
2308      user jones with pass "secret2" is "jjones" here keep
2309 .fi
2310
2311 .PP
2312 This associates the local username 'smith' with the pop.provider.net
2313 username 'jsmith' and the local username 'jjones' with the
2314 pop.provider.net username 'jones'.  Mail for 'jones' is kept on the
2315 server after download.
2316
2317 .PP
2318 Here's what a simple retrieval configuration for a multidrop mailbox
2319 looks like:
2320
2321 .IP
2322 .nf
2323 poll pop.provider.net:
2324      user maildrop with pass secret1 to golux 'hurkle'='happy' snark here
2325 .fi
2326
2327 .PP
2328 This says that the mailbox of account 'maildrop' on the server is a
2329 multidrop box, and that messages in it should be parsed for the
2330 server user names 'golux', 'hurkle', and 'snark'.  It further
2331 specifies that 'golux' and 'snark' have the same name on the
2332 client as on the server, but mail for server user 'hurkle' should be
2333 delivered to client user 'happy'.
2334
2335 .PP
2336 \fBNote\fP that \fBfetchmail,\fP until version 6.3.4, did NOT allow full
2337 user@domain specifications here, these would never match.
2338 \fIFetchmail\fP 6.3.5 and newer support user@domain specifications on
2339 the left-hand side of a user mapping.
2340
2341 .PP
2342 Here's an example of another kind of multidrop connection:
2343
2344 .IP
2345 .nf
2346 poll pop.provider.net localdomains loonytoons.org toons.org
2347      envelope X-Envelope-To
2348      user maildrop with pass secret1 to * here
2349 .fi
2350
2351 .PP
2352 This also says that the mailbox of account 'maildrop' on the server is
2353 a multidrop box.  It tells fetchmail that any address in the
2354 loonytoons.org or toons.org domains (including sub-domain addresses like
2355 \&'joe@daffy.loonytoons.org') should be passed through to the local SMTP
2356 listener without modification.  Be careful of mail loops if you do this!
2357
2358 .PP
2359 Here's an example configuration using ssh and the plugin option.  The
2360 queries are made directly on the stdin and stdout of imapd via ssh.
2361 Note that in this setup, IMAP authentication can be skipped.
2362
2363 .IP
2364 .nf
2365 poll mailhost.net with proto imap:
2366      plugin "ssh %h /usr/sbin/imapd" auth ssh;
2367      user esr is esr here
2368 .fi
2369
2370 .SH THE USE AND ABUSE OF MULTIDROP MAILBOXES
2371 Use the multiple-local-recipients feature with caution -- it can bite.
2372 All multidrop features are ineffective in ETRN and ODMR modes.
2373
2374 Also, note that in multidrop mode duplicate mails are suppressed.  A
2375 piece of mail is considered duplicate if it has the same message-ID as
2376 the message immediately preceding and more than one addressee.  Such
2377 runs of messages may be generated when copies of a message addressed
2378 to multiple users are delivered to a multidrop box.
2379
2380 .SS Header vs. Envelope addresses
2381 The fundamental problem is that by having your mailserver toss several
2382 peoples' mail in a single maildrop box, you may have thrown away
2383 potentially vital information about who each piece of mail was
2384 actually addressed to (the 'envelope address', as opposed to the
2385 header addresses in the RFC822 To/Cc headers - the Bcc is not available
2386 at the receiving end).  This 'envelope address' is the address you need
2387 in order to reroute mail properly.
2388 .PP
2389 Sometimes
2390 \fBfetchmail\fP
2391 can deduce the envelope address.  If the mailserver MTA is
2392 \fBsendmail\fP
2393 and the item of mail had just one recipient, the MTA will have written
2394 a 'by/for' clause that gives the envelope addressee into its Received
2395 header. But this doesn't work reliably for other MTAs, nor if there is
2396 more than one recipient.  By default, \fBfetchmail\fP looks for
2397 envelope addresses in these lines; you can restore this default with
2398 \&\-E "Received" or 'envelope Received'.
2399 .PP
2400 \fBAs a better alternative,\fP
2401 some SMTP listeners and/or mail servers insert a header
2402 in each message containing a copy of the envelope addresses.  This
2403 header (when it exists) is often 'X\-Original\-To', 'Delivered\-To' or
2404 \&'X\-Envelope\-To'.  Fetchmail's assumption about this can be changed with
2405 the \-E or 'envelope' option.  Note that writing an envelope header of
2406 this kind exposes the names of recipients (including blind-copy
2407 recipients) to all receivers of the messages, so the upstream must store
2408 one copy of the message per recipient to avoid becoming a privacy problem.
2409 .PP
2410 Postfix, since version 2.0, writes an X\-Original\-To: header which
2411 contains a copy of the envelope as it was received.
2412 .PP
2413 Qmail and Postfix generally write a 'Delivered\-To' header upon
2414 delivering the message to the mail spool and use it to avoid mail loops.
2415 Qmail virtual domains however will prefix the user name with a string
2416 that normally matches the user's domain. To remove this prefix you can
2417 use the \-Q or 'qvirtual' option.
2418 .PP
2419 Sometimes, unfortunately, neither of these methods works.  That is the
2420 point when you should contact your ISP and ask them to provide such an
2421 envelope header, and you should not use multidrop in this situation.
2422 When they all fail, fetchmail must fall back on the contents of To/Cc
2423 headers (Bcc headers are not available - see below) to try to determine
2424 recipient addressees -- and these are unreliable.
2425 In particular, mailing-list software often ships mail with only
2426 the list broadcast address in the To header.
2427 .PP
2428 \fBNote that a future version of \fBfetchmail\fP may remove To/Cc parsing!\fP
2429 .PP
2430 When
2431 \fBfetchmail\fP
2432 cannot deduce a recipient address that is local, and the intended
2433 recipient address was anyone other than fetchmail's invoking user,
2434 \fBmail will get lost.\fP
2435 This is what makes the multidrop feature risky without proper envelope
2436 information.
2437 .PP
2438 A related problem is that when you blind-copy a mail message, the Bcc
2439 information is carried \fIonly\fP as envelope address (it's removed from
2440 the headers by the sending mail server, so fetchmail can see it only if
2441 there is an X\-Envelope\-To header).  Thus, blind-copying to someone who
2442 gets mail over a fetchmail multidrop link will fail unless the the
2443 mailserver host routinely writes X\-Envelope\-To or an equivalent header
2444 into messages in your maildrop.
2445 .PP
2446 \fBIn conclusion, mailing lists and Bcc'd mail can only work if the
2447 server you're fetching from\fP
2448 .IP (1)
2449 \fBstores one copy of the message per recipient in your domain and\fP
2450 .IP (2)
2451 \fBrecords the envelope information in a special header (X\-Original\-To,
2452 Delivered\-To, X\-Envelope\-To).\fP
2453
2454 .SS Good Ways To Use Multidrop Mailboxes
2455 Multiple local names can be used to administer a mailing list from the
2456 client side of a \fBfetchmail\fP collection.  Suppose your name is
2457 \&'esr', and you want to both pick up your own mail and maintain a mailing
2458 list called (say) "fetchmail-friends", and you want to keep the alias
2459 list on your client machine.
2460 .PP
2461 On your server, you can alias 'fetchmail\-friends' to 'esr'; then, in
2462 your \fI.fetchmailrc\fP, declare 'to esr fetchmail\-friends here'.
2463 Then, when mail including 'fetchmail\-friends' as a local address
2464 gets fetched, the list name will be appended to the list of
2465 recipients your SMTP listener sees.  Therefore it will undergo alias
2466 expansion locally.  Be sure to include 'esr' in the local alias
2467 expansion of fetchmail\-friends, or you'll never see mail sent only to
2468 the list.  Also be sure that your listener has the "me-too" option set
2469 (sendmail's \-oXm command-line option or OXm declaration) so your name
2470 isn't removed from alias expansions in messages you send.
2471 .PP
2472 This trick is not without its problems, however.  You'll begin to see
2473 this when a message comes in that is addressed only to a mailing list
2474 you do \fInot\fP have declared as a local name.  Each such message
2475 will feature an 'X\-Fetchmail\-Warning' header which is generated
2476 because fetchmail cannot find a valid local name in the recipient
2477 addresses.  Such messages default (as was described above) to being
2478 sent to the local user running \fBfetchmail\fP, but the program has no
2479 way to know that that's actually the right thing.
2480
2481 .SS Bad Ways To Abuse Multidrop Mailboxes
2482 Multidrop mailboxes and
2483 \fBfetchmail\fP
2484 serving multiple users in daemon mode do not mix.  The problem, again, is
2485 mail from mailing lists, which typically does not have an individual
2486 recipient address on it.   Unless
2487 \fBfetchmail\fP
2488 can deduce an envelope address, such mail will only go to the account
2489 running fetchmail (probably root).  Also, blind-copied users are very
2490 likely never to see their mail at all.
2491 .PP
2492 If you're tempted to use
2493 \fBfetchmail\fP
2494 to retrieve mail for multiple users from a single mail drop via POP or
2495 IMAP, think again (and reread the section on header and envelope
2496 addresses above).  It would be smarter to just let the mail sit in the
2497 mailserver's queue and use fetchmail's ETRN or ODMR modes to trigger
2498 SMTP sends periodically (of course, this means you have to poll more
2499 frequently than the mailserver's expiry period).  If you can't arrange
2500 this, try setting up a UUCP feed.
2501 .PP
2502 If you absolutely \fImust\fP use multidrop for this purpose, make sure
2503 your mailserver writes an envelope-address header that fetchmail can
2504 see.  Otherwise you \fIwill\fP lose mail and it \fIwill\fP come back
2505 to haunt you.
2506
2507 .SS Speeding Up Multidrop Checking
2508 Normally, when multiple users are declared
2509 \fBfetchmail\fP
2510 extracts recipient addresses as described above and checks each host
2511 part with DNS to see if it's an alias of the mailserver.  If so, the
2512 name mappings described in the "to ... here" declaration are done and
2513 the mail locally delivered.
2514 .PP
2515 This is a convenient but also slow method.  To speed
2516 it up, pre-declare mailserver aliases with 'aka'; these are checked
2517 before DNS lookups are done.  If you're certain your aka list contains
2518 \fBall\fP
2519 DNS aliases of the mailserver (and all MX names pointing at it - note
2520 this may change in a future version)
2521 you can declare 'no dns' to suppress DNS lookups entirely and
2522 \fIonly\fP match against the aka list.
2523
2524 .SH SOCKS
2525 Support for socks4/5 is a \fBcompile time\fP configuration option. Once
2526 compiled in, fetchmail will always use the socks libraries and
2527 configuration on your system, there are no run-time switches in
2528 fetchmail - but you can still configure SOCKS: you can specify which
2529 SOCKS configuration file is used in the \fBSOCKS_CONF\fP environment
2530 variable.
2531
2532 For instance, if you wanted to bypass the SOCKS proxy altogether and
2533 have fetchmail connect directly, you could just pass
2534 SOCKS_CONF=/dev/null in the environment, for example (add your usual
2535 command line options - if any - to the end of this line):
2536
2537 .nf
2538 env SOCKS_CONF=/dev/null fetchmail
2539 .fi
2540
2541 .SH EXIT CODES
2542 To facilitate the use of
2543 \fBfetchmail\fP
2544 in shell scripts, an exit\ status code is returned to give an indication
2545 of what occurred during a given connection.
2546 .PP
2547 The exit codes returned by
2548 \fBfetchmail\fP
2549 are as follows:
2550 .IP 0
2551 One or more messages were successfully retrieved (or, if the \-c option
2552 was selected, were found waiting but not retrieved).
2553 .IP 1
2554 There was no mail awaiting retrieval.  (There may have been old mail still
2555 on the server but not selected for retrieval.)
2556 .IP 2
2557 An error was encountered when attempting to open a socket to retrieve
2558 mail.  If you don't know what a socket is, don't worry about it --
2559 just treat this as an 'unrecoverable error'.  This error can also be
2560 because a protocol fetchmail wants to use is not listed in /etc/services.
2561 .IP 3
2562 The user authentication step failed.  This usually means that a bad
2563 user-id, password, or APOP id was specified.  Or it may mean that you
2564 tried to run fetchmail under circumstances where it did not have
2565 standard input attached to a terminal and could not prompt for a
2566 missing password.
2567 .IP 4
2568 Some sort of fatal protocol error was detected.
2569 .IP 5
2570 There was a syntax error in the arguments to
2571 \fBfetchmail\fP, or a pre- or post-connect command failed.
2572 .IP 6
2573 The run control file had bad permissions.
2574 .IP 7
2575 There was an error condition reported by the server.  Can also
2576 fire if
2577 \fBfetchmail\fP
2578 timed out while waiting for the server.
2579 .IP 8
2580 Client-side exclusion error.  This means
2581 \fBfetchmail\fP
2582 either found another copy of itself already running, or failed in such
2583 a way that it isn't sure whether another copy is running.
2584 .IP 9
2585 The user authentication step failed because the server responded "lock
2586 busy".  Try again after a brief pause!  This error is not implemented
2587 for all protocols, nor for all servers.  If not implemented for your
2588 server, "3" will be returned instead, see above.  May be returned when
2589 talking to qpopper or other servers that can respond with "lock busy"
2590 or some similar text containing the word "lock".
2591 .IP 10
2592 The
2593 \fBfetchmail\fP
2594 run failed while trying to do an SMTP port open or transaction.
2595 .IP 11
2596 Fatal DNS error.  Fetchmail encountered an error while performing
2597 a DNS lookup at startup and could not proceed.
2598 .IP 12
2599 BSMTP batch file could not be opened.
2600 .IP 13
2601 Poll terminated by a fetch limit (see the \-\-fetchlimit option).
2602 .IP 14
2603 Server busy indication.
2604 .IP 23
2605 Internal error.  You should see a message on standard error with
2606 details.
2607 .IP "24 - 26, 28, 29"
2608 These are internal codes and should not appear externally.
2609 .PP
2610 When
2611 \fBfetchmail\fP
2612 queries more than one host, return status is 0 if \fIany\fP query
2613 successfully retrieved mail. Otherwise the returned error status is
2614 that of the last host queried.
2615
2616 .SH FILES
2617 .TP 5
2618 ~/.fetchmailrc
2619 default run control file
2620 .TP 5
2621 ~/.fetchids
2622 default location of file recording last message UIDs seen per host.
2623 .TP 5
2624 ~/.fetchmail.pid
2625 lock file to help prevent concurrent runs (non-root mode).
2626 .TP 5
2627 ~/.netrc
2628 your FTP run control file, which (if present) will be searched for
2629 passwords as a last resort before prompting for one interactively.
2630 .TP 5
2631 /var/run/fetchmail.pid
2632 lock file to help prevent concurrent runs (root mode, Linux systems).
2633 .TP 5
2634 /etc/fetchmail.pid
2635 lock file to help prevent concurrent runs (root mode, systems without /var/run).
2636
2637 .SH ENVIRONMENT
2638 .B FETCHMAILUSER:
2639 If the FETCHMAILUSER variable is set, it is used as the name of the
2640 calling user (default local name) for purposes such as mailing error
2641 notifications.  Otherwise, if either the LOGNAME or USER variable is
2642 correctly set (e.g. the corresponding UID matches the session user ID)
2643 then that name is used as the default local name.  Otherwise
2644 \fBgetpwuid\fP(3) must be able to retrieve a password entry for the
2645 session ID (this elaborate logic is designed to handle the case of
2646 multiple names per userid gracefully).
2647
2648 .B FETCHMAILHOME:
2649 If the environment variable FETCHMAILHOME is set to a valid and
2650 existing directory name, fetchmail will read $FETCHMAILHOME/fetchmailrc
2651 (the dot is missing in this case), $FETCHMAILHOME/.fetchids and
2652 $FETCHMAILHOME/.fetchmail.pid rather than from the user's home
2653 directory.  The .netrc file is always looked for in the the invoking
2654 user's home directory regardless of FETCHMAILHOME's setting.
2655
2656 .B HOME_ETC:
2657 If the HOME_ETC variable is set, fetchmail will read
2658 $HOME_ETC/.fetchmailrc instead of ~/.fetchmailrc.
2659
2660 If HOME_ETC and FETCHMAILHOME are both set, HOME_ETC will be ignored.
2661
2662 .B SOCKS_CONF:
2663 (only if SOCKS support is compiled in) this variable is used by the
2664 socks library to find out which configuration file it should read. Set
2665 this to /dev/null to bypass the SOCKS proxy.
2666
2667 .SH SIGNALS
2668 If a
2669 \fBfetchmail\fP
2670 daemon is running as root, SIGUSR1 wakes it up from its sleep phase and
2671 forces a poll of all non-skipped servers. For compatibility reasons,
2672 SIGHUP can also be used in 6.3.X but may not be available in future
2673 fetchmail versions.
2674 .PP
2675 If
2676 \fBfetchmail\fP
2677 is running in daemon mode as non-root, use SIGUSR1 to wake it (this is
2678 so SIGHUP due to logout can retain the default action of killing it).
2679 .PP
2680 Running \fBfetchmail\fP in foreground while a background fetchmail is
2681 running will do whichever of these is appropriate to wake it up.
2682
2683 .SH BUGS AND KNOWN PROBLEMS
2684 .PP
2685 Please check the \fBNEWS\fP file that shipped with fetchmail for more
2686 known bugs than those listed here.
2687 .PP
2688 Fetchmail cannot handle user names that contain blanks after a "@"
2689 character, for instance "demonstr@ti on". These are rather uncommon and
2690 only hurt when using UID-based \-\-keep setups, so the 6.3.X versions of
2691 fetchmail won't be fixed.
2692 .PP
2693 The assumptions that the DNS and in particular the checkalias options
2694 make are not often sustainable. For instance, it has become uncommon for
2695 an MX server to be a POP3 or IMAP server at the same time. Therefore the
2696 MX lookups may go away in a future release.
2697 .PP
2698 The mda and plugin options interact badly.  In order to collect error
2699 status from the MDA, fetchmail has to change its normal signal
2700 handling so that dead plugin processes don't get reaped until the end
2701 of the poll cycle.  This can cause resource starvation if too many
2702 zombies accumulate.  So either don't deliver to a MDA using plugins or
2703 risk being overrun by an army of undead.
2704 .PP
2705 The \-\-interface option does not support IPv6 and it is doubtful if it
2706 ever will, since there is no portable way to query interface IPv6
2707 addresses.
2708 .PP
2709 The RFC822 address parser used in multidrop mode chokes on some
2710 @-addresses that are technically legal but bizarre.  Strange uses of
2711 quoting and embedded comments are likely to confuse it.
2712 .PP
2713 In a message with multiple envelope headers, only the last one
2714 processed will be visible to fetchmail.
2715 .PP
2716 Use of some of these protocols requires that the program send
2717 unencrypted passwords over the TCP/IP connection to the mailserver.
2718 This creates a risk that name/password pairs might be snaffled with a
2719 packet sniffer or more sophisticated monitoring software.  Under Linux
2720 and FreeBSD, the \-\-interface option can be used to restrict polling to
2721 availability of a specific interface device with a specific local or
2722 remote IP address, but snooping is still possible if (a) either host
2723 has a network device that can be opened in promiscuous mode, or (b)
2724 the intervening network link can be tapped.  We recommend the use of
2725 .BR ssh (1)
2726 tunnelling to not only shroud your passwords but encrypt the entire
2727 conversation.
2728 .PP
2729 Use of the %F or %T escapes in an mda option could open a security
2730 hole, because they pass text manipulable by an attacker to a shell
2731 command.  Potential shell characters are replaced by '_' before
2732 execution.  The hole is further reduced by the fact that fetchmail
2733 temporarily discards any suid privileges it may have while running the
2734 MDA.  For maximum safety, however, don't use an mda command containing
2735 %F or %T when fetchmail is run from the root account itself.
2736 .PP
2737 Fetchmail's method of sending bounces due to errors or spam-blocking and
2738 spam bounces requires that port 25 of localhost be available for sending
2739 mail via SMTP.
2740 .PP
2741 If you modify \fI~/.fetchmailrc\fP while a background instance is
2742 running and break the syntax, the background instance will die silently.
2743 Unfortunately, it can't die noisily because we don't yet know whether
2744 syslog should be enabled.  On some systems, fetchmail dies quietly even
2745 if there is no syntax error; this seems to have something to do with
2746 buggy terminal ioctl code in the kernel.
2747 .PP
2748 The \-f\~\- option (reading a configuration from stdin) is incompatible
2749 with the plugin option.
2750 .PP
2751 The 'principal' option only handles Kerberos IV, not V.
2752 .PP
2753 Interactively entered passwords are truncated after 63 characters. If
2754 you really need to use a longer password, you will have to use a
2755 configuration file.
2756 .PP
2757 A backslash as the last character of a configuration file will be
2758 flagged as a syntax error rather than ignored.
2759 .PP
2760 The BSMTP error handling is virtually nonexistent and may leave broken
2761 messages behind.
2762 .PP
2763 Send comments, bug reports, gripes, and the like to the
2764 .MTO "fetchmail-devel@lists.berlios.de" "fetchmail-devel list"
2765
2766 .PP
2767 An
2768 .URL "http://fetchmail.berlios.de/fetchmail-FAQ.html" "HTML FAQ"
2769 is available at the fetchmail home page, it should also accompany your
2770 installation.
2771
2772 .SH AUTHOR
2773 Fetchmail is currently maintained by Matthias Andree and Rob Funk with
2774 major assistance from Sunil Shetye (for code) and Rob MacGregor (for the
2775 mailing lists).
2776 .PP
2777 Most of the code is from
2778 .MTO esr@snark.thyrsus.com "Eric S. Raymond"
2779 \&.  Too many other people to name here have contributed code and patches.
2780 .PP
2781 This program is descended from and replaces
2782 .BR popclient ,
2783 by
2784 .MTO "ceharris@mal.com" "Carl Harris"
2785 \&; the internals have become quite different, but some of its interface
2786 design is directly traceable to that ancestral program.
2787 .PP
2788 This manual page has been improved by Matthias Andree, R.\ Hannes
2789 Beinert, and H\['e]ctor Garc\['i]a.
2790
2791 .SH SEE ALSO
2792 .PP
2793 .BR README ,
2794 .BR README.SSL ,
2795 .BR README.SSL-SERVER ,
2796 .URL "http://www.fetchmail.info/fetchmail-FAQ.html" "The Fetchmail FAQ" ,
2797 .BR mutt (1),
2798 .BR elm (1),
2799 .BR mail (1),
2800 .BR sendmail (8),
2801 .BR popd (8),
2802 .BR imapd (8),
2803 .BR netrc (5).
2804
2805 .PP
2806 .URL "http://fetchmail.berlios.de/" "The fetchmail home page."
2807
2808 .PP
2809 .URL "http://www.courier-mta.org/maildrop/" "The maildrop home page."
2810
2811 .SH APPLICABLE STANDARDS
2812 .PP
2813 Note that this list is just a collection of references and not a
2814 statement as to the actual protocol conformance or requirements in
2815 fetchmail.
2816 .TP 5
2817 SMTP/ESMTP:
2818 RFC 821, RFC 2821, RFC 1869, RFC 1652, RFC 1870, RFC 1983, RFC 1985,
2819 RFC 2554.
2820 .TP 5
2821 mail:
2822 RFC 822, RFC 2822, RFC 1123, RFC 1892, RFC 1894.
2823 .TP 5
2824 POP2:
2825 RFC 937
2826 .TP 5
2827 POP3:
2828 RFC 1081, RFC 1225, RFC 1460, RFC 1725, RFC 1734, RFC 1939, RFC 1957,
2829 RFC 2195, RFC 2449.
2830 .TP 5
2831 APOP:
2832 RFC 1939.
2833 .TP 5
2834 RPOP:
2835 RFC 1081, RFC 1225.
2836 .TP 5
2837 IMAP2/IMAP2BIS:
2838 RFC 1176, RFC 1732.
2839 .TP 5
2840 IMAP4/IMAP4rev1:
2841 RFC 1730, RFC 1731, RFC 1732, RFC 2060, RFC 2061, RFC 2195, RFC 2177,
2842 RFC 2683.
2843 .TP 5
2844 ETRN:
2845 RFC 1985.
2846 .TP 5
2847 ODMR/ATRN:
2848 RFC 2645.
2849 .TP 5
2850 OTP:
2851 RFC 1938.
2852 .TP 5
2853 LMTP:
2854 RFC 2033.
2855 .TP 5
2856 GSSAPI:
2857 RFC 1508.
2858 .TP 5
2859 TLS:
2860 RFC 2595.