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