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