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