1fetchmail(1)              fetchmail reference manual              fetchmail(1)
2
3
4

NAME

6       fetchmail - fetch mail from a POP, IMAP, ETRN, or ODMR-capable server
7
8

SYNOPSIS

10       fetchmail [option...] [mailserver...]
11       fetchmailconf
12
13

DESCRIPTION

15       fetchmail  is  a mail-retrieval and forwarding utility; it fetches mail
16       from  remote  mailservers  and  forwards  it  to  your  local  (client)
17       machine's  delivery  system.   You  can  then handle the retrieved mail
18       using normal mail user agents such as mutt(1), elm(1) or Mail(1).   The
19       fetchmail utility can be run in a daemon mode to repeatedly poll one or
20       more systems at a specified interval.
21
22       The fetchmail program can gather mail from servers  supporting  any  of
23       the  common  mail-retrieval protocols: POP2 (legacy, to be removed from
24       future release), POP3, IMAP2bis, IMAP4, and IMAP4rev1.  It can also use
25       the ESMTP ETRN extension and ODMR.  (The RFCs describing all these pro‐
26       tocols are listed at the end of this manual page.)
27
28       While fetchmail is primarily intended to be used over on-demand  TCP/IP
29       links  (such  as  SLIP  or PPP connections), it may also be useful as a
30       message transfer agent for sites which refuse for security  reasons  to
31       permit (sender-initiated) SMTP transactions with sendmail.
32
33
34   SUPPORT, TROUBLESHOOTING
35       For troubleshooting, tracing and debugging, you need to increase fetch‐
36       mail's verbosity to actually see what happens. To do that,  please  run
37       both  of  the  two  following commands, adding all of the options you'd
38       normally use.
39
40
41              env LC_ALL=C fetchmail -V -v --nodetach --nosyslog
42
43              (This command line prints in English how  fetchmail  understands
44              your configuration.)
45
46
47              env LC_ALL=C fetchmail -vvv  --nodetach --nosyslog
48
49              (This  command line actually runs fetchmail with verbose English
50              output.)
51
52       Also see item #G3 in fetchmail's FAQ ⟨http://fetchmail.sourceforge.net/
53       fetchmail-FAQ.html#G3⟩
54
55       You  can  omit  the LC_ALL=C part above if you want output in the local
56       language (if supported). However if you are posting to  mailing  lists,
57       please  leave it in. The maintainers do not necessarily understand your
58       language, please use English.
59
60
61
62
63   CONCEPTS
64       If fetchmail is used with a POP or an IMAP server (but not with ETRN or
65       ODMR),  it has two fundamental modes of operation for each user account
66       from which it retrieves mail: singledrop- and multidrop-mode.
67
68       In singledrop-mode,
69              fetchmail assumes that all messages in the user's account (mail‐
70              box)  are  intended for a single recipient.  The identity of the
71              recipient will either default to the local user  currently  exe‐
72              cuting fetchmail, or will need to be explicitly specified in the
73              configuration file.
74
75              fetchmail uses singledrop-mode when the  fetchmailrc  configura‐
76              tion  contains  at  most a single local user specification for a
77              given server account.
78
79       In multidrop-mode,
80              fetchmail assumes that the mail server account actually contains
81              mail  intended  for  any number of different recipients.  There‐
82              fore, fetchmail must attempt  to  deduce  the  proper  "envelope
83              recipient"  from the mail headers of each message.  In this mode
84              of operation, fetchmail almost resembles a mail  transfer  agent
85              (MTA).
86
87              Note  that  neither the POP nor IMAP protocols were intended for
88              use in this fashion, and hence envelope information is often not
89              directly  available.   The ISP must stores the envelope informa‐
90              tion in some message header and. The ISP  must  also  store  one
91              copy  of  the message per recipient. If either of the conditions
92              is not fulfilled, this process is unreliable, because  fetchmail
93              must then resort to guessing the true envelope recipient(s) of a
94              message. This usually fails for mailing list messages and  Bcc:d
95              mail, or mail for multiple recipients in your domain.
96
97              fetchmail  uses  multidrop-mode  when  more  than one local user
98              and/or a wildcard is specified for a particular  server  account
99              in the configuration file.
100
101       In ETRN and ODMR modes,
102              these  considerations do not apply, as these protocols are based
103              on SMTP, which provides explicit envelope recipient information.
104              These protocols always support multiple recipients.
105
106       As  each  message is retrieved, fetchmail normally delivers it via SMTP
107       to port 25 on the machine it is running on (localhost), just as  though
108       it  were being passed in over a normal TCP/IP link.  fetchmail provides
109       the SMTP server with  an  envelope  recipient  derived  in  the  manner
110       described  previously.   The  mail  will then be delivered according to
111       your MTA's rules (the  Mail  Transfer  Agent  is  usually  sendmail(8),
112       exim(8),  or  postfix(8)).   Invoking  your system's MDA (Mail Delivery
113       Agent) is the duty of your MTA.  All  the  delivery-control  mechanisms
114       (such as .forward files) normally available through your system MTA and
115       local delivery agents will therefore be applied as usual.
116
117       If your fetchmail  configuration  sets  a  local  MDA  (see  the  --mda
118       option), it will be used directly instead of talking SMTP to port 25.
119
120       If  the  program fetchmailconf is available, it will assist you in set‐
121       ting up and editing a fetchmailrc configuration.  It runs under  the  X
122       window  system and requires that the language Python and the Tk toolkit
123       (with Python bindings) be present on your system.   If  you  are  first
124       setting  up  fetchmail for single-user mode, it is recommended that you
125       use Novice mode.  Expert mode provides complete  control  of  fetchmail
126       configuration,  including  the multidrop features.  In either case, the
127       'Autoprobe' button will tell you the  most  capable  protocol  a  given
128       mailserver  supports,  and  warn  you  of  potential problems with that
129       server.
130
131

GENERAL OPERATION

133       The behavior of fetchmail is controlled by command-line options  and  a
134       run  control file, ~/.fetchmailrc, the syntax of which we describe in a
135       later section (this file is  what  the  fetchmailconf  program  edits).
136       Command-line options override ~/.fetchmailrc declarations.
137
138       Each  server name that you specify following the options on the command
139       line will be queried.  If you do not specify any servers on the command
140       line,  each  'poll'  entry in your ~/.fetchmailrc file will be queried,
141       unless the idle option is used, which see.
142
143       To facilitate the use of fetchmail in scripts and pipelines, it returns
144       an appropriate exit code upon termination -- see EXIT CODES below.
145
146       The  following  options modify the behavior of fetchmail.  It is seldom
147       necessary to specify any of these once you have a working  .fetchmailrc
148       file set up.
149
150       Almost  all  options  have a corresponding keyword which can be used to
151       declare them in a .fetchmailrc file.
152
153       Some special options are not covered here, but are  documented  instead
154       in sections on AUTHENTICATION and DAEMON MODE which follow.
155
156   General Options
157       -? | --help
158              Displays option help.
159
160       -V | --version
161              Displays the version information for your copy of fetchmail.  No
162              mail fetch is performed.  Instead, for  each  server  specified,
163              all  the  option information that would be computed if fetchmail
164              were connecting to that server is displayed.  Any non-printables
165              in  passwords  or other string names are shown as backslashed C-
166              like escape sequences.  This option is useful for verifying that
167              your options are set the way you want them.
168
169       -c | --check
170              Return  a status code to indicate whether there is mail waiting,
171              without actually fetching  or  deleting  mail  (see  EXIT  CODES
172              below).  This option turns off daemon mode (in which it would be
173              useless).  It doesn't play well with queries to multiple  sites,
174              and doesn't work with ETRN or ODMR.  It will return a false pos‐
175              itive if you leave read but undeleted mail in your server  mail‐
176              box  and  your  fetch protocol can't tell kept messages from new
177              ones.  This means it will work with IMAP, not  work  with  POP2,
178              and may occasionally flake out under POP3.
179
180       -s | --silent
181              Silent  mode.   Suppresses all progress/status messages that are
182              normally echoed to standard output during a fetch (but does  not
183              suppress actual error messages).  The --verbose option overrides
184              this.
185
186       -v | --verbose
187              Verbose mode.  All control messages passed between fetchmail and
188              the  mailserver are echoed to stdout.  Overrides --silent.  Dou‐
189              bling this option (-v -v) causes extra diagnostic information to
190              be printed.
191
192       --nosoftbounce
193              (since v6.3.10, Keyword: set no softbounce, since v6.3.10)
194              Hard  bounce  mode. All permanent delivery errors cause messages
195              to be deleted from the  upstream  server,  see  "no  softbounce"
196              below.
197
198       --softbounce
199              (since v6.3.10, Keyword: set softbounce, since v6.3.10)
200              Soft  bounce  mode. All permanent delivery errors cause messages
201              to be left on the upstream server if the protocol supports that.
202              This  option  is on by default to match historic fetchmail docu‐
203              mentation, and will be changed to hard bounce mode in  the  next
204              fetchmail release.
205
206   Disposal Options
207       -a | --all | (since v6.3.3) --fetchall
208              (Keyword: fetchall, since v3.0)
209              Retrieve  both  old (seen) and new messages from the mailserver.
210              The default is to fetch only messages the server has not  marked
211              seen.   Under  POP3,  this  option  also  forces the use of RETR
212              rather than TOP.  Note that POP2  retrieval  behaves  as  though
213              --all  is always on (see RETRIEVAL FAILURE MODES below) and this
214              option does not work with ETRN or ODMR.  While the -a and  --all
215              command-line and fetchall rcfile options have been supported for
216              a long time, the --fetchall command-line  option  was  added  in
217              v6.3.3.
218
219       -k | --keep
220              (Keyword: keep)
221              Keep  retrieved  messages  on  the remote mailserver.  Normally,
222              messages are deleted from the folder  on  the  mailserver  after
223              they  have  been  retrieved.   Specifying the keep option causes
224              retrieved messages to remain in your folder on  the  mailserver.
225              This  option does not work with ETRN or ODMR. If used with POP3,
226              it is recommended to also specify the --uidl option or uidl key‐
227              word.
228
229       -K | --nokeep
230              (Keyword: nokeep)
231              Delete  retrieved  messages  from  the  remote mailserver.  This
232              option forces retrieved mail to be deleted.  It may be useful if
233              you have specified a default of keep in your .fetchmailrc.  This
234              option is forced on with ETRN and ODMR.
235
236       -F | --flush
237              (Keyword: flush)
238              POP3/IMAP only.  This is a dangerous option and can  cause  mail
239              loss  when  used improperly. It deletes old (seen) messages from
240              the mailserver before retrieving new  messages.   Warning:  This
241              can  cause  mail  loss if you check your mail with other clients
242              than fetchmail, and cause fetchmail to delete a message  it  had
243              never  fetched  before.  It can also cause mail loss if the mail
244              server marks the message seen after retrieval  (IMAP2  servers).
245              You  should  probably  not use this option in your configuration
246              file. If you use it with POP3, you must use the  'uidl'  option.
247              What  you  probably  want  is  the default setting: if you don't
248              specify '-k', then fetchmail will automatically delete  messages
249              after successful delivery.
250
251       --limitflush
252              POP3/IMAP  only, since version 6.3.0.  Delete oversized messages
253              from the mailserver before retrieving  new  messages.  The  size
254              limit  should  be  separately specified with the --limit option.
255              This option does not work with ETRN or ODMR.
256
257   Protocol and Query Options
258       -p <proto> | --proto <proto> | --protocol <proto>
259              (Keyword: proto[col])
260              Specify the protocol to use when communicating with  the  remote
261              mailserver.   If  no protocol is specified, the default is AUTO.
262              proto may be one of the following:
263
264              AUTO   Tries IMAP, POP3, and POP2 (skipping  any  of  these  for
265                     which support has not been compiled in).
266
267              POP2   Post Office Protocol 2 (legacy, to be removed from future
268                     release)
269
270              POP3   Post Office Protocol 3
271
272              APOP   Use POP3 with old-fashioned MD5-challenge authentication.
273                     Considered not resistant to man-in-the-middle attacks.
274
275              RPOP   Use POP3 with RPOP authentication.
276
277              KPOP   Use POP3 with Kerberos V4 authentication on port 1109.
278
279              SDPS   Use POP3 with Demon Internet's SDPS extensions.
280
281              IMAP   IMAP2bis,  IMAP4,  or  IMAP4rev1 (fetchmail automatically
282                     detects their capabilities).
283
284              ETRN   Use the ESMTP ETRN option.
285
286              ODMR   Use the the On-Demand Mail Relay ESMTP profile.
287
288       All these alternatives work in basically the  same  way  (communicating
289       with standard server daemons to fetch mail already delivered to a mail‐
290       box on the server) except ETRN and ODMR.  The ETRN mode allows  you  to
291       ask  a compliant ESMTP server (such as BSD sendmail at release 8.8.0 or
292       higher) to immediately open a sender-SMTP  connection  to  your  client
293       machine and begin forwarding any items addressed to your client machine
294       in the server's queue of undelivered mail.   The ODMR mode requires  an
295       ODMR-capable  server  and  works similarly to ETRN, except that it does
296       not require the client machine to have a static DNS.
297
298       -U | --uidl
299              (Keyword: uidl)
300              Force UIDL use (effective only with  POP3).   Force  client-side
301              tracking  of  'newness'  of messages (UIDL stands for "unique ID
302              listing" and is described in RFC1939).  Use with 'keep' to use a
303              mailbox  as a baby news drop for a group of users. The fact that
304              seen messages are skipped is logged,  unless  error  logging  is
305              done  through  syslog  while  running in daemon mode.  Note that
306              fetchmail may automatically  enable  this  option  depending  on
307              upstream server capabilities.  Note also that this option may be
308              removed and forced enabled in a future  fetchmail  version.  See
309              also: --idfile.
310
311       --idle (since 6.3.3)
312              (Keyword: idle, since before 6.0.0)
313              Enable IDLE use (effective only with IMAP). Note that this works
314              with only one account and one folder  at  a  given  time,  other
315              folders  or  accounts will not be polled when idle is in effect!
316              While the idle rcfile keyword had  been  supported  for  a  long
317              time, the --idle command-line option was added in version 6.3.3.
318              IDLE use means that fetchmail tells  the  IMAP  server  to  send
319              notice  of  new  messages,  so they can be retrieved sooner than
320              would be possible with regular polls.
321
322       -P <portnumber> | --service <servicename>
323              (Keyword: service) Since version 6.3.0.
324              The service option permits you to specify a service name to con‐
325              nect  to.   You  can specify a decimal port number here, if your
326              services database lacks the required  service-port  assignments.
327              See  the  FAQ  item R12 and the --ssl documentation for details.
328              This replaces the older --port option.
329
330       --port <portnumber>
331              (Keyword: port)
332              Obsolete version of --service that does not take service  names.
333              Note: this option may be removed from a future version.
334
335       --principal <principal>
336              (Keyword: principal)
337              The  principal option permits you to specify a service principal
338              for mutual authentication.  This is applicable to POP3  or  IMAP
339              with  Kerberos 4 authentication only.  It does not apply to Ker‐
340              beros 5 or GSSAPI.  This option  may  be  removed  in  a  future
341              fetchmail version.
342
343       -t <seconds> | --timeout <seconds>
344              (Keyword: timeout)
345              The  timeout option allows you to set a server-nonresponse time‐
346              out in seconds.  If a mailserver does not send a  greeting  mes‐
347              sage  or  respond  to  commands for the given number of seconds,
348              fetchmail will drop the connection to it.  Without such a  time‐
349              out  fetchmail  might  hang  until the TCP connection times out,
350              trying to fetch mail from a down host, which may be  very  long.
351              This  would  be particularly annoying for a fetchmail running in
352              the background.  There is a default timeout which  fetchmail  -V
353              will  report.   If a given connection receives too many timeouts
354              in succession, fetchmail will consider it wedged and stop retry‐
355              ing.   The  calling  user will be notified by email if this hap‐
356              pens.
357
358              Beginning with fetchmail 6.3.10, the SMTP client uses the recom‐
359              mended  minimum  timeouts  from  RFC-5321  while waiting for the
360              SMTP/LMTP server it is talking to.  You can raise  the  timeouts
361              even  more,  but  you  cannot  shorten  them. This is to avoid a
362              painful situation where fetchmail has  been  configured  with  a
363              short  timeout  (a  minute  or less), ships a long message (many
364              MBytes) to the local MTA, which then takes longer  than  timeout
365              to  respond  "OK", which it eventually will; that would mean the
366              mail gets delivered properly, but fetchmail cannot notice it and
367              will thus refetch this big message over and over again.
368
369       --plugin <command>
370              (Keyword: plugin)
371              The  plugin  option  allows  you  to  use an external program to
372              establish the TCP connection.  This is useful if you want to use
373              ssh,  or  need some special firewalling setup.  The program will
374              be looked up in $PATH and can optionally be passed the  hostname
375              and  port  as  arguments  using "%h" and "%p" respectively (note
376              that the interpolation logic  is  rather  primitive,  and  these
377              tokens  must  be bounded by whitespace or beginning of string or
378              end of string).  Fetchmail will write to the plugin's stdin  and
379              read from the plugin's stdout.
380
381       --plugout <command>
382              (Keyword: plugout)
383              Identical  to  the plugin option above, but this one is used for
384              the SMTP connections.
385
386       -r <name> | --folder <name>
387              (Keyword: folder[s])
388              Causes a specified non-default mail folder on the mailserver (or
389              comma-separated list of folders) to be retrieved.  The syntax of
390              the folder name is server-dependent.  This option is not  avail‐
391              able under POP3, ETRN, or ODMR.
392
393       --tracepolls
394              (Keyword: tracepolls)
395              Tell  fetchmail  to  poll trace information in the form 'polling
396              account %s' and 'folder %s' to the Received line  it  generates,
397              where  the  %s parts are replaced by the user's remote name, the
398              poll label,  and  the  folder  (mailbox)  where  available  (the
399              Received  header also normally includes the server's true name).
400              This can be used to  facilitate  mail  filtering  based  on  the
401              account  it  is  being  received from. The folder information is
402              written only since version 6.3.4.
403
404       --ssl  (Keyword: ssl)
405              Causes the connection to the mail server  to  be  encrypted  via
406              SSL,  by  negotiating SSL directly after connecting (SSL-wrapped
407              mode).  Please see the description of  --sslproto  below!   More
408              information  is available in the README.SSL file that ships with
409              fetchmail.
410
411              Note that even if this option is omitted,  fetchmail  may  still
412              negotiate  SSL  in-band  for  POP3  or IMAP, through the STLS or
413              STARTTLS feature.  You can use the --sslproto option  to  modify
414              that behavior.
415
416              If no port is specified, the connection is attempted to the well
417              known port of the SSL version of the  base  protocol.   This  is
418              generally a different port than the port used by the base proto‐
419              col.  For IMAP, this is port 143 for the clear protocol and port
420              993  for  the SSL secured protocol; for POP3, it is port 110 for
421              the clear text and port 995 for the encrypted variant.
422
423              If your system lacks the corresponding  entries  from  /etc/ser‐
424              vices,  see  the  --service  option and specify the numeric port
425              number as given in the previous paragraph (unless your  ISP  had
426              directed you to different ports, which is uncommon however).
427
428       --sslcert <name>
429              (Keyword: sslcert)
430              For certificate-based client authentication.  Some SSL encrypted
431              servers require client side keys and certificates for  authenti‐
432              cation.   In  most  cases, this is optional.  This specifies the
433              location of the public key certificate to be  presented  to  the
434              server  at  the  time the SSL session is established.  It is not
435              required (but may be provided) if the server  does  not  require
436              it.   It  may  be the same file as the private key (combined key
437              and certificate file) but this  is  not  recommended.  Also  see
438              --sslkey below.
439
440              NOTE: If you use client authentication, the user name is fetched
441              from the certificate's CommonName and  overrides  the  name  set
442              with --user.
443
444       --sslkey <name>
445              (Keyword: sslkey)
446              Specifies  the  file  name  of  the client side private SSL key.
447              Some SSL encrypted servers require client side keys and certifi‐
448              cates  for  authentication.   In  most  cases, this is optional.
449              This specifies the location of the  private  key  used  to  sign
450              transactions  with  the  server  at  the time the SSL session is
451              established.  It is not required (but may be  provided)  if  the
452              server  does not require it. It may be the same file as the pub‐
453              lic key (combined key and certificate file) but this is not rec‐
454              ommended.
455
456              If a password is required to unlock the key, it will be prompted
457              for at the time just prior to establishing the  session  to  the
458              server.  This can cause some complications in daemon mode.
459
460              Also see --sslcert above.
461
462       --sslproto <value>
463              (Keyword: sslproto, NOTE: semantic changes since v6.4.0)
464              This option has a dual use, out of historic fetchmail behaviour.
465              It controls both the SSL/TLS protocol version and, if  --ssl  is
466              not specified, the STARTTLS behaviour (upgrading the protocol to
467              an SSL or TLS connection in-band). Some other options  may  how‐
468              ever make TLS mandatory.
469
470       Only  if  this option and --ssl are both missing for a poll, there will
471       be opportunistic TLS for POP3 and IMAP, where fetchmail will attempt to
472       upgrade to TLSv1 or newer.
473
474       Recognized  values  for --sslproto are given below. You should normally
475       chose one of the auto-negotiating options, i. e. 'auto' or one  of  the
476       options  ending in a plus (+) character. Note that depending on OpenSSL
477       library version and configuration, some options cause  run-time  errors
478       because the requested SSL or TLS versions are not supported by the par‐
479       ticular installed OpenSSL library.
480
481              '', the empty string
482                     Disable STARTTLS. If --ssl is given for the same  server,
483                     log  an  error  and  pretend  that  'auto'  had been used
484                     instead.
485
486              'auto' (default).  Since  v6.4.0.  Require  TLS.  Auto-negotiate
487                     TLSv1  or  newer,  disable  SSLv3  downgrade.  (fetchmail
488                     6.3.26 and older have auto-negotiated all protocols  that
489                     their  OpenSSL  library  supported,  including the broken
490                     SSLv3).
491
492              'SSL23'
493                     see 'auto'.
494
495              'SSL3' Require SSLv3 exactly. SSLv3 is broken, not supported  on
496                     all systems, avoid it if possible.  This will make fetch‐
497                     mail negotiate SSLv3 only, and is the  only  way  besides
498                     'SSL3+' to have fetchmail 6.4.0 or newer permit SSLv3.
499
500              'SSL3+'
501                     same  as  'auto',  but  permit SSLv3 as well. This is the
502                     only way besides 'SSL3' to have fetchmail 6.4.0 or  newer
503                     permit SSLv3.
504
505              'TLS1' Require  TLSv1. This does not negotiate TLSv1.1 or newer,
506                     and is discouraged. Replace by TLS1+  unless  the  latter
507                     chokes your server.
508
509              'TLS1+'
510                     Since v6.4.0. See 'auto'.
511
512              'TLS1.1'
513                     Since v6.4.0. Require TLS v1.1 exactly.
514
515              'TLS1.1+'
516                     Since  v6.4.0.  Require  TLS.  Auto-negotiate  TLSv1.1 or
517                     newer.
518
519              'TLS1.2'
520                     Since v6.4.0. Require TLS v1.2 exactly.
521
522              'TLS1.2+'
523                     Since v6.4.0.  Require  TLS.  Auto-negotiate  TLSv1.2  or
524                     newer.
525
526              Unrecognized parameters
527                     are treated the same as 'auto'.
528
529              NOTE:  you should hardly ever need to use anything other than ''
530              (to force an unencrypted connection) or 'auto' (to enforce TLS).
531
532       --sslcertck
533              (Keyword: sslcertck, default enabled since v6.4.0)
534              --sslcertck causes fetchmail to require that SSL/TLS be used and
535              disconnect  if  it can not successfully negotiate SSL or TLS, or
536              if it cannot successfully verify and  validate  the  certificate
537              and  follow  it to a trust anchor (or trusted root certificate).
538              The trust anchors are given as a set of local  trusted  certifi‐
539              cates  (see  the  sslcertfile  and  sslcertpath options). If the
540              server certificate cannot be obtained or is not signed by one of
541              the  trusted  ones (directly or indirectly), fetchmail will dis‐
542              connect, regardless of the sslfingerprint option.
543
544              Note that CRL (certificate revocation lists) are only  supported
545              in  OpenSSL  0.9.7  and  newer! Your system clock should also be
546              reasonably accurate when using this option.
547
548              Note that this optional behavior may become default behavior  in
549              future fetchmail versions.
550
551       --nosslcertck
552              (Keyword: no sslcertck, only in v6.4.X)
553              The  opposite  of  --sslcertck,  this is a disouraged option. It
554              permits fetchmail to continue connecting even if the server cer‐
555              tificate  failed  the  verification checks.  Should only be used
556              together with --sslfingerprint.
557
558       --sslcertfile <file>
559              (Keyword: sslcertfile, since v6.3.17)
560              Sets the file fetchmail uses to look up local certificates.  The
561              default  is  empty.  This can be given in addition to --sslcert‐
562              path below, and certificates specified in --sslcertfile will  be
563              processed before those in --sslcertpath.  The option can be used
564              in addition to --sslcertpath.
565
566              The file is a  text  file.  It  contains  the  concatenation  of
567              trusted CA certificates in PEM format.
568
569              Note  that  using  this option will suppress loading the default
570              SSL trusted CA certificates file unless you set the  environment
571              variable  FETCHMAIL_INCLUDE_DEFAULT_X509_CA_CERTS to a non-empty
572              value.
573
574       --sslcertpath <directory>
575              (Keyword: sslcertpath)
576              Sets the directory fetchmail uses to look up local certificates.
577              The  default  is  your  OpenSSL default directory. The directory
578              must be hashed the way OpenSSL expects it - every time  you  add
579              or  modify  a  certificate in the directory, you need to use the
580              c_rehash tool (which comes with OpenSSL in the tools/  subdirec‐
581              tory).  Also,  after  OpenSSL  upgrades,  you  may  need  to run
582              c_rehash; particularly when upgrading from 0.9.X to 1.0.0.
583
584              This can be given in addition to --sslcertfile above, which  see
585              for precedence rules.
586
587              Note that using this option will suppress adding the default SSL
588              trusted CA certificates directory unless you set the environment
589              variable  FETCHMAIL_INCLUDE_DEFAULT_X509_CA_CERTS to a non-empty
590              value.
591
592       --sslcommonname <common name>
593              (Keyword: sslcommonname; since v6.3.9)
594              Use of this option is discouraged. Before using it, contact  the
595              administrator  of  your upstream server and ask for a proper SSL
596              certificate to be used. If that cannot be attained, this  option
597              can  be  used  to  specify  the name (CommonName) that fetchmail
598              expects on  the  server  certificate.   A  correctly  configured
599              server  will  have  this  set  to  the  hostname  by which it is
600              reached, and by default fetchmail will expect as much. Use  this
601              option  when the CommonName is set to some other value, to avoid
602              the "Server  CommonName  mismatch"  warning,  and  only  if  the
603              upstream server can't be made to use proper certificates.
604
605       --sslfingerprint <fingerprint>
606              (Keyword: sslfingerprint)
607              Specify  the  fingerprint  of the server key (an MD5 hash of the
608              key) in hexadecimal notation with colons  separating  groups  of
609              two digits. The letter hex digits must be in upper case. This is
610              the format that fetchmail uses to report the fingerprint when an
611              SSL connection is established. When this is specified, fetchmail
612              will compare the server key fingerprint with the given one,  and
613              the connection will fail if they do not match, regardless of the
614              sslcertck setting. The connection will also  fail  if  fetchmail
615              cannot  obtain  an SSL certificate from the server.  This can be
616              used to prevent man-in-the-middle attacks, but the finger  print
617              from the server must be obtained or verified over a secure chan‐
618              nel, and certainly not over the same  Internet  connection  that
619              fetchmail would use.
620
621              Using this option will prevent printing certificate verification
622              errors as long as --nosslcertck is in effect.
623
624              To obtain the fingerprint of a certificate stored  in  the  file
625              cert.pem, try:
626
627                   openssl x509 -in cert.pem -noout -md5 -fingerprint
628
629              For details, see x509(1ssl).
630
631   Delivery Control Options
632       -S <hosts> | --smtphost <hosts>
633              (Keyword: smtp[host])
634              Specify  a  hunt  list  of hosts to forward mail to (one or more
635              hostnames, comma-separated). Hosts are tried in list order;  the
636              first  one that is up becomes the forwarding target for the cur‐
637              rent run.  If this option is not specified, 'localhost' is  used
638              as  the default.  Each hostname may have a port number following
639              the host name.  The port number is separated from the host  name
640              by a slash; the default port is "smtp".  If you specify an abso‐
641              lute path name (beginning with a /), it will be  interpreted  as
642              the name of a UNIX socket accepting LMTP connections (such as is
643              supported by the Cyrus IMAP daemon) Example:
644
645                   --smtphost server1,server2/2525,server3,/var/imap/socket/lmtp
646
647              This option can be used with ODMR, and  will  make  fetchmail  a
648              relay between the ODMR server and SMTP or LMTP receiver.
649
650              WARNING:  if  you use address numeric IP addresses here, be sure
651              to use --smtpaddress or --smtpname (either of which see) with  a
652              valid SMTP address literal!
653
654       --fetchdomains <hosts>
655              (Keyword: fetchdomains)
656              In  ETRN or ODMR mode, this option specifies the list of domains
657              the server should ship mail for once the  connection  is  turned
658              around.   The  default is the FQDN of the machine running fetch‐
659              mail.
660
661       -D <domain> | --smtpaddress <domain>
662              (Keyword: smtpaddress)
663              Specify the domain to be appended to addresses in RCPT TO  lines
664              shipped  to  SMTP.  When  this is not specified, the name of the
665              SMTP server (as specified by --smtphost) is used  for  SMTP/LMTP
666              and 'localhost' is used for UNIX socket/BSMTP.
667
668              NOTE:  if  you  intend  to  use  numeric addresses, or so-called
669              address literals per the SMTP standard,  write  them  in  proper
670              SMTP  syntax, for instance --smtpaddress "[192.0.2.6]" or --smt‐
671              paddress "[IPv6:2001:DB8::6]".
672
673       --smtpname <user@domain>
674              (Keyword: smtpname)
675              Specify the domain and user to be put in RCPT TO  lines  shipped
676              to  SMTP.   The  default  user is the current local user. Please
677              also see the  NOTE  about  --smtpaddress  and  address  literals
678              above.
679
680       -Z <nnn> | --antispam <nnn[, nnn]...>
681              (Keyword: antispam)
682              Specifies  the list of numeric SMTP errors that are to be inter‐
683              preted as a spam-block response from the listener.  A  value  of
684              -1  disables this option.  For the command-line option, the list
685              values should be comma-separated.  Note that the antispam values
686              only  apply  to "MAIL FROM" responses in the SMTP/LMTP dialogue,
687              but several MTAs (Postfix in its default  configuration,  qmail)
688              defer  the  anti-spam  response  code  until  after the RCPT TO.
689              --antispam does not  work  in  these  circumstances.   Also  see
690              --softbounce (default) and its inverse.
691
692       -m <command> | --mda <command>
693              (Keyword: mda)
694              This option lets fetchmail use a Message or Local Delivery Agent
695              (MDA or LDA) directly, rather than forward via SMTP or LMTP.
696
697              To avoid losing mail, use this option only with MDAs like  mail‐
698              drop  or  MTAs  like sendmail that exit with a nonzero status on
699              disk-full and other delivery errors; the  nonzero  status  tells
700              fetchmail  that  delivery  failed  and prevents the message from
701              being deleted on the server.
702
703              If fetchmail is running as root,  it  sets  its  user  id  while
704              delivering  mail  through  an MDA as follows:  First, the FETCH‐
705              MAILUSER, LOGNAME, and USER environment variables are checked in
706              this  order.  The value of the first variable from his list that
707              is defined (even if it is empty!) is looked  up  in  the  system
708              user  database.  If  none of the variables is defined, fetchmail
709              will use the real user id it was started with.  If  one  of  the
710              variables  was  defined,  but the user stated there isn't found,
711              fetchmail continues running as root, without checking  remaining
712              variables  on the list.  Practically, this means that if you run
713              fetchmail as root (not recommended), it is most useful to define
714              the  FETCHMAILUSER environment variable to set the user that the
715              MDA should run as. Some MDAs (such as maildrop) are designed  to
716              be  setuid  root  and  setuid to the recipient's user id, so you
717              don't lose functionality this way even when running fetchmail as
718              unprivileged user.  Check the MDA's manual for details.
719
720              Some  possible  MDAs  are  "/usr/sbin/sendmail  -i  -f %F -- %T"
721              (Note: some several older or vendor sendmail versions mistake --
722              for  an address, rather than an indicator to mark the end of the
723              option arguments), "/usr/bin/deliver" and "/usr/bin/maildrop  -d
724              %T".   Local  delivery  addresses  will be inserted into the MDA
725              command wherever you place a %T; the mail message's From address
726              will be inserted where you place an %F.
727
728              Do  NOT  enclose the %F or %T string in single quotes!  For both
729              %T and %F, fetchmail encloses the  addresses  in  single  quotes
730              ('),  after  removing any single quotes they may contain, before
731              the MDA command is passed to the shell.
732
733              Do NOT use an MDA invocation that dispatches on the contents  of
734              To/Cc/Bcc, like "sendmail -i -t" or "qmail-inject", it will cre‐
735              ate mail loops and bring the just wrath of many postmasters down
736              upon  your head.  This is one of the most frequent configuration
737              errors!
738
739              Also, do not try to combine multidrop mode with an MDA  such  as
740              maildrop  that can only accept one address, unless your upstream
741              stores one copy of the message per recipient and transports  the
742              envelope recipient in a header; you will lose mail.
743
744              The  well-known  procmail(1)  package  is very hard to configure
745              properly, it has a very nasty "fall through to  the  next  rule"
746              behavior on delivery errors (even temporary ones, such as out of
747              disk space if another user's  mail  daemon  copies  the  mailbox
748              around  to  purge old messages), so your mail will end up in the
749              wrong mailbox sooner or later. The proper procmail configuration
750              is outside the scope of this document. Using maildrop(1) is usu‐
751              ally much easier, and many users find the filter syntax used  by
752              maildrop easier to understand.
753
754              Finally,  we  strongly  advise that you do not use qmail-inject.
755              The command line interface  is  non-standard  without  providing
756              benefits  for  typical  use,  and fetchmail makes no attempts to
757              accommodate qmail-inject's deviations from the standard. Some of
758              qmail-inject's command-line and environment options are actually
759              dangerous and can cause broken threads,  non-detected  duplicate
760              messages and forwarding loops.
761
762
763       --lmtp (Keyword: lmtp)
764              Cause  delivery via LMTP (Local Mail Transfer Protocol).  A ser‐
765              vice host and port must be explicitly specified on each host  in
766              the  smtphost  hunt list (see above) if this option is selected;
767              the default port 25 will (in accordance with RFC  2033)  not  be
768              accepted.
769
770       --bsmtp <filename>
771              (Keyword: bsmtp)
772              Append  fetched  mail to a BSMTP file.  This simply contains the
773              SMTP commands that would normally be generated by fetchmail when
774              passing mail to an SMTP listener daemon.
775
776              An  argument of '-' causes the SMTP batch to be written to stan‐
777              dard output, which is of limited use: this only makes sense  for
778              debugging, because fetchmail's regular output is interspersed on
779              the same channel, so this isn't suitable for mail delivery. This
780              special mode may be removed in a later release.
781
782              Note  that  fetchmail's  reconstruction of MAIL FROM and RCPT TO
783              lines is not guaranteed correct; the caveats discussed under THE
784              USE AND ABUSE OF MULTIDROP MAILBOXES below apply.  This mode has
785              precedence before --mda and SMTP/LMTP.
786
787       --bad-header {reject|accept}
788              (Keyword: bad-header; since v6.3.15)
789              Specify how fetchmail is supposed to  treat  messages  with  bad
790              headers, i. e. headers with bad syntax. Traditionally, fetchmail
791              has rejected  such  messages,  but  some  distributors  modified
792              fetchmail  to accept them. You can now configure fetchmail's be‐
793              haviour per server.
794
795
796   Resource Limit Control Options
797       -l <maxbytes> | --limit <maxbytes>
798              (Keyword: limit)
799              Takes a maximum octet size argument, where 0 is the default  and
800              also the special value designating "no limit".  If nonzero, mes‐
801              sages larger than this size will not be fetched and will be left
802              on  the  server  (in  foreground sessions, the progress messages
803              will note that they are "oversized").   If  the  fetch  protocol
804              permits  (in particular, under IMAP or POP3 without the fetchall
805              option) the message will not be marked seen.
806
807              An explicit --limit of 0 overrides any limits set  in  your  run
808              control  file.  This  option  is  intended  for those needing to
809              strictly control fetch time due to expensive and variable  phone
810              rates.
811
812              Combined  with  --limitflush, it can be used to delete oversized
813              messages waiting on a server.  In daemon mode, oversize  notifi‐
814              cations  are  mailed  to  the  calling  user (see the --warnings
815              option). This option does not work with ETRN or ODMR.
816
817       -w <interval> | --warnings <interval>
818              (Keyword: warnings)
819              Takes an interval in seconds.  When you call  fetchmail  with  a
820              'limit'  option  in  daemon  mode, this controls the interval at
821              which warnings about oversized messages are mailed to the  call‐
822              ing  user  (or  the  user specified by the 'postmaster' option).
823              One such notification is always mailed at the  end  of  the  the
824              first  poll that the oversized message is detected.  Thereafter,
825              re-notification is suppressed until after the  warning  interval
826              elapses  (it  will  take place at the end of the first following
827              poll).
828
829       -b <count> | --batchlimit <count>
830              (Keyword: batchlimit)
831              Specify the maximum number of messages that will be  shipped  to
832              an SMTP listener before the connection is deliberately torn down
833              and rebuilt (defaults to 0,  meaning  no  limit).   An  explicit
834              --batchlimit  of  0 overrides any limits set in your run control
835              file.  While sendmail(8) normally initiates delivery of  a  mes‐
836              sage  immediately  after  receiving the message terminator, some
837              SMTP listeners are not so prompt.  MTAs like smail(8)  may  wait
838              till the delivery socket is shut down to deliver.  This may pro‐
839              duce annoying delays when fetchmail  is  processing  very  large
840              batches.  Setting the batch limit to some nonzero size will pre‐
841              vent these delays.  This option does not work with ETRN or ODMR.
842
843       -B <number> | --fetchlimit <number>
844              (Keyword: fetchlimit)
845              Limit the number of messages accepted from a given server  in  a
846              single poll.  By default there is no limit. An explicit --fetch‐
847              limit of 0 overrides any limits set in your  run  control  file.
848              This option does not work with ETRN or ODMR.
849
850       --fetchsizelimit <number>
851              (Keyword: fetchsizelimit)
852              Limit  the  number  of  sizes  of messages accepted from a given
853              server in a single transaction.  This option is useful in reduc‐
854              ing  the  delay in downloading the first mail when there are too
855              many mails in the mailbox.  By default, the limit  is  100.   If
856              set  to  0,  sizes  of all messages are downloaded at the start.
857              This option does not work with ETRN or ODMR.  For POP3, the only
858              valid non-zero value is 1.
859
860       --fastuidl <number>
861              (Keyword: fastuidl)
862              Do  a  binary instead of linear search for the first unseen UID.
863              Binary search avoids downloading the UIDs  of  all  mails.  This
864              saves  time  (especially  in  daemon mode) where downloading the
865              same set of UIDs in each poll is a waste of bandwidth. The  num‐
866              ber  'n' indicates how rarely a linear search should be done. In
867              daemon mode, linear search  is  used  once  followed  by  binary
868              searches  in 'n-1' polls if 'n' is greater than 1; binary search
869              is always used if 'n' is 1; linear search is always used if  'n'
870              is  0.  In  non-daemon  mode, binary search is used if 'n' is 1;
871              otherwise linear search is used. The default value of 'n' is  4.
872              This option works with POP3 only.
873
874       -e <count> | --expunge <count>
875              (Keyword: expunge)
876              Arrange  for  deletions to be made final after a given number of
877              messages.  Under POP2 or POP3, fetchmail cannot  make  deletions
878              final  without  sending QUIT and ending the session -- with this
879              option on, fetchmail will break a long  mail  retrieval  session
880              into multiple sub-sessions, sending QUIT after each sub-session.
881              This is a good defense  against  line  drops  on  POP3  servers.
882              Under  IMAP,  fetchmail normally issues an EXPUNGE command after
883              each deletion in order to force the deletion to be done  immedi‐
884              ately.   This  is  safest  when your connection to the server is
885              flaky and expensive, as it avoids resending duplicate mail after
886              a  line  hit.   However,  on large mailboxes the overhead of re-
887              indexing after every message can slam the server pretty hard, so
888              if  your  connection  is reliable it is good to do expunges less
889              frequently.  Also note that some servers enforce a  delay  of  a
890              few seconds after each quit, so fetchmail may not be able to get
891              back in immediately after an expunge -- you may see "lock  busy"
892              errors if this happens. If you specify this option to an integer
893              N, it tells fetchmail  to  only  issue  expunges  on  every  Nth
894              delete.  An argument of zero suppresses expunges entirely (so no
895              expunges at all will be done until the end of run).  This option
896              does not work with ETRN or ODMR.
897
898
899   Authentication Options
900       -u <name> | --user <name> | --username <name>
901              (Keyword: user[name])
902              Specifies  the user identification to be used when logging in to
903              the mailserver.  The appropriate  user  identification  is  both
904              server  and  user-dependent.   The default is your login name on
905              the client machine that is running fetchmail.  See USER  AUTHEN‐
906              TICATION below for a complete description.
907
908       -I <specification> | --interface <specification>
909              (Keyword: interface)
910              Require  that  a specific interface device be up and have a spe‐
911              cific local or remote IPv4 (IPv6 is not supported by this option
912              yet) address (or range) before polling.  Frequently fetchmail is
913              used over a transient  point-to-point  TCP/IP  link  established
914              directly  to a mailserver via SLIP or PPP.  That is a relatively
915              secure channel.  But when other TCP/IP routes to the  mailserver
916              exist  (e.g.  when  the  link is connected to an alternate ISP),
917              your username and password may be vulnerable to snooping  (espe‐
918              cially when daemon mode automatically polls for mail, shipping a
919              clear password over the  net  at  predictable  intervals).   The
920              --interface option may be used to prevent this.  When the speci‐
921              fied link is not up  or  is  not  connected  to  a  matching  IP
922              address, polling will be skipped.  The format is:
923
924                   interface/iii.iii.iii.iii[/mmm.mmm.mmm.mmm]
925
926              The  field  before  the  first slash is the interface name (i.e.
927              sl0, ppp0 etc.).  The field  before  the  second  slash  is  the
928              acceptable  IP  address.   The field after the second slash is a
929              mask which specifies a range of IP addresses to accept.   If  no
930              mask  is  present  255.255.255.255  is  assumed  (i.e.  an exact
931              match).  This option is currently only supported under Linux and
932              FreeBSD.  Please  see  the monitor section for below for FreeBSD
933              specific information.
934
935              Note that this option may be removed  from  a  future  fetchmail
936              version.
937
938       -M <interface> | --monitor <interface>
939              (Keyword: monitor)
940              Daemon  mode  can  cause transient links which are automatically
941              taken down after a period of  inactivity  (e.g.  PPP  links)  to
942              remain  up indefinitely.  This option identifies a system TCP/IP
943              interface to be monitored for activity.  After each poll  inter‐
944              val, if the link is up but no other activity has occurred on the
945              link, then the poll will be skipped.  However, when fetchmail is
946              woken  up by a signal, the monitor check is skipped and the poll
947              goes through unconditionally.  This  option  is  currently  only
948              supported  under  Linux and FreeBSD.  For the monitor and inter‐
949              face options to work for  non  root  users  under  FreeBSD,  the
950              fetchmail  binary  must be installed SGID kmem.  This would be a
951              security hole, but fetchmail runs with the effective GID set  to
952              that  of  the  kmem group only when interface data is being col‐
953              lected.
954
955              Note that this option may be removed  from  a  future  fetchmail
956              version.
957
958       --auth <type>
959              (Keyword: auth[enticate])
960              This  option  permits you to specify an authentication type (see
961              USER AUTHENTICATION below for details).  The possible values are
962              any,  password,  kerberos_v5,  kerberos  (or,  for  excruciating
963              exactness, kerberos_v4), gssapi, cram-md5, otp, ntlm, msn  (only
964              for POP3), external (only IMAP) and ssh.  When any (the default)
965              is specified, fetchmail tries first methods that don't require a
966              password  (EXTERNAL,  GSSAPI,  KERBEROS IV, KERBEROS 5); then it
967              looks for methods that mask your password (CRAM-MD5, NTLM, X-OTP
968              - note that MSN is only supported for POP3, but not autoprobed);
969              and only if the server doesn't support any of those will it ship
970              your password en clair.  Other values may be used to force vari‐
971              ous authentication methods (ssh suppresses authentication and is
972              thus useful for IMAP PREAUTH).  (external suppresses authentica‐
973              tion and is thus useful for IMAP  EXTERNAL).   Any  value  other
974              than password, cram-md5, ntlm, msn or otp suppresses fetchmail's
975              normal inquiry for a password.  Specify ssh when you  are  using
976              an  end-to-end  secure connection such as an ssh tunnel; specify
977              external when you use TLS with client authentication and specify
978              gssapi  or  kerberos_v4 if you are using a protocol variant that
979              employs GSSAPI or  K4.   Choosing  KPOP  protocol  automatically
980              selects Kerberos authentication.  This option does not work with
981              ETRN.  GSSAPI service names are in line with RFC-2743  and  IANA
982              registrations, see Generic Security Service Application Program
983              Interface (GSSAPI)/Kerberos/Simple Authentication and Security
984              Layer (SASL) Service Names ⟨http://www.iana.org/assignments/
985              gssapi-service-names/⟩.
986
987   Miscellaneous Options
988       -f <pathname> | --fetchmailrc <pathname>
989              Specify a non-default name for the  ~/.fetchmailrc  run  control
990              file.   The pathname argument must be either "-" (a single dash,
991              meaning to read the configuration  from  standard  input)  or  a
992              filename.   Unless the --version option is also on, a named file
993              argument  must  have  permissions  no  more   open   than   0700
994              (u=rwx,g=,o=) or else be /dev/null.
995
996       -i <pathname> | --idfile <pathname>
997              (Keyword: idfile)
998              Specify  an  alternate  name for the .fetchids file used to save
999              message UIDs. NOTE: since fetchmail 6.3.0, write access  to  the
1000              directory containing the idfile is required, as fetchmail writes
1001              a temporary file and renames it  into  the  place  of  the  real
1002              idfile only if the temporary file has been written successfully.
1003              This avoids the truncation of idfiles when running out  of  disk
1004              space.
1005
1006       --pidfile <pathname>
1007              (Keyword: pidfile; since fetchmail v6.3.4)
1008              Override  the  default  location  of  the PID file. Default: see
1009              "ENVIRONMENT" below.
1010
1011       -n | --norewrite
1012              (Keyword: no rewrite)
1013              Normally, fetchmail edits RFC-822 address headers (To, From, Cc,
1014              Bcc, and Reply-To) in fetched mail so that any mail IDs local to
1015              the server are expanded to full addresses (@ and the  mailserver
1016              hostname  are  appended).  This enables replies on the client to
1017              get addressed correctly (otherwise your mailer might think  they
1018              should  be  addressed  to  local  users on the client machine!).
1019              This option disables the rewrite.  (This option is  provided  to
1020              pacify  people  who  are  paranoid about having an MTA edit mail
1021              headers and want to know they can prevent it, but it  is  gener‐
1022              ally  not a good idea to actually turn off rewrite.)  When using
1023              ETRN or ODMR, the rewrite option is ineffective.
1024
1025       -E <line> | --envelope <line>
1026              (Keyword: envelope; Multidrop only)
1027              In the configuration file, an enhanced syntax is used:
1028              envelope [<count>] <line>
1029
1030              This option changes the header fetchmail assumes  will  carry  a
1031              copy  of the mail's envelope address.  Normally this is 'X-Enve‐
1032              lope-To'.  Other  typically  found  headers  to  carry  envelope
1033              information  are 'X-Original-To' and 'Delivered-To'.  Now, since
1034              these headers are not standardized,  practice  varies.  See  the
1035              discussion  of  multidrop  address handling below.  As a special
1036              case, 'envelope "Received"' enables  parsing  of  sendmail-style
1037              Received lines.  This is the default, but discouraged because it
1038              is not fully reliable.
1039
1040              Note that fetchmail expects the Received-line to be  in  a  spe‐
1041              cific  format: It must contain "by host for address", where host
1042              must match one of the mailserver names that fetchmail recognizes
1043              for the account in question.
1044
1045              The optional count argument (only available in the configuration
1046              file) determines how many header lines of this kind are skipped.
1047              A  count of 1 means: skip the first, take the second. A count of
1048              2 means: skip the first and second, take the third, and so on.
1049
1050       -Q <prefix> | --qvirtual <prefix>
1051              (Keyword: qvirtual; Multidrop only)
1052              The string prefix assigned to this option will be  removed  from
1053              the  user  name  found in the header specified with the envelope
1054              option (before  doing  multidrop  name  mapping  or  localdomain
1055              checking, if either is applicable). This option is useful if you
1056              are using fetchmail to collect the mail for an entire domain and
1057              your  ISP  (or  your  mail redirection provider) is using qmail.
1058              One of the basic features of qmail is the Delivered-To:  message
1059              header.  Whenever qmail delivers a message to a local mailbox it
1060              puts the username and hostname of the envelope recipient on this
1061              line.   The  major reason for this is to prevent mail loops.  To
1062              set up qmail to batch mail for a disconnected site the ISP-mail‐
1063              host will have normally put that site in its 'Virtualhosts' con‐
1064              trol file so it will add a prefix to all mail addresses for this
1065              site.  This  results  in  mail  sent to 'username@userhost.user‐
1066              dom.dom.com' having a Delivered-To: line of the form:
1067
1068              Delivered-To: mbox-userstr-username@userhost.example.com
1069
1070              The ISP can make the 'mbox-userstr-' prefix anything they choose
1071              but  a  string  matching the user host name is likely.  By using
1072              the option 'envelope Delivered-To:' you can make fetchmail reli‐
1073              ably  identify  the original envelope recipient, but you have to
1074              strip the 'mbox-userstr-' prefix to deliver to the correct user.
1075              This is what this option is for.
1076
1077       --configdump
1078              Parse   the  ~/.fetchmailrc  file,  interpret  any  command-line
1079              options specified, and dump a configuration report  to  standard
1080              output.  The configuration report is a data structure assignment
1081              in the language Python.  This option is meant to be used with an
1082              interactive ~/.fetchmailrc editor like fetchmailconf, written in
1083              Python.
1084
1085       -y | --yydebug
1086              Enables parser debugging, this option is meant  to  be  used  by
1087              developers only.
1088
1089
1090   Removed Options
1091       -T | --netsec
1092              Removed before version 6.3.0, the required underlying inet6_apps
1093              library had been discontinued and is no longer available.
1094
1095

USER AUTHENTICATION AND ENCRYPTION

1097       All modes except ETRN require  authentication  of  the  client  to  the
1098       server.   Normal user authentication in fetchmail is very much like the
1099       authentication mechanism of ftp(1).  The correct user-id  and  password
1100       depend upon the underlying security system at the mailserver.
1101
1102       If  the mailserver is a Unix machine on which you have an ordinary user
1103       account, your regular login name and password are used with  fetchmail.
1104       If  you  use  the  same  login  name  on both the server and the client
1105       machines, you needn't worry about specifying  a  user-id  with  the  -u
1106       option  -- the default behavior is to use your login name on the client
1107       machine as the user-id on the server machine.  If you use  a  different
1108       login  name  on the server machine, specify that login name with the -u
1109       option.  e.g. if your login name is 'jsmith' on a machine named  'mail‐
1110       grunt', you would start fetchmail as follows:
1111
1112              fetchmail -u jsmith mailgrunt
1113
1114       The  default behavior of fetchmail is to prompt you for your mailserver
1115       password before the connection is established.  This is the safest  way
1116       to  use  fetchmail  and  ensures that your password will not be compro‐
1117       mised.  You may also specify your password in your ~/.fetchmailrc file.
1118       This is convenient when using fetchmail in daemon mode or with scripts.
1119
1120
1121   Using netrc files
1122       If you do not specify a password, and fetchmail cannot extract one from
1123       your ~/.fetchmailrc file, it will look for a ~/.netrc file in your home
1124       directory before requesting one interactively; if an entry matching the
1125       mailserver is found in that file, the password will be used.  Fetchmail
1126       first looks for a match on poll name; if it finds none, it checks for a
1127       match on via name.  See the ftp(1) man page for details of  the  syntax
1128       of the ~/.netrc file.  To show a practical example, a .netrc might look
1129       like this:
1130
1131              machine hermes.example.org
1132              login joe
1133              password topsecret
1134
1135       You can repeat this block with different user information if  you  need
1136       to provide more than one password.
1137
1138       This feature may allow you to avoid duplicating password information in
1139       more than one file.
1140
1141       On mailservers that do not provide ordinary user accounts, your user-id
1142       and  password are usually assigned by the server administrator when you
1143       apply for a mailbox on the server.  Contact your  server  administrator
1144       if  you  don't  know  the correct user-id and password for your mailbox
1145       account.
1146

POP3 VARIANTS

1148       Early versions of POP3 (RFC1081, RFC1225) supported  a  crude  form  of
1149       independent  authentication  using  the  .rhosts file on the mailserver
1150       side.  Under this RPOP variant, a fixed per-user  ID  equivalent  to  a
1151       password  was  sent  in  clear over a link to a reserved port, with the
1152       command RPOP rather than PASS to alert the server  that  it  should  do
1153       special  checking.   RPOP  is  supported  by fetchmail (you can specify
1154       'protocol RPOP' to have the program send 'RPOP' rather than 'PASS') but
1155       its  use  is  strongly  discouraged, and support will be removed from a
1156       future fetchmail version.  This facility was vulnerable to spoofing and
1157       was withdrawn in RFC1460.
1158
1159       RFC1460  introduced  APOP authentication.  In this variant of POP3, you
1160       register an APOP password on your server host  (on  some  servers,  the
1161       program to do this is called popauth(8)).  You put the same password in
1162       your ~/.fetchmailrc file.  Each time fetchmail logs in, it sends an MD5
1163       hash of your password and the server greeting time to the server, which
1164       can verify it by checking its authorization database.
1165
1166       Note that APOP is no longer considered  resistant  against  man-in-the-
1167       middle attacks.
1168
1169   RETR or TOP
1170       fetchmail  makes  some  efforts to make the server believe messages had
1171       not been retrieved, by using the TOP command with  a  large  number  of
1172       lines  when  possible.  TOP is a command that retrieves the full header
1173       and a fetchmail-specified amount of body  lines.  It  is  optional  and
1174       therefore  not implemented by all servers, and some are known to imple‐
1175       ment it improperly. On many servers however,  the  RETR  command  which
1176       retrieves  the  full message with header and body, sets the "seen" flag
1177       (for instance, in a web interface), whereas the TOP command does not do
1178       that.
1179
1180       fetchmail  will  always  use  the  RETR  command  if "fetchall" is set.
1181       fetchmail will also use the RETR command if "keep" is set and "uidl" is
1182       unset.   Finally,  fetchmail  will  use the RETR command on Maillennium
1183       POP3/PROXY servers (used by Comcast) to avoid a deliberate  TOP  misin‐
1184       terpretation in this server that causes message corruption.
1185
1186       In  all  other  cases, fetchmail will use the TOP command. This implies
1187       that in "keep" setups, "uidl" must be set if "TOP" is desired.
1188
1189       Note that this description is true for the current  version  of  fetch‐
1190       mail,  but  the  behavior may change in future versions. In particular,
1191       fetchmail may prefer the RETR command because the  TOP  command  causes
1192       much grief on some servers and is only optional.
1193

ALTERNATE AUTHENTICATION FORMS

1195       If  your fetchmail was built with Kerberos support and you specify Ker‐
1196       beros authentication (either with --auth  or  the  .fetchmailrc  option
1197       authenticate kerberos_v4) it will try to get a Kerberos ticket from the
1198       mailserver at the start of each query.  Note: if either the pollname or
1199       via  name  is 'hesiod', fetchmail will try to use Hesiod to look up the
1200       mailserver.
1201
1202       If you use POP3 or IMAP  with  GSSAPI  authentication,  fetchmail  will
1203       expect  the  server to have RFC1731- or RFC1734-conforming GSSAPI capa‐
1204       bility, and will use it.  Currently this has only been tested over Ker‐
1205       beros  V,  so you're expected to already have a ticket-granting ticket.
1206       You may pass a username different from your principal  name  using  the
1207       standard --user command or by the .fetchmailrc option user.
1208
1209       If  your IMAP daemon returns the PREAUTH response in its greeting line,
1210       fetchmail will notice this and skip  the  normal  authentication  step.
1211       This  can  be useful, e.g. if you start imapd explicitly using ssh.  In
1212       this case you can declare the authentication value 'ssh' on  that  site
1213       entry  to stop .fetchmail from asking you for a password when it starts
1214       up.
1215
1216       If you use client authentication with TLS1 and your IMAP daemon returns
1217       the AUTH=EXTERNAL response, fetchmail will notice this and will use the
1218       authentication shortcut and will not send the passphrase. In this  case
1219       you can declare the authentication value 'external'
1220        on  that site to stop fetchmail from asking you for a password when it
1221       starts up.
1222
1223       If you are using POP3, and the server issues a one-time-password  chal‐
1224       lenge conforming to RFC1938, fetchmail will use your password as a pass
1225       phrase to generate the required response. This avoids  sending  secrets
1226       over the net unencrypted.
1227
1228       Compuserve's  RPA  authentication  is  supported. If you compile in the
1229       support, fetchmail will try to perform an RPA  pass-phrase  authentica‐
1230       tion instead of sending over the password en clair if it detects "@com‐
1231       puserve.com" in the hostname.
1232
1233       If you are using IMAP, Microsoft's NTLM authentication (used by  Micro‐
1234       soft  Exchange)  is supported. If you compile in the support, fetchmail
1235       will try to perform an NTLM authentication (instead of sending over the
1236       password  en  clair) whenever the server returns AUTH=NTLM in its capa‐
1237       bility  response.  Specify  a  user  option  value  that   looks   like
1238       'user@domain':  the  part  to  the  left of the @ will be passed as the
1239       username and the part to the right as the NTLM domain.
1240
1241
1242   Secure Socket Layers (SSL) and Transport Layer Security (TLS)
1243       transport. Additionally, POP3 and  IMAP  retrival  can  also  negotiate
1244       SSL/TLS by means of STARTTLS (or STLS).
1245
1246       Note  that  fetchmail  currently uses the OpenSSL library, which is se‐
1247       verely underdocumented, so failures may occur just because the program‐
1248       mers  are not aware of OpenSSL's requirement of the day.  For instance,
1249       since v6.3.16, fetchmail calls OpenSSL_add_all_algorithms(),  which  is
1250       necessary to support certificates using SHA256 on OpenSSL 0.9.8 -- this
1251       information is deeply hidden in the documentation and not at all  obvi‐
1252       ous.  Please do not hesitate to report subtle SSL failures.
1253
1254       You  can access SSL encrypted services by specifying the options start‐
1255       ing with --ssl, such as --ssl,  --sslproto,  --sslcertck,  and  others.
1256       You  can  also  do  this  using  the  corresponding user options in the
1257       .fetchmailrc file.  Some services, such as POP3 and IMAP, have  differ‐
1258       ent  well  known  ports  defined  for  the SSL encrypted services.  The
1259       encrypted ports will be selected automatically when SSL is enabled  and
1260       no  explicit port is specified.   Also, the --sslcertck command line or
1261       sslcertck run control file option should be used to force  strict  cer‐
1262       tificate checking with older fetchmail versions - see below.
1263
1264       If  SSL is not configured, fetchmail will usually opportunistically try
1265       to use STARTTLS. STARTTLS can be enforced by using --sslproto auto  and
1266       defeated  by using --sslproto ''.  TLS connections use the same port as
1267       the unencrypted version of the protocol and negotiate TLS  via  special
1268       command.  The  --sslcertck  command  line or sslcertck run control file
1269       option should be used to force strict certificate checking - see below.
1270
1271       --sslcertck is recommended: When connecting to an SSL or TLS  encrypted
1272       server, the server presents a certificate to the client for validation.
1273       The certificate is checked to verify that the common name in  the  cer‐
1274       tificate  matches  the  name of the server being contacted and that the
1275       effective and expiration dates in the certificate indicate that  it  is
1276       currently  valid.   If  any  of these checks fail, a warning message is
1277       printed, but the connection continues.  The server certificate does not
1278       need  to  be  signed  by any specific Certifying Authority and may be a
1279       "self-signed" certificate. If the --sslcertck command  line  option  or
1280       sslcertck run control file option is used, fetchmail will instead abort
1281       if any of these checks fail, because it must assume  that  there  is  a
1282       man-in-the-middle  attack  in  this  scenario, hence fetchmail must not
1283       expose cleartext passwords. Use of the sslcertck or --sslcertck  option
1284       is therefore advised; it has become the default in fetchmail 6.4.0.
1285
1286       Some  SSL  encrypted  servers may request a client side certificate.  A
1287       client side public SSL certificate and private SSL key  may  be  speci‐
1288       fied.   If  requested  by the server, the client certificate is sent to
1289       the server for validation.  Some servers may  require  a  valid  client
1290       certificate and may refuse connections if a certificate is not provided
1291       or if the certificate is not valid.  Some servers  may  require  client
1292       side  certificates be signed by a recognized Certifying Authority.  The
1293       format for the key files and the certificate files is that required  by
1294       the underlying SSL libraries (OpenSSL in the general case).
1295
1296       A  word  of care about the use of SSL: While above mentioned setup with
1297       self-signed server certificates retrieved over the  wires  can  protect
1298       you  from  a  passive  eavesdropper,  it doesn't help against an active
1299       attacker. It's clearly an improvement over  sending  the  passwords  in
1300       clear, but you should be aware that a man-in-the-middle attack is triv‐
1301       ially possible (in particular with tools such as dsniff ⟨http://
1302       monkey.org/~dugsong/dsniff/⟩,  ).   Use  of strict certificate checking
1303       with a certification authority recognized by server and client, or per‐
1304       haps  of  an  SSH tunnel (see below for some examples) is preferable if
1305       you care seriously about the security of your mailbox and passwords.
1306
1307
1308   ESMTP AUTH
1309       fetchmail also supports authentication  to  the  ESMTP  server  on  the
1310       client  side  according  to  RFC 2554.  You can specify a name/password
1311       pair to be used with the keywords 'esmtpname' and 'esmtppassword';  the
1312       former defaults to the username of the calling user.
1313
1314

DAEMON MODE

1316   Introducing the daemon mode
1317       In daemon mode, fetchmail puts itself into the background and runs for‐
1318       ever, querying each specified  host  and  then  sleeping  for  a  given
1319       polling interval.
1320
1321   Starting the daemon mode
1322       There  are  several  ways to make fetchmail work in daemon mode. On the
1323       command line, --daemon <interval> or -d <interval> option  runs  fetch‐
1324       mail  in  daemon  mode.  You must specify a numeric argument which is a
1325       polling interval (time to wait after completing a whole poll cycle with
1326       the  last server and before starting the next poll cycle with the first
1327       server) in seconds.
1328
1329       Example: simply invoking
1330
1331              fetchmail -d 900
1332
1333       will, therefore, poll all the hosts described  in  your  ~/.fetchmailrc
1334       file (except those explicitly excluded with the 'skip' verb) a bit less
1335       often than once every 15 minutes (exactly: 15 minutes + time  that  the
1336       poll takes).
1337
1338       It  is  also  possible to set a polling interval in your ~/.fetchmailrc
1339       file by saying 'set daemon <interval>', where <interval> is an  integer
1340       number of seconds.  If you do this, fetchmail will always start in dae‐
1341       mon mode unless you override it with the command-line option --daemon 0
1342       or -d0.
1343
1344       Only  one  daemon process is permitted per user; in daemon mode, fetch‐
1345       mail sets up a per-user lockfile to guarantee this.  (You  can  however
1346       cheat  and  set the FETCHMAILHOME environment variable to overcome this
1347       setting, but in that case, it is your responsibility to make  sure  you
1348       aren't polling the same server with two processes at the same time.)
1349
1350   Awakening the background daemon
1351       Normally,  calling  fetchmail  with  a daemon in the background sends a
1352       wake-up signal to the daemon and quits without output.  The  background
1353       daemon  then  starts its next poll cycle immediately.  The wake-up sig‐
1354       nal, SIGUSR1, can also be sent manually. The wake-up action also clears
1355       any  'wedged'  flags  indicating  that  connections  have wedged due to
1356       failed authentication or multiple timeouts.
1357
1358   Terminating the background daemon
1359       The option -q or --quit will kill a running daemon process  instead  of
1360       waking  it up (if there is no such process, fetchmail will notify you).
1361       If the --quit option appears last on the command line,  fetchmail  will
1362       kill  the  running  daemon  process and then quit. Otherwise, fetchmail
1363       will first kill a running daemon process and then continue running with
1364       the other options.
1365
1366   Useful options for daemon mode
1367       The -L <filename> or --logfile <filename> option (keyword: set logfile)
1368       is only effective when fetchmail is detached and in daemon  mode.  Note
1369       that  the  logfile  must exist before fetchmail is run, you can use the
1370       touch(1) command with the filename as its sole argument to create it.
1371       This option allows you to redirect status  messages  into  a  specified
1372       logfile  (follow  the  option  with  the logfile name).  The logfile is
1373       opened for append, so previous messages aren't deleted.  This  is  pri‐
1374       marily  useful  for  debugging configurations. Note that fetchmail does
1375       not detect if the logfile is rotated, the logfile is only  opened  once
1376       when fetchmail starts. You need to restart fetchmail after rotating the
1377       logfile and before compressing it (if applicable).
1378
1379       The --syslog option (keyword: set syslog) allows you to redirect status
1380       and error messages emitted to the syslog(3) system daemon if available.
1381       Messages are logged with an id of fetchmail, the facility LOG_MAIL, and
1382       priorities LOG_ERR, LOG_ALERT or LOG_INFO.  This option is intended for
1383       logging status and error messages which indicate the status of the dae‐
1384       mon and the results while fetching mail from the server(s).  Error mes‐
1385       sages for command line options and parsing the  .fetchmailrc  file  are
1386       still  written to stderr, or to the specified log file.  The --nosyslog
1387       option turns off use of syslog(3),  assuming  it's  turned  on  in  the
1388       ~/.fetchmailrc file.  This option is overridden, in certain situations,
1389       by --logfile (which see).
1390
1391       The -N or --nodetach option suppresses backgrounding and detachment  of
1392       the  daemon  process  from  its  control  terminal.  This is useful for
1393       debugging or when fetchmail runs as the child of a  supervisor  process
1394       such  as init(8) or Gerrit Pape's runit(8).  Note that this also causes
1395       the logfile option to be ignored.
1396
1397       Note that while running in daemon  mode  polling  a  POP2  or  IMAP2bis
1398       server,  transient  errors  (such  as DNS failures or sendmail delivery
1399       refusals) may force the fetchall option on for the duration of the next
1400       polling  cycle.  This is a robustness feature.  It means that if a mes‐
1401       sage is fetched (and thus marked seen by the mailserver) but not deliv‐
1402       ered  locally due to some transient error, it will be re-fetched during
1403       the next poll cycle.  (The IMAP logic  doesn't  delete  messages  until
1404       they're delivered, so this problem does not arise.)
1405
1406       If  you touch or change the ~/.fetchmailrc file while fetchmail is run‐
1407       ning in daemon mode, this will be detected at the beginning of the next
1408       poll  cycle.   When  a  changed  ~/.fetchmailrc  is detected, fetchmail
1409       rereads it and restarts from scratch (using exec(2); no state  informa‐
1410       tion is retained in the new instance).  Note that if fetchmail needs to
1411       query for passwords, of that if you  break  the  ~/.fetchmailrc  file's
1412       syntax,  the  new  instance  will  softly  and  silently vanish away on
1413       startup.
1414
1415

ADMINISTRATIVE OPTIONS

1417       The --postmaster <name> option (keyword: set postmaster) specifies  the
1418       last-resort  username  to which multidrop mail is to be forwarded if no
1419       matching local recipient can be found. It is also used  as  destination
1420       of  undeliverable  mail  if  the  'bouncemail' global option is off and
1421       additionally for spam-blocked mail if the 'bouncemail' global option is
1422       off  and  the 'spambounce' global option is on. This option defaults to
1423       the user who invoked fetchmail.  If the invoking user is root, then the
1424       default of this option is the user 'postmaster'.  Setting postmaster to
1425       the empty string causes such mail as described above to be discarded  -
1426       this  however  is  usually a bad idea.  See also the description of the
1427       'FETCHMAILUSER' environment variable in the ENVIRONMENT section below.
1428
1429       The --nobounce behaves like the  "set  no  bouncemail"  global  option,
1430       which see.
1431
1432       The --invisible option (keyword: set invisible) tries to make fetchmail
1433       invisible.  Normally, fetchmail behaves like any other MTA would --  it
1434       generates  a  Received header into each message describing its place in
1435       the chain of transmission, and tells the MTA it forwards  to  that  the
1436       mail  came  from  the  machine  fetchmail itself is running on.  If the
1437       invisible option is on, the Received header is suppressed and fetchmail
1438       tries  to  spoof  the MTA it forwards to into thinking it came directly
1439       from the mailserver host.
1440
1441       The --showdots option (keyword: set showdots) forces fetchmail to  show
1442       progress  dots even if the output goes to a file or fetchmail is not in
1443       verbose mode.  Fetchmail shows the dots by default when run  in  --ver‐
1444       bose  mode  and  output  goes  to  console.  This  option is ignored in
1445       --silent mode.
1446
1447       By specifying the --tracepolls option, you can  ask  fetchmail  to  add
1448       information to the Received header on the form "polling {label} account
1449       {user}", where {label} is the account label (from the specified rcfile,
1450       normally  ~/.fetchmailrc)  and  {user} is the username which is used to
1451       log on to the mail server. This header can be used  to  make  filtering
1452       email where no useful header information is available and you want mail
1453       from different accounts sorted into different  mailboxes  (this  could,
1454       for  example, occur if you have an account on the same server running a
1455       mailing list, and are subscribed to the list using that  account).  The
1456       default is not adding any such header.  In .fetchmailrc, this is called
1457       'tracepolls'.
1458
1459

RETRIEVAL FAILURE MODES

1461       The protocols fetchmail uses to talk to mailservers are next to bullet‐
1462       proof.   In  normal operation forwarding to port 25, no message is ever
1463       deleted (or even marked for deletion) on the host until the  SMTP  lis‐
1464       tener on the client side has acknowledged to fetchmail that the message
1465       has been either accepted for delivery or rejected due to a spam block.
1466
1467       When forwarding to an MDA, however, there is more possibility of error.
1468       Some MDAs are 'safe' and reliably return a nonzero status on any deliv‐
1469       ery error, even one due to temporary resource limits.  The  maildrop(1)
1470       program  is  like this; so are most programs designed as mail transport
1471       agents, such as sendmail(1), including the sendmail wrapper of  Postfix
1472       and exim(1).  These programs give back a reliable positive acknowledge‐
1473       ment and can be used with the mda option with no  risk  of  mail  loss.
1474       Unsafe  MDAs,  though,  may return 0 even on delivery failure.  If this
1475       happens, you will lose mail.
1476
1477       The normal mode of fetchmail is to try to download only 'new' messages,
1478       leaving  untouched  (and  undeleted)  messages  you  have  already read
1479       directly on the server (or fetched with a previous  fetchmail  --keep).
1480       But  you  may  find that messages you've already read on the server are
1481       being fetched (and deleted) even when you don't specify  --all.   There
1482       are several reasons this can happen.
1483
1484       One  could  be  that  you're using POP2.  The POP2 protocol includes no
1485       representation of 'new' or 'old' state in messages, so  fetchmail  must
1486       treat  all messages as new all the time.  But POP2 is obsolete, so this
1487       is unlikely.
1488
1489       A potential POP3 problem might be servers that insert messages  in  the
1490       middle of mailboxes (some VMS implementations of mail are rumored to do
1491       this).  The fetchmail code assumes that new messages  are  appended  to
1492       the  end  of  the  mailbox; when this is not true it may treat some old
1493       messages as new and vice versa.  Using UIDL whilst setting  fastuidl  0
1494       might fix this, otherwise, consider switching to IMAP.
1495
1496       Yet  another  POP3  problem is that if they can't make tempfiles in the
1497       user's home directory, some POP3 servers will hand back an undocumented
1498       response that causes fetchmail to spuriously report "No mail".
1499
1500       The  IMAP code uses the presence or absence of the server flag \Seen to
1501       decide whether or not a message is new.  This isn't the right thing  to
1502       do,  fetchmail should check the UIDVALIDITY and use UID, but it doesn't
1503       do that yet. Under Unix, it counts on your IMAP server  to  notice  the
1504       BSD-style  Status  flags set by mail user agents and set the \Seen flag
1505       from them when appropriate.  All Unix IMAP servers we know of do  this,
1506       though  it's  not  specified by the IMAP RFCs.  If you ever trip over a
1507       server that doesn't, the symptom will be that messages you have already
1508       read  on  your  host  will  look new to the server.  In this (unlikely)
1509       case, only messages you fetched with  fetchmail  --keep  will  be  both
1510       undeleted and marked old.
1511
1512       In  ETRN and ODMR modes, fetchmail does not actually retrieve messages;
1513       instead, it asks the server's SMTP listener to start a queue  flush  to
1514       the client via SMTP.  Therefore it sends only undelivered messages.
1515
1516

SPAM FILTERING

1518       Many  SMTP listeners allow administrators to set up 'spam filters' that
1519       block unsolicited email from specified domains.  A MAIL  FROM  or  DATA
1520       line  that  triggers  this  feature  will elicit an SMTP response which
1521       (unfortunately) varies according to the listener.
1522
1523       Newer versions of sendmail return an error code of 571.
1524
1525       According to RFC2821, the correct thing to return in this situation  is
1526       550  "Requested  action not taken: mailbox unavailable" (the draft adds
1527       "[E.g., mailbox not found, no access, or command  rejected  for  policy
1528       reasons].").
1529
1530       Older  versions  of the exim MTA return 501 "Syntax error in parameters
1531       or arguments".
1532
1533       The postfix MTA runs 554 as an antispam response.
1534
1535       Zmailer may reject code with a 500 response (followed  by  an  enhanced
1536       status code that contains more information).
1537
1538       Return  codes which fetchmail treats as antispam responses and discards
1539       the message can be set with the 'antispam' option.  This is one of  the
1540       only  three  circumstance under which fetchmail ever discards mail (the
1541       others are the 552 and 553 errors described below, and the  suppression
1542       of multidropped messages with a message-ID already seen).
1543
1544       If  fetchmail  is  fetching  from an IMAP server, the antispam response
1545       will be detected and the message rejected immediately after the headers
1546       have  been  fetched, without reading the message body.  Thus, you won't
1547       pay for downloading spam message bodies.
1548
1549       By default, the list of antispam responses is empty.
1550
1551       If the spambounce global option is on, mail that is spam-blocked  trig‐
1552       gers an RFC1892/RFC1894 bounce message informing the originator that we
1553       do not accept mail from it. See also BUGS.
1554
1555

SMTP/ESMTP ERROR HANDLING

1557       Besides the spam-blocking  described  above,  fetchmail  takes  special
1558       actions — that may be modified by the --softbounce option — on the fol‐
1559       lowing SMTP/ESMTP error response codes
1560
1561       452 (insufficient system storage)
1562            Leave the message in the server mailbox for later retrieval.
1563
1564       552 (message exceeds fixed maximum message size)
1565            Delete the message from the server.  Send bounce-mail to the orig‐
1566            inator.
1567
1568       553 (invalid sending domain)
1569            Delete  the  message  from  the  server.   Don't  even try to send
1570            bounce-mail to the originator.
1571
1572       Other errors greater or equal to 500 trigger bounce mail  back  to  the
1573       originator, unless suppressed by --softbounce. See also BUGS.
1574
1575

THE RUN CONTROL FILE

1577       The  preferred  way to set up fetchmail is to write a .fetchmailrc file
1578       in your home directory (you may do this directly, with a  text  editor,
1579       or indirectly via fetchmailconf).  When there is a conflict between the
1580       command-line arguments and the arguments in this file, the command-line
1581       arguments take precedence.
1582
1583       To  protect the security of your passwords, your ~/.fetchmailrc may not
1584       normally have more than 0700 (u=rwx,g=,o=) permissions; fetchmail  will
1585       complain and exit otherwise (this check is suppressed when --version is
1586       on).
1587
1588       You may read the .fetchmailrc file as a list of commands to be executed
1589       when fetchmail is called with no arguments.
1590
1591   Run Control Syntax
1592       Comments begin with a '#' and extend through the end of the line.  Oth‐
1593       erwise the file consists of a series of server entries or global option
1594       statements in a free-format, token-oriented syntax.
1595
1596       There are four kinds of tokens: grammar keywords, numbers (i.e. decimal
1597       digit sequences), unquoted  strings,  and  quoted  strings.   A  quoted
1598       string  is  bounded  by  double  quotes and may contain whitespace (and
1599       quoted digits are treated as a string).  Note that quoted strings  will
1600       also contain line feed characters if they run across two or more lines,
1601       unless you use a backslash to join  lines  (see  below).   An  unquoted
1602       string  is  any  whitespace-delimited  token  that  is neither numeric,
1603       string quoted nor contains the special characters  ',',  ';',  ':',  or
1604       '='.
1605
1606       Any  amount  of  whitespace  separates tokens in server entries, but is
1607       otherwise ignored. You may use backslash escape sequences (\n  for  LF,
1608       \t  for  HT,  \b  for BS, \r for CR, \nnn for decimal (where nnn cannot
1609       start with a 0), \0ooo for octal, and \xhh for hex) to embed non-print‐
1610       able  characters or string delimiters in strings.  In quoted strings, a
1611       backslash at the very end of a line will cause the backslash itself and
1612       the line feed (LF or NL, new line) character to be ignored, so that you
1613       can wrap long strings. Without the backslash at the line end, the  line
1614       feed character would become part of the string.
1615
1616       Warning:  while  these  resemble C-style escape sequences, they are not
1617       the same.  fetchmail only supports these eight styles. C supports  more
1618       escape  sequences that consist of backslash (\) and a single character,
1619       but does not support decimal codes and does not require the  leading  0
1620       in octal notation.  Example: fetchmail interprets \233 the same as \xE9
1621       (Latin small letter e with acute), where  C  would  interpret  \233  as
1622       octal 0233 = \x9B (CSI, control sequence introducer).
1623
1624       Each  server  entry  consists  of one of the keywords 'poll' or 'skip',
1625       followed by a server name, followed by server options, followed by  any
1626       number  of  user  (or username) descriptions, followed by user options.
1627       Note: the most common cause of syntax errors  is  mixing  up  user  and
1628       server options or putting user options before the user descriptions.
1629
1630       For backward compatibility, the word 'server' is a synonym for 'poll'.
1631
1632       You  can  use  the  noise  keywords  'and', 'with', 'has', 'wants', and
1633       'options' anywhere in an entry to make it  resemble  English.   They're
1634       ignored, but but can make entries much easier to read at a glance.  The
1635       punctuation characters ':', ';' and ',' are also ignored.
1636
1637   Poll vs. Skip
1638       The 'poll' verb tells fetchmail to query this host when it is run  with
1639       no  arguments.   The  'skip' verb tells fetchmail not to poll this host
1640       unless it is explicitly named on the command line.   (The  'skip'  verb
1641       allows  you  to  experiment with test entries safely, or easily disable
1642       entries for hosts that are temporarily down.)
1643
1644   Keyword/Option Summary
1645       Here are the legal options.  Keyword suffixes enclosed in square brack‐
1646       ets  are  optional.   Those corresponding to short command-line options
1647       are followed by '-' and the appropriate option letter.   If  option  is
1648       only  relevant to a single mode of operation, it is noted as 's' or 'm'
1649       for singledrop- or multidrop-mode, respectively.
1650
1651       Here are the legal global options:
1652
1653
1654       Keyword             Opt   Mode   Function
1655       ────────────────────────────────────────────────────────────────────
1656       set daemon          -d           Set a background poll interval  in
1657                                        seconds.
1658       set postmaster                   Give  the  name of the last-resort
1659                                        mail recipient (default: user run‐
1660                                        ning  fetchmail,  "postmaster"  if
1661                                        run by the root user)
1662       set    bouncemail                Direct error mail  to  the  sender
1663                                        (default)
1664       set no bouncemail                Direct  error  mail  to  the local
1665                                        postmaster (as per  the  'postmas‐
1666                                        ter' global option above).
1667       set no spambounce                Do  not  bounce  spam-blocked mail
1668                                        (default).
1669       set    spambounce                Bounce blocked  spam-blocked  mail
1670                                        (as   per   the   'antispam'  user
1671                                        option) back to the destination as
1672                                        indicated   by   the  'bouncemail'
1673                                        global option.   Warning:  Do  not
1674                                        use  this  to  bounce spam back to
1675                                        the sender -  most  spam  is  sent
1676                                        with false sender address and thus
1677                                        this   option    hurts    innocent
1678                                        bystanders.
1679       set no softbounce                Delete  permanently  undeliverable
1680                                        mail. It  is  recommended  to  use
1681                                        this  option  if the configuration
1682                                        has been thoroughly tested.
1683       set    softbounce                Keep   permanently   undeliverable
1684                                        mail  as  though a temporary error
1685                                        had occurred (default).
1686       set logfile         -L           Name of a file to append error and
1687                                        status  messages  to.  Only effec‐
1688                                        tive in daemon mode and if  fetch‐
1689                                        mail   detaches.    If  effective,
1690                                        overrides set syslog.
1691       set idfile          -i           Name of  the  file  to  store  UID
1692                                        lists in.
1693       set    syslog                    Do   error  logging  through  sys‐
1694                                        log(3). May be overridden  by  set
1695                                        logfile.
1696       set no syslog                    Turn  off  error  logging  through
1697                                        syslog(3). (default)
1698       set properties                   String value that  is  ignored  by
1699                                        fetchmail  (may  be used by exten‐
1700                                        sion scripts).
1701
1702       Here are the legal server options:
1703
1704
1705       Keyword          Opt   Mode   Function
1706       ─────────────────────────────────────────────────────────────────
1707       via                           Specify DNS  name  of  mailserver,
1708                                     overriding poll name
1709       proto[col]       -p           Specify  protocol  (case  insensi‐
1710                                     tive):  POP2,  POP3,  IMAP,  APOP,
1711                                     KPOP
1712       local[domains]         m      Specify  domain(s)  to be regarded
1713                                     as local
1714       port                          Specify TCP/IP service port (obso‐
1715                                     lete, use 'service' instead).
1716       service          -P           Specify  service  name  (a numeric
1717                                     value is also allowed and  consid‐
1718                                     ered a TCP/IP port number).
1719
1720
1721       auth[enticate]                Set  authentication  type (default
1722                                     'any')
1723       timeout          -t           Server inactivity timeout in  sec‐
1724                                     onds (default 300)
1725       envelope         -E    m      Specify   envelope-address  header
1726                                     name
1727       no envelope            m      Disable   looking   for   envelope
1728                                     address
1729       qvirtual         -Q    m      Qmail  virtual  domain  prefix  to
1730                                     remove from user name
1731       aka                    m      Specify  alternate  DNS  names  of
1732                                     mailserver
1733       interface        -I           specify  IP interface(s) that must
1734                                     be up  for  server  poll  to  take
1735                                     place
1736       monitor          -M           Specify  IP address to monitor for
1737                                     activity
1738       plugin                        Specify command through  which  to
1739                                     make server connections.
1740       plugout                       Specify  command  through which to
1741                                     make listener connections.
1742       dns                    m      Enable DNS  lookup  for  multidrop
1743                                     (default)
1744       no dns                 m      Disable DNS lookup for multidrop
1745       checkalias             m      Do  comparison  by  IP address for
1746                                     multidrop
1747       no checkalias          m      Do comparison  by  name  for  mul‐
1748                                     tidrop (default)
1749       uidl             -U           Force   POP3  to  use  client-side
1750                                     UIDLs (recommended)
1751       no uidl                       Turn off POP3 use  of  client-side
1752                                     UIDLs (default)
1753       interval                      Only  check this site every N poll
1754                                     cycles; N is a numeric argument.
1755       tracepolls                    Add poll  tracing  information  to
1756                                     the Received header
1757       principal                     Set  Kerberos principal (only use‐
1758                                     ful with IMAP and kerberos)
1759       esmtpname                     Set name for  RFC2554  authentica‐
1760                                     tion to the ESMTP server.
1761       esmtppassword                 Set password for RFC2554 authenti‐
1762                                     cation to the ESMTP server.
1763       bad-header                    How to treat messages with  a  bad
1764                                     header. Can be reject (default) or
1765                                     accept.
1766
1767       Here are the legal user descriptions and options:
1768
1769
1770       Keyword            Opt       Mode   Function
1771       ───────────────────────────────────────────────────────────────────────
1772       user[name]         -u               This is the user  description  and
1773                                           must   come   first  after  server
1774                                           description  and  after   possible
1775                                           server  options,  and  before user
1776                                           options.
1777                                           It sets the remote user name if by
1778                                           itself  or followed by 'there', or
1779                                           the local user name if followed by
1780                                           'here'.
1781       is                                  Connect   local  and  remote  user
1782                                           names
1783       to                                  Connect  local  and  remote   user
1784                                           names
1785       pass[word]                          Specify remote account password
1786       ssl                                 Connect  to server over the speci‐
1787                                           fied  base  protocol   using   SSL
1788                                           encryption
1789
1790       sslcert                             Specify  file for client side pub‐
1791                                           lic SSL certificate
1792       sslcertck                           Enable strict certificate checking
1793                                           and  abort  connection on failure.
1794                                           Default   only   since   fetchmail
1795                                           v6.4.0.
1796       no sslcertck                        Disable  strict certificate check‐
1797                                           ing and permit connections to con‐
1798                                           tinue on failed verification. Dis‐
1799                                           couraged.  Should  only  be   used
1800                                           together with sslfingerprint.
1801       sslcertfile                         Specify  file with trusted CA cer‐
1802                                           tificates
1803       sslcertpath                         Specify c_rehash-ed directory with
1804                                           trusted CA certificates.
1805       sslfingerprint     <HASH>           Specify the expected server certi‐
1806                                           ficat finger print. Fetchmail will
1807                                           disconnect  and log an error if it
1808                                           does not match.
1809       sslkey                              Specify file for client side  pri‐
1810                                           vate SSL key
1811       sslproto                            Force ssl protocol for connection
1812       folder             -r               Specify remote folder to query
1813       smtphost           -S               Specify smtp host(s) to forward to
1814       fetchdomains                 m      Specify  domains  for  which  mail
1815                                           should be fetched
1816       smtpaddress        -D               Specify the domain to  be  put  in
1817                                           RCPT TO lines
1818       smtpname                            Specify  the user and domain to be
1819                                           put in RCPT TO lines
1820       antispam           -Z               Specify  what  SMTP  returns   are
1821                                           interpreted as spam-policy blocks
1822       mda                -m               Specify MDA for local delivery
1823       bsmtp                               Specify BSMTP batch file to append
1824                                           to
1825       preconnect                          Command to be executed before each
1826                                           connection
1827       postconnect                         Command  to be executed after each
1828                                           connection
1829       keep               -k               Don't delete  seen  messages  from
1830                                           server  (for  POP3, uidl is recom‐
1831                                           mended)
1832       flush              -F               Flush  all  seen  messages  before
1833                                           querying (DANGEROUS)
1834       limitflush                          Flush   all   oversized   messages
1835                                           before querying
1836       fetchall           -a               Fetch all messages whether seen or
1837                                           not
1838       rewrite                             Rewrite  destination addresses for
1839                                           reply (default)
1840       stripcr                             Strip carriage returns  from  ends
1841                                           of lines
1842       forcecr                             Force  carriage returns at ends of
1843                                           lines
1844       pass8bits                           Force BODY=8BITMIME to ESMTP  lis‐
1845                                           tener
1846       dropstatus                          Strip  Status and X-Mozilla-Status
1847                                           lines out of incoming mail
1848       dropdelivered                       Strip Delivered-To  lines  out  of
1849                                           incoming mail
1850       mimedecode                          Convert  quoted-printable to 8-bit
1851                                           in MIME messages
1852       idle                                Idle  waiting  for  new   messages
1853                                           after each poll (IMAP only)
1854       no keep            -K               Delete  seen  messages from server
1855                                           (default)
1856       no flush                            Don't  flush  all  seen   messages
1857                                           before querying (default)
1858
1859       no fetchall                         Retrieve    only    new   messages
1860                                           (default)
1861       no rewrite                          Don't rewrite headers
1862       no stripcr                          Don't   strip   carriage   returns
1863                                           (default)
1864       no forcecr                          Don't  force  carriage  returns at
1865                                           EOL (default)
1866       no pass8bits                        Don't force BODY=8BITMIME to ESMTP
1867                                           listener (default)
1868       no dropstatus                       Don't    drop    Status    headers
1869                                           (default)
1870       no dropdelivered                    Don't  drop  Delivered-To  headers
1871                                           (default)
1872       no mimedecode                       Don't  convert quoted-printable to
1873                                           8-bit in MIME messages (default)
1874       no idle                             Don't idle waiting  for  new  mes‐
1875                                           sages after each poll (IMAP only)
1876       limit              -l               Set message size limit
1877       warnings           -w               Set message size warning interval
1878       batchlimit         -b               Max  # messages to forward in sin‐
1879                                           gle connect
1880       fetchlimit         -B               Max # messages to fetch in  single
1881                                           connect
1882       fetchsizelimit                      Max  #  message  sizes to fetch in
1883                                           single transaction
1884       fastuidl                            Use binary search for first unseen
1885                                           message (POP3 only)
1886       expunge            -e               Perform  an  expunge  on every #th
1887                                           message (IMAP and POP3 only)
1888       properties                          String value is ignored by  fetch‐
1889                                           mail  (may  be  used  by extension
1890                                           scripts)
1891
1892       All user options must begin with a user description (user  or  username
1893       option) and follow all server descriptions and options.
1894
1895       In  the  .fetchmailrc  file, the 'envelope' string argument may be pre‐
1896       ceded by a whitespace-separated number.  This number, if specified,  is
1897       the  number  of  such  headers  to skip over (that is, an argument of 1
1898       selects the second header of the given type).  This is sometime  useful
1899       for  ignoring bogus envelope headers created by an ISP's local delivery
1900       agent or  internal  forwards  (through  mail  inspection  systems,  for
1901       instance).
1902
1903   Keywords Not Corresponding To Option Switches
1904       The  'folder' and 'smtphost' options (unlike their command-line equiva‐
1905       lents) can take a space- or comma-separated  list  of  names  following
1906       them.
1907
1908       All  options  correspond  to the obvious command-line arguments, except
1909       the following: 'via', 'interval', 'aka', 'is',  'to',  'dns'/'no  dns',
1910       'checkalias'/'no  checkalias', 'password', 'preconnect', 'postconnect',
1911       'localdomains',   'stripcr'/'no   stripcr',   'forcecr'/'no   forcecr',
1912       'pass8bits'/'no   pass8bits'  'dropstatus/no  dropstatus',  'dropdeliv‐
1913       ered/no dropdelivered', 'mimedecode/no mimedecode', 'no idle', and  'no
1914       envelope'.
1915
1916       The 'via' option is for if you want to have more than one configuration
1917       pointing at the same site.  If it is present, the string argument  will
1918       be  taken as the actual DNS name of the mailserver host to query.  This
1919       will override the argument of poll, which can then simply be a distinct
1920       label  for  the  configuration (e.g. what you would give on the command
1921       line to explicitly query this host).
1922
1923       The 'interval' option (which takes a numeric argument)  allows  you  to
1924       poll a server less frequently than the basic poll interval.  If you say
1925       'interval N' the server this option is attached to will only be queried
1926       every N poll intervals.
1927
1928   Singledrop vs. Multidrop options
1929       Please  ensure  you  read  the section titled THE USE AND ABUSE OF MUL‐
1930       TIDROP MAILBOXES if you intend to use multidrop mode.
1931
1932       The 'is' or  'to'  keywords  associate  the  following  local  (client)
1933       name(s)  (or  server-name  to client-name mappings separated by =) with
1934       the mailserver user name in the entry.  If an is/to list has '*' as its
1935       last  name,  unrecognized  names  are  simply passed through. Note that
1936       until fetchmail version 6.3.4 inclusively, these lists could only  con‐
1937       tain  local  parts of user names (fetchmail would only look at the part
1938       before the @ sign). fetchmail versions 6.3.5  and  newer  support  full
1939       addresses on the left hand side of these mappings, and they take prece‐
1940       dence over any 'localdomains', 'aka', 'via' or similar mappings.
1941
1942       A single local name can be used to support redirecting your  mail  when
1943       your  username on the client machine is different from your name on the
1944       mailserver.  When there is only a single local name, mail is  forwarded
1945       to  that  local  username regardless of the message's Received, To, Cc,
1946       and Bcc headers.  In this case, fetchmail never does DNS lookups.
1947
1948       When there is more than one local name  (or  name  mapping),  fetchmail
1949       looks  at  the  envelope  header,  if  configured, and otherwise at the
1950       Received, To, Cc, and Bcc headers of retrieved mail (this is 'multidrop
1951       mode').   It  looks  for  addresses with hostname parts that match your
1952       poll name or your 'via', 'aka' or 'localdomains' options,  and  usually
1953       also  for  hostname  parts  which  DNS  tells  it  are  aliases  of the
1954       mailserver.  See the discussion of 'dns', 'checkalias', 'localdomains',
1955       and 'aka' for details on how matching addresses are handled.
1956
1957       If  fetchmail  cannot  match  any  mailserver  usernames or localdomain
1958       addresses, the mail will be bounced.  Normally it will  be  bounced  to
1959       the sender, but if the 'bouncemail' global option is off, the mail will
1960       go to the local  postmaster  instead.   (see  the  'postmaster'  global
1961       option). See also BUGS.
1962
1963       The  'dns'  option  (normally  on) controls the way addresses from mul‐
1964       tidrop mailboxes are checked.  On, it enables logic to check each  host
1965       address  that  does not match an 'aka' or 'localdomains' declaration by
1966       looking it up with DNS.   When  a  mailserver  username  is  recognized
1967       attached to a matching hostname part, its local mapping is added to the
1968       list of local recipients.
1969
1970       The 'checkalias' option (normally off) extends the lookups performed by
1971       the  'dns'  keyword  in  multidrop  mode,  providing a way to cope with
1972       remote MTAs that identify themselves using their canonical name,  while
1973       they're polled using an alias.  When such a server is polled, checks to
1974       extract the envelope address fail, and fetchmail  reverts  to  delivery
1975       using   the   To/Cc/Bcc   headers   (See  below  'Header  vs.  Envelope
1976       addresses').  Specifying this option instructs  fetchmail  to  retrieve
1977       all  the  IP  addresses associated with both the poll name and the name
1978       used by the remote MTA and to do a  comparison  of  the  IP  addresses.
1979       This  comes  in  handy  in situations where the remote server undergoes
1980       frequent canonical name changes, that would otherwise require modifica‐
1981       tions  to the rcfile.  'checkalias' has no effect if 'no dns' is speci‐
1982       fied in the rcfile.
1983
1984       The 'aka' option is for use with multidrop mailboxes.  It allows you to
1985       pre-declare  a  list of DNS aliases for a server.  This is an optimiza‐
1986       tion hack that allows you to trade space for  speed.   When  fetchmail,
1987       while  processing  a multidrop mailbox, grovels through message headers
1988       looking for names of the mailserver, pre-declaring common ones can save
1989       it  from  having  to do DNS lookups.  Note: the names you give as argu‐
1990       ments to 'aka' are matched as suffixes -- if  you  specify  (say)  'aka
1991       netaxs.com',  this  will  match not just a hostname netaxs.com, but any
1992       hostname that ends with '.netaxs.com'; such  as  (say)  pop3.netaxs.com
1993       and mail.netaxs.com.
1994
1995       The 'localdomains' option allows you to declare a list of domains which
1996       fetchmail should consider local.  When  fetchmail  is  parsing  address
1997       lines in multidrop modes, and a trailing segment of a host name matches
1998       a declared local domain, that address is passed through to the listener
1999       or MDA unaltered (local-name mappings are not applied).
2000
2001       If you are using 'localdomains', you may also need to specify 'no enve‐
2002       lope', which disables fetchmail's normal attempt to deduce an  envelope
2003       address  from  the  Received  line  or X-Envelope-To header or whatever
2004       header has been previously set by 'envelope'.  If you set 'no envelope'
2005       in the defaults entry it is possible to undo that in individual entries
2006       by using 'envelope <string>'.  As a special case, 'envelope "Received"'
2007       restores the default parsing of Received lines.
2008
2009       The  password  option requires a string argument, which is the password
2010       to be used with the entry's server.
2011
2012       The 'preconnect' keyword allows you to specify a shell  command  to  be
2013       executed  just before each time fetchmail establishes a mailserver con‐
2014       nection.  This may be useful if you are attempting to set up secure POP
2015       connections  with  the aid of ssh(1).  If the command returns a nonzero
2016       status, the poll of that mailserver will be aborted.
2017
2018       Similarly, the 'postconnect' keyword similarly allows you to specify  a
2019       shell  command to be executed just after each time a mailserver connec‐
2020       tion is taken down.
2021
2022       The 'forcecr' option controls whether lines terminated by LF  only  are
2023       given  CRLF  termination  before  forwarding.  Strictly speaking RFC821
2024       requires this, but few MTAs enforce the requirement so this  option  is
2025       normally  off  (only one such MTA, qmail, is in significant use at time
2026       of writing).
2027
2028       The 'stripcr' option controls whether carriage returns are stripped out
2029       of retrieved mail before it is forwarded.  It is normally not necessary
2030       to set this, because it defaults to 'on' (CR  stripping  enabled)  when
2031       there  is  an  MDA declared but 'off' (CR stripping disabled) when for‐
2032       warding is via SMTP.  If 'stripcr' and 'forcecr' are both on, 'stripcr'
2033       will override.
2034
2035       The 'pass8bits' option exists to cope with Microsoft mail programs that
2036       stupidly slap a "Content-Transfer-Encoding: 7bit" on everything.   With
2037       this  option  off  (the  default)  and such a header present, fetchmail
2038       declares BODY=7BIT to an ESMTP-capable listener; this  causes  problems
2039       for  messages  actually  using 8-bit ISO or KOI-8 character sets, which
2040       will be garbled by having the high bits of all characters stripped.  If
2041       'pass8bits'  is on, fetchmail is forced to declare BODY=8BITMIME to any
2042       ESMTP-capable listener.  If the listener is  8-bit-clean  (as  all  the
2043       major ones now are) the right thing will probably result.
2044
2045       The 'dropstatus' option controls whether nonempty Status and X-Mozilla-
2046       Status lines are retained in fetched mail (the default)  or  discarded.
2047       Retaining  them  allows  your  MUA  to  see what messages (if any) were
2048       marked seen on the server.  On the other hand, it can confuse some new-
2049       mail notifiers, which assume that anything with a Status line in it has
2050       been seen.  (Note: the empty Status lines inserted by  some  buggy  POP
2051       servers are unconditionally discarded.)
2052
2053       The  'dropdelivered'  option controls whether Delivered-To headers will
2054       be kept in fetched mail (the default) or discarded. These  headers  are
2055       added by Qmail and Postfix mailservers in order to avoid mail loops but
2056       may get in your way if you try to "mirror" a mailserver within the same
2057       domain. Use with caution.
2058
2059       The  'mimedecode'  option  controls  whether  MIME  messages  using the
2060       quoted-printable encoding are automatically converted into  pure  8-bit
2061       data.  If you are delivering mail to an ESMTP-capable, 8-bit-clean lis‐
2062       tener (that includes all of the major MTAs like  sendmail),  then  this
2063       will  automatically  convert  quoted-printable message headers and data
2064       into 8-bit data, making it easier to understand when reading  mail.  If
2065       your  e-mail  programs  know  how to deal with MIME messages, then this
2066       option is not needed.  The mimedecode option is off by default, because
2067       doing  RFC2047 conversion on headers throws away character-set informa‐
2068       tion and can lead to bad results if the encoding of the headers differs
2069       from the body encoding.
2070
2071       The  'idle'  option is intended to be used with IMAP servers supporting
2072       the RFC2177 IDLE command extension, but does not strictly  require  it.
2073       If it is enabled, and fetchmail detects that IDLE is supported, an IDLE
2074       will be issued at the end of each poll.  This will tell the IMAP server
2075       to  hold  the  connection  open  and notify the client when new mail is
2076       available.  If IDLE is not supported, fetchmail  will  simulate  it  by
2077       periodically  issuing NOOP. If you need to poll a link frequently, IDLE
2078       can save bandwidth by  eliminating  TCP/IP  connects  and  LOGIN/LOGOUT
2079       sequences. On the other hand, an IDLE connection will eat almost all of
2080       your fetchmail's time, because it will never drop  the  connection  and
2081       allow  other  polls  to occur unless the server times out the IDLE.  It
2082       also doesn't work with multiple folders; only  the  first  folder  will
2083       ever be polled.
2084
2085
2086       The  'properties'  option is an extension mechanism.  It takes a string
2087       argument, which is ignored by fetchmail itself.   The  string  argument
2088       may  be  used  to  store  configuration  information  for scripts which
2089       require it.  In particular, the output of  '--configdump'  option  will
2090       make  properties  associated  with  a user entry readily available to a
2091       Python script.
2092
2093   Miscellaneous Run Control Options
2094       The words 'here' and 'there'  have  useful  English-like  significance.
2095       Normally  'user  eric  is esr' would mean that mail for the remote user
2096       'eric' is to be delivered to 'esr', but you can make  this  clearer  by
2097       saying 'user eric there is esr here', or reverse it by saying 'user esr
2098       here is eric there'
2099
2100       Legal protocol identifiers for use with the 'protocol' keyword are:
2101
2102           auto (or AUTO) (legacy, to be removed from future release)
2103           pop2 (or POP2) (legacy, to be removed from future release)
2104           pop3 (or POP3)
2105           sdps (or SDPS)
2106           imap (or IMAP)
2107           apop (or APOP)
2108           kpop (or KPOP)
2109
2110
2111       Legal authentication types are  'any',  'password',  'kerberos',  'ker‐
2112       beros_v4',  'kerberos_v5'  and 'gssapi', 'cram-md5', 'otp', 'msn' (only
2113       for POP3), 'ntlm', 'ssh', 'external' (only IMAP).  The 'password'  type
2114       specifies  authentication  by  normal  transmission  of a password (the
2115       password may be plain text or subject to  protocol-specific  encryption
2116       as  in  CRAM-MD5);  'kerberos' tells fetchmail to try to get a Kerberos
2117       ticket at the start of each query instead, and send an arbitrary string
2118       as the password; and 'gssapi' tells fetchmail to use GSSAPI authentica‐
2119       tion.  See the description of the 'auth' keyword for more.
2120
2121       Specifying 'kpop' sets POP3 protocol over port 1109  with  Kerberos  V4
2122       authentication.  These defaults may be overridden by later options.
2123
2124       There  are  some  global option statements: 'set logfile' followed by a
2125       string sets the same global specified  by  --logfile.   A  command-line
2126       --logfile option will override this. Note that --logfile is only effec‐
2127       tive if fetchmail detaches itself from the  terminal  and  the  logfile
2128       already  exists  before  fetchmail is run, and it overrides --syslog in
2129       this case.  Also, 'set daemon' sets the poll interval as --daemon does.
2130       This can be overridden by a command-line --daemon option; in particular
2131       --daemon 0 can be used to force foreground operation. The 'set postmas‐
2132       ter'  statement  sets  the  address to which multidrop mail defaults if
2133       there are no local matches.  Finally, 'set syslog' sends  log  messages
2134       to syslogd(8).
2135
2136

DEBUGGING FETCHMAIL

2138   Fetchmail crashing
2139       There are various ways in that fetchmail may "crash", i. e. stop opera‐
2140       tion suddenly and unexpectedly. A "crash" usually refers  to  an  error
2141       condition  that  the  software  did  not handle by itself. A well-known
2142       failure mode is the "segmentation fault" or "signal 11" or "SIGSEGV" or
2143       just  "segfault" for short. These can be caused by hardware or by soft‐
2144       ware problems. Software-induced segfaults  can  usually  be  reproduced
2145       easily and in the same place, whereas hardware-induced segfaults can go
2146       away if the computer is rebooted, or powered off for a few  hours,  and
2147       can  happen  in  random locations even if you use the software the same
2148       way.
2149
2150       For solving hardware-induced segfaults, find the faulty  component  and
2151       repair  or  replace it.  The Sig11 FAQ ⟨http://www.bitwizard.nl/sig11/
2152       may help you with details.
2153
2154       For solving software-induced  segfaults,  the  developers  may  need  a
2155       "stack backtrace".
2156
2157
2158   Enabling fetchmail core dumps
2159       By  default,  fetchmail  suppresses  core  dumps as these might contain
2160       passwords and other  sensitive  information.  For  debugging  fetchmail
2161       crashes,  obtaining  a  "stack backtrace" from a core dump is often the
2162       quickest way to solve the problem, and when posting your problem  on  a
2163       mailing list, the developers may ask you for a "backtrace".
2164
2165       1.  To  get  useful backtraces, fetchmail needs to be installed without
2166       getting stripped  of  its  compilation  symbols.   Unfortunately,  most
2167       binary  packages  that  are installed are stripped, and core files from
2168       symbol-stripped programs are worthless. So you may  need  to  recompile
2169       fetchmail. On many systems, you can type
2170
2171               file `which fetchmail`
2172
2173       to  find  out  if  fetchmail  was  symbol-stripped or not. If yours was
2174       unstripped, fine, proceed, if it was stripped, you  need  to  recompile
2175       the  source code first. You do not usually need to install fetchmail in
2176       order to debug it.
2177
2178       2. The shell environment that starts fetchmail  needs  to  enable  core
2179       dumps.  The  key  is the "maximum core (file) size" that can usually be
2180       configured with a tool named "limit" or "ulimit". See the documentation
2181       for  your  shell  for  details.  In the popular bash shell, "ulimit -Sc
2182       unlimited" will allow the core dump.
2183
2184       3. You need to tell fetchmail, too, to allow core dumps.  To  do  this,
2185       run  fetchmail with the -d0 -v options.  It is often easier to also add
2186       --nosyslog -N as well.
2187
2188       Finally, you need to reproduce the crash. You can just start  fetchmail
2189       from  the directory where you compiled it by typing ./fetchmail, so the
2190       complete command line will start with ./fetchmail -Nvd0 --nosyslog  and
2191       perhaps list your other options.
2192
2193       After the crash, run your debugger to obtain the core dump.  The debug‐
2194       ger will often be GNU GDB, you can then type (adjust  paths  as  neces‐
2195       sary) gdb ./fetchmail fetchmail.core and then, after GDB has started up
2196       and read all its files, type backtrace full, save the  output  (copy  &
2197       paste  will  do,  the  backtrace will be read by a human) and then type
2198       quit to leave gdb.  Note: on some systems, the core files have  differ‐
2199       ent  names, they might contain a number instead of the program name, or
2200       number and name, but it will usually have "core" as part of their name.
2201
2202

INTERACTION WITH RFC 822

2204       When trying to determine the originating address of a  message,  fetch‐
2205       mail looks through headers in the following order:
2206
2207               Return-Path:
2208               Resent-Sender: (ignored if it doesn't contain an @ or !)
2209               Sender: (ignored if it doesn't contain an @ or !)
2210               Resent-From:
2211               From:
2212               Reply-To:
2213               Apparently-From:
2214
2215       The  originating  address is used for logging, and to set the MAIL FROM
2216       address when forwarding to SMTP.  This order is intended to cope grace‐
2217       fully  with  receiving  mailing  list  messages  in multidrop mode. The
2218       intent is that if a local address doesn't  exist,  the  bounce  message
2219       won't  be  returned  blindly  to  the author or to the list itself, but
2220       rather to the list manager (which is less annoying).
2221
2222       In multidrop mode, destination headers are processed as follows: First,
2223       fetchmail  looks  for  the header specified by the 'envelope' option in
2224       order to  determine  the  local  recipient  address.  If  the  mail  is
2225       addressed  to  more than one recipient, the Received line won't contain
2226       any information regarding recipient addresses.
2227
2228       Then fetchmail looks for the Resent-To:,  Resent-Cc:,  and  Resent-Bcc:
2229       lines.   If  they  exist,  they should contain the final recipients and
2230       have precedence over their To:/Cc:/Bcc: counterparts.  If the  Resent-*
2231       lines  don't  exist,  the  To:,  Cc:, Bcc: and Apparently-To: lines are
2232       looked for. (The presence of a Resent-To: is taken to  imply  that  the
2233       person  referred  by  the To: address has already received the original
2234       copy of the mail.)
2235
2236

CONFIGURATION EXAMPLES

2238       Note that although there are password declarations in a  good  many  of
2239       the  examples below, this is mainly for illustrative purposes.  We rec‐
2240       ommend stashing account/password pairs in your $HOME/.netrc file, where
2241       they  can  be  used  not just by fetchmail but by ftp(1) and other pro‐
2242       grams.
2243
2244       The basic format is:
2245
2246
2247              poll SERVERNAME protocol PROTOCOL username NAME  password  PASS‐
2248              WORD
2249
2250
2251       Example:
2252
2253
2254              poll pop.provider.net protocol pop3 username "jsmith" password "secret1"
2255
2256
2257       Or, using some abbreviations:
2258
2259
2260              poll pop.provider.net proto pop3 user "jsmith" password "secret1"
2261
2262
2263       Multiple servers may be listed:
2264
2265
2266              poll pop.provider.net proto pop3 user "jsmith" pass "secret1"
2267              poll other.provider.net proto pop2 user "John.Smith" pass "My^Hat"
2268
2269
2270       Here's the same version with more whitespace and some noise words:
2271
2272
2273              poll pop.provider.net proto pop3
2274                   user "jsmith", with password secret1, is "jsmith" here;
2275              poll other.provider.net proto pop2:
2276                   user "John.Smith", with password "My^Hat", is "John.Smith" here;
2277
2278
2279       If  you  need  to include whitespace in a parameter string or start the
2280       latter with a number, enclose the string in double quotes.  Thus:
2281
2282
2283              poll mail.provider.net with proto pop3:
2284                   user "jsmith" there has password "4u but u can't krak this"
2285                   is jws here and wants mda "/bin/mail"
2286
2287
2288       You may have an  initial  server  description  headed  by  the  keyword
2289       'defaults'  instead  of  'poll'  followed  by a name.  Such a record is
2290       interpreted as defaults for all queries to use. It may  be  overwritten
2291       by individual server descriptions.  So, you could write:
2292
2293
2294              defaults proto pop3
2295                   user "jsmith"
2296              poll pop.provider.net
2297                   pass "secret1"
2298              poll mail.provider.net
2299                   user "jjsmith" there has password "secret2"
2300
2301
2302       It's  possible  to  specify  more than one user per server.  The 'user'
2303       keyword leads off a user description, and every user specification in a
2304       multi-user entry must include it.  Here's an example:
2305
2306
2307              poll pop.provider.net proto pop3 port 3111
2308                   user "jsmith" with pass "secret1" is "smith" here
2309                   user jones with pass "secret2" is "jjones" here keep
2310
2311
2312       This  associates  the  local username 'smith' with the pop.provider.net
2313       username  'jsmith'  and  the   local   username   'jjones'   with   the
2314       pop.provider.net  username  'jones'.   Mail  for 'jones' is kept on the
2315       server after download.
2316
2317
2318       Here's what a simple retrieval configuration for  a  multidrop  mailbox
2319       looks like:
2320
2321
2322              poll pop.provider.net:
2323                   user maildrop with pass secret1 to golux 'hurkle'='happy' snark here
2324
2325
2326       This  says  that  the  mailbox of account 'maildrop' on the server is a
2327       multidrop box, and that messages in it should be parsed for the  server
2328       user  names  'golux', 'hurkle', and 'snark'.  It further specifies that
2329       'golux' and 'snark' have the same name on the client as on the  server,
2330       but  mail  for  server user 'hurkle' should be delivered to client user
2331       'happy'.
2332
2333
2334       Note  that  fetchmail,  until  version  6.3.4,  did  NOT   allow   full
2335       user@domain  specifications  here,  these would never match.  Fetchmail
2336       6.3.5 and newer support user@domain  specifications  on  the  left-hand
2337       side of a user mapping.
2338
2339
2340       Here's an example of another kind of multidrop connection:
2341
2342
2343              poll pop.provider.net localdomains loonytoons.org toons.org
2344                   envelope X-Envelope-To
2345                   user maildrop with pass secret1 to * here
2346
2347
2348       This  also says that the mailbox of account 'maildrop' on the server is
2349       a multidrop box.  It tells fetchmail that any  address  in  the  loony‐
2350       toons.org  or  toons.org  domains  (including sub-domain addresses like
2351       'joe@daffy.loonytoons.org') should be passed through to the local  SMTP
2352       listener  without  modification.   Be  careful  of mail loops if you do
2353       this!
2354
2355
2356       Here's an example configuration using ssh and the plugin  option.   The
2357       queries  are  made  directly  on the stdin and stdout of imapd via ssh.
2358       Note that in this setup, IMAP authentication can be skipped.
2359
2360
2361              poll mailhost.net with proto imap:
2362                   plugin "ssh %h /usr/sbin/imapd" auth ssh;
2363                   user esr is esr here
2364
2365

THE USE AND ABUSE OF MULTIDROP MAILBOXES

2367       Use the multiple-local-recipients feature with caution -- it can  bite.
2368       All multidrop features are ineffective in ETRN and ODMR modes.
2369
2370       Also,  note  that  in multidrop mode duplicate mails are suppressed.  A
2371       piece of mail is considered duplicate if it has the same message-ID  as
2372       the  message  immediately  preceding and more than one addressee.  Such
2373       runs of messages may be generated when copies of a message addressed to
2374       multiple users are delivered to a multidrop box.
2375
2376
2377   Header vs. Envelope addresses
2378       The  fundamental problem is that by having your mailserver toss several
2379       peoples' mail in a single maildrop box, you may have thrown away poten‐
2380       tially  vital  information  about  who  each piece of mail was actually
2381       addressed  to  (the  'envelope  address',  as  opposed  to  the  header
2382       addresses in the RFC822 To/Cc headers - the Bcc is not available at the
2383       receiving end).  This 'envelope address' is the  address  you  need  in
2384       order to reroute mail properly.
2385
2386       Sometimes fetchmail can deduce the envelope address.  If the mailserver
2387       MTA is sendmail and the item of mail had just one  recipient,  the  MTA
2388       will  have  written a 'by/for' clause that gives the envelope addressee
2389       into its Received header. But this  doesn't  work  reliably  for  other
2390       MTAs,  nor  if there is more than one recipient.  By default, fetchmail
2391       looks for envelope addresses in  these  lines;  you  can  restore  this
2392       default with -E "Received" or 'envelope Received'.
2393
2394       As a better alternative, some SMTP listeners and/or mail servers insert
2395       a header in each message containing a copy of the  envelope  addresses.
2396       This  header  (when it exists) is often 'X-Original-To', 'Delivered-To'
2397       or 'X-Envelope-To'.  Fetchmail's assumption about this can  be  changed
2398       with the -E or 'envelope' option.  Note that writing an envelope header
2399       of this kind exposes the  names  of  recipients  (including  blind-copy
2400       recipients)  to  all  receivers  of  the messages, so the upstream must
2401       store one copy of the message per recipient to avoid becoming a privacy
2402       problem.
2403
2404       Postfix,  since version 2.0, writes an X-Original-To: header which con‐
2405       tains a copy of the envelope as it was received.
2406
2407       Qmail and Postfix generally write a 'Delivered-To' header upon deliver‐
2408       ing  the  message  to  the  mail  spool and use it to avoid mail loops.
2409       Qmail virtual domains however will prefix the user name with  a  string
2410       that  normally matches the user's domain. To remove this prefix you can
2411       use the -Q or 'qvirtual' option.
2412
2413       Sometimes, unfortunately, neither of these methods works.  That is  the
2414       point  when you should contact your ISP and ask them to provide such an
2415       envelope header, and you should not use multidrop  in  this  situation.
2416       When  they  all fail, fetchmail must fall back on the contents of To/Cc
2417       headers (Bcc headers are not available - see below) to try to determine
2418       recipient addressees -- and these are unreliable.  In particular, mail‐
2419       ing-list software often ships mail with only the list broadcast address
2420       in the To header.
2421
2422       Note that a future version of fetchmail may remove To/Cc parsing!
2423
2424       When fetchmail cannot deduce a recipient address that is local, and the
2425       intended recipient address was anyone other than  fetchmail's  invoking
2426       user,  mail  will  get  lost.  This is what makes the multidrop feature
2427       risky without proper envelope information.
2428
2429       A related problem is that when you blind-copy a mail message,  the  Bcc
2430       information  is carried only as envelope address (it's removed from the
2431       headers by the sending mail server, so fetchmail can  see  it  only  if
2432       there  is an X-Envelope-To header).  Thus, blind-copying to someone who
2433       gets mail over a fetchmail multidrop link  will  fail  unless  the  the
2434       mailserver  host routinely writes X-Envelope-To or an equivalent header
2435       into messages in your maildrop.
2436
2437       In conclusion, mailing lists and Bcc'd mail can only work if the server
2438       you're fetching from
2439
2440       (1)    stores one copy of the message per recipient in your domain and
2441
2442       (2)    records  the  envelope information in a special header (X-Origi‐
2443              nal-To, Delivered-To, X-Envelope-To).
2444
2445
2446   Good Ways To Use Multidrop Mailboxes
2447       Multiple local names can be used to administer a mailing list from  the
2448       client side of a fetchmail collection.  Suppose your name is 'esr', and
2449       you want to both pick up your own mail  and  maintain  a  mailing  list
2450       called  (say)  "fetchmail-friends", and you want to keep the alias list
2451       on your client machine.
2452
2453       On your server, you can alias 'fetchmail-friends' to  'esr';  then,  in
2454       your .fetchmailrc, declare 'to esr fetchmail-friends here'.  Then, when
2455       mail including 'fetchmail-friends' as a local address gets fetched, the
2456       list name will be appended to the list of recipients your SMTP listener
2457       sees.  Therefore it will undergo alias expansion locally.  Be  sure  to
2458       include  'esr'  in  the  local alias expansion of fetchmail-friends, or
2459       you'll never see mail sent only to the list.  Also be  sure  that  your
2460       listener  has  the  "me-too"  option  set (sendmail's -oXm command-line
2461       option or OXm declaration) so your name isn't removed from alias expan‐
2462       sions in messages you send.
2463
2464       This  trick  is not without its problems, however.  You'll begin to see
2465       this when a message comes in that is addressed only to a  mailing  list
2466       you  do not have declared as a local name.  Each such message will fea‐
2467       ture an 'X-Fetchmail-Warning' header which is generated because  fetch‐
2468       mail  cannot  find a valid local name in the recipient addresses.  Such
2469       messages default (as was described above) to being sent  to  the  local
2470       user  running fetchmail, but the program has no way to know that that's
2471       actually the right thing.
2472
2473
2474   Bad Ways To Abuse Multidrop Mailboxes
2475       Multidrop mailboxes and fetchmail serving multiple users in daemon mode
2476       do not mix.  The problem, again, is mail from mailing lists, which typ‐
2477       ically does not have an individual recipient address  on  it.    Unless
2478       fetchmail can deduce an envelope address, such mail will only go to the
2479       account running fetchmail (probably root).   Also,  blind-copied  users
2480       are very likely never to see their mail at all.
2481
2482       If  you're tempted to use fetchmail to retrieve mail for multiple users
2483       from a single mail drop via POP or IMAP, think again  (and  reread  the
2484       section  on  header and envelope addresses above).  It would be smarter
2485       to just let the mail sit in the mailserver's queue and use  fetchmail's
2486       ETRN  or ODMR modes to trigger SMTP sends periodically (of course, this
2487       means you have to poll more frequently  than  the  mailserver's  expiry
2488       period).  If you can't arrange this, try setting up a UUCP feed.
2489
2490       If  you  absolutely must use multidrop for this purpose, make sure your
2491       mailserver writes an envelope-address header that  fetchmail  can  see.
2492       Otherwise you will lose mail and it will come back to haunt you.
2493
2494
2495   Speeding Up Multidrop Checking
2496       Normally, when multiple users are declared fetchmail extracts recipient
2497       addresses as described above and checks each host part with DNS to  see
2498       if it's an alias of the mailserver.  If so, the name mappings described
2499       in the "to ... here" declaration are done and the mail  locally  deliv‐
2500       ered.
2501
2502       This is a convenient but also slow method.  To speed it up, pre-declare
2503       mailserver aliases with 'aka'; these are checked before DNS lookups are
2504       done.   If you're certain your aka list contains all DNS aliases of the
2505       mailserver (and all MX names pointing at it - note this may change in a
2506       future  version)  you  can  declare  'no  dns'  to suppress DNS lookups
2507       entirely and only match against the aka list.
2508
2509

SOCKS

2511       Support for socks4/5 is a compile time configuration option. Once  com‐
2512       piled  in, fetchmail will always use the socks libraries and configura‐
2513       tion on your system, there are no run-time switches in fetchmail -  but
2514       you  can  still configure SOCKS: you can specify which SOCKS configura‐
2515       tion file is used in the SOCKS_CONF environment variable.
2516
2517       For instance, if you wanted to bypass the SOCKS  proxy  altogether  and
2518       have    fetchmail    connect    directly,    you    could   just   pass
2519       SOCKS_CONF=/dev/null in the environment, for example  (add  your  usual
2520       command line options - if any - to the end of this line):
2521
2522       env SOCKS_CONF=/dev/null fetchmail
2523
2524

EXIT CODES

2526       To  facilitate  the  use  of fetchmail in shell scripts, an exit status
2527       code is returned to give an indication of what occurred during a  given
2528       connection.
2529
2530       The exit codes returned by fetchmail are as follows:
2531
2532       0      One  or more messages were successfully retrieved (or, if the -c
2533              option was selected, were found waiting but not retrieved).
2534
2535       1      There was no mail awaiting retrieval.  (There may have been  old
2536              mail still on the server but not selected for retrieval.) If you
2537              do not want "no mail" to be an error  condition  (for  instance,
2538              for cron jobs), use a POSIX-compliant shell and add
2539
2540              || [ $? -eq 1 ]
2541
2542              to  the end of the fetchmail command line, note that this leaves
2543              0 untouched, maps 1 to 0, and maps all other  codes  to  1.  See
2544              also item #C8 in the FAQ.
2545
2546       2      An  error  was  encountered  when attempting to open a socket to
2547              retrieve mail.  If you don't know what a socket is, don't  worry
2548              about  it  -- just treat this as an 'unrecoverable error'.  This
2549              error can also be because a protocol fetchmail wants to  use  is
2550              not listed in /etc/services.
2551
2552       3      The  user authentication step failed.  This usually means that a
2553              bad user-id, password, or APOP id was specified.  Or it may mean
2554              that you tried to run fetchmail under circumstances where it did
2555              not have standard input attached to a  terminal  and  could  not
2556              prompt for a missing password.
2557
2558       4      Some sort of fatal protocol error was detected.
2559
2560       5      There  was  a  syntax  error in the arguments to fetchmail, or a
2561              pre- or post-connect command failed.
2562
2563       6      The run control file had bad permissions.
2564
2565       7      There was an error condition reported by the server.   Can  also
2566              fire if fetchmail timed out while waiting for the server.
2567
2568       8      Client-side  exclusion error.  This means fetchmail either found
2569              another copy of itself already running, or failed in such a  way
2570              that it isn't sure whether another copy is running.
2571
2572       9      The user authentication step failed because the server responded
2573              "lock busy".  Try again after a brief pause!  This error is  not
2574              implemented  for  all  protocols,  nor  for all servers.  If not
2575              implemented for your server, "3" will be returned  instead,  see
2576              above.  May be returned when talking to qpopper or other servers
2577              that can respond with "lock busy" or some similar text  contain‐
2578              ing the word "lock".
2579
2580       10     The fetchmail run failed while trying to do an SMTP port open or
2581              transaction.
2582
2583       11     Fatal DNS error.  Fetchmail encountered an error while  perform‐
2584              ing a DNS lookup at startup and could not proceed.
2585
2586       12     BSMTP batch file could not be opened.
2587
2588       13     Poll terminated by a fetch limit (see the --fetchlimit option).
2589
2590       14     Server busy indication.
2591
2592       23     Internal error.  You should see a message on standard error with
2593              details.
2594
2595       24 - 26, 28, 29
2596              These are internal codes and should not appear externally.
2597
2598       When fetchmail queries more than one host, return status is  0  if  any
2599       query  successfully retrieved mail. Otherwise the returned error status
2600       is that of the last host queried.
2601
2602

FILES

2604       ~/.fetchmailrc, $HOME/.fetchmailrc, $HOME_ETC/.fetchmailrc, $FETCHMAIL‐
2605       HOME/fetchmailrc
2606            default run control file (location can be overridden with environ‐
2607            ment variables)
2608
2609       ~/.fetchids,    $HOME/.fetchids,    $HOME_ETC/.fetchids,    $FETCHMAIL‐
2610       HOME/.fetchids
2611            default  location  of  file  recording  last message UIDs seen per
2612            host.  (location can be overridden with environment variables)
2613
2614       ~/.fetchmail.pid,    $HOME/.fetchmail.pid,    $HOME_ETC/.fetchmail.pid,
2615       $FETCHMAILHOME/fetchmail.pid
2616            default  location  of  lock  file  to help prevent concurrent runs
2617            (non-root mode).  (location can  be  overridden  with  environment
2618            variables)
2619
2620       ~/.netrc, $HOME/.netrc, $HOME_ETC/.netrc
2621            your FTP run control file, which (if present) will be searched for
2622            passwords as a last resort before prompting for one interactively.
2623            (location can be overridden with environment variables)
2624
2625       /var/run/fetchmail.pid
2626            lock  file  to help prevent concurrent runs (root mode, Linux sys‐
2627            tems).
2628
2629       /etc/fetchmail.pid
2630            lock file to help prevent  concurrent  runs  (root  mode,  systems
2631            without /var/run).
2632
2633

ENVIRONMENT

2635       FETCHMAILHOME
2636              If  this  environment  variable  is  set to a valid and existing
2637              directory name, fetchmail will  read  $FETCHMAILHOME/fetchmailrc
2638              (the  dot  is  missing  in  this case), $FETCHMAILHOME/.fetchids
2639              (keeping its dot) and $FETCHMAILHOME/fetchmail.pid (without dot)
2640              rather  than from the user's home directory.  The .netrc file is
2641              always looked for in the the invoking user's home directory  (or
2642              $HOME_ETC) regardless of FETCHMAILHOME's setting.
2643
2644
2645       FETCHMAILUSER
2646              If  this  environment variable is set, it is used as the name of
2647              the calling user (default local name) for purposes such as mail‐
2648              ing  error  notifications.   Otherwise, if either the LOGNAME or
2649              USER variable is  correctly  set  (e.g.  the  corresponding  UID
2650              matches  the  session  user  ID)  then  that name is used as the
2651              default local name.   Otherwise  getpwuid(3)  must  be  able  to
2652              retrieve  a  password  entry  for the session ID (this elaborate
2653              logic is designed to handle  the  case  of  multiple  names  per
2654              userid gracefully).
2655
2656
2657       FETCHMAIL_DISABLE_CBC_IV_COUNTERMEASURE
2658              (since  v6.3.22):  If  this  environment variable is set and not
2659              empty, fetchmail will disable a countermeasure  against  an  SSL
2660              CBC  IV  attack (by setting SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS).
2661              This is a security risk, but may be necessary for connecting  to
2662              certain  non-standards-conforming servers.  See fetchmail's NEWS
2663              file and fetchmail-SA-2012-01.txt for details.   Earlier  fetch‐
2664              mail  versions (v6.3.21 and older) used to disable this counter‐
2665              measure, but v6.3.22 no longer does that as a safety precaution.
2666
2667
2668       FETCHMAIL_POP3_FORCE_RETR
2669              (since v6.3.9): If this environment variable is defined  at  all
2670              (even  if  empty), fetchmail will forgo the POP3 TOP command and
2671              always use RETR. This can be used as a workaround when TOP  does
2672              not work properly.
2673
2674
2675       FETCHMAIL_INCLUDE_DEFAULT_X509_CA_CERTS
2676              (since  v6.3.17):  If  this  environment variable is set and not
2677              empty, fetchmail will always load the default X.509 trusted cer‐
2678              tificate   locations   for  SSL/TLS  CA  certificates,  even  if
2679              --sslcertfile and --sslcertpath are given.  The latter locations
2680              take precedence over the system default locations.  This is use‐
2681              ful in case there are broken certificates in the system directo‐
2682              ries  and the user has no administrator privileges to remedy the
2683              problem.
2684
2685
2686       HOME   (documented since 6.4.1): This variable is nomally  set  to  the
2687              user's  home  directory.  If  it is set to a different directory
2688              than what is the password database, HOME takes prececence.
2689
2690
2691       HOME_ETC
2692              (documented corrected to match behaviour code since  6.4.1):  If
2693              the  HOME_ETC variable is set, it will override fetchmail's idea
2694              of $HOME, i. e. fetchmail  will  read  .fetchmailrc,  .fetchids,
2695              .fetchmail.pid and .netrc from $HOME_ETC instead of $HOME (or if
2696              HOME is also unset, from the passwd file's home directory  loca‐
2697              tion).
2698
2699              If  HOME_ETC and FETCHMAILHOME are both set, FETCHMAILHOME takes
2700              prececence and HOME_ETC will be ignored.
2701
2702
2703       SOCKS_CONF
2704              (only if SOCKS support is compiled in) this variable is used  by
2705              the socks library to find out which configuration file it should
2706              read. Set this to /dev/null to bypass the SOCKS proxy.
2707
2708

SIGNALS

2710       If a fetchmail daemon is running as root, SIGUSR1 wakes it up from  its
2711       sleep  phase and forces a poll of all non-skipped servers. For compati‐
2712       bility reasons, SIGHUP can also be used in 6.3.X but may not be  avail‐
2713       able in future fetchmail versions.
2714
2715       If fetchmail is running in daemon mode as non-root, use SIGUSR1 to wake
2716       it (this is so SIGHUP due to logout can retain the  default  action  of
2717       killing it).
2718
2719       Running fetchmail in foreground while a background fetchmail is running
2720       will do whichever of these is appropriate to wake it up.
2721
2722

BUGS, LIMITATIONS, AND KNOWN PROBLEMS

2724       Please check the NEWS file that shipped with fetchmail for  more  known
2725       bugs than those listed here.
2726
2727       Fetchmail  cannot  handle  user  names  that contain blanks after a "@"
2728       character, for instance "demonstr@ti on". These are rather uncommon and
2729       only  hurt when using UID-based --keep setups, so the 6.3.X versions of
2730       fetchmail won't be fixed.
2731
2732       Fetchmail cannot handle configurations where you have multiple accounts
2733       that  use the same server name and the same login. Any user@server com‐
2734       bination must be unique.
2735
2736       The assumptions that the DNS and in particular the  checkalias  options
2737       make  are  not  often sustainable. For instance, it has become uncommon
2738       for an MX server to be a POP3 or IMAP server at the same  time.  There‐
2739       fore the MX lookups may go away in a future release.
2740
2741       The  mda  and plugin options interact badly.  In order to collect error
2742       status from the MDA, fetchmail has to change its normal signal handling
2743       so  that  dead  plugin  processes don't get reaped until the end of the
2744       poll cycle.  This can cause resource starvation  if  too  many  zombies
2745       accumulate.   So  either  don't  deliver to a MDA using plugins or risk
2746       being overrun by an army of undead.
2747
2748       The --interface option does not support IPv6 and it is doubtful  if  it
2749       ever  will,  since  there  is  no  portable way to query interface IPv6
2750       addresses.
2751
2752       The RFC822 address  parser  used  in  multidrop  mode  chokes  on  some
2753       @-addresses  that  are  technically legal but bizarre.  Strange uses of
2754       quoting and embedded comments are likely to confuse it.
2755
2756       In a message with multiple envelope headers, only  the  last  one  pro‐
2757       cessed will be visible to fetchmail.
2758
2759       Use  of  some  of  these protocols requires that the program send unen‐
2760       crypted passwords over the TCP/IP connection to the  mailserver.   This
2761       creates a risk that name/password pairs might be snaffled with a packet
2762       sniffer or more sophisticated monitoring  software.   Under  Linux  and
2763       FreeBSD,  the  --interface  option  can  be used to restrict polling to
2764       availability of a specific interface device with a  specific  local  or
2765       remote  IP  address,  but snooping is still possible if (a) either host
2766       has a network device that can be opened in promiscuous mode, or (b) the
2767       intervening network link can be tapped.  We recommend the use of ssh(1)
2768       tunnelling to not only shroud your passwords  but  encrypt  the  entire
2769       conversation.
2770
2771       Use  of  the  %F  or  %T escapes in an mda option could open a security
2772       hole, because they pass text manipulable by an attacker to a shell com‐
2773       mand.  Potential shell characters are replaced by '_' before execution.
2774       The hole is further reduced by the fact that fetchmail temporarily dis‐
2775       cards any suid privileges it may have while running the MDA.  For maxi‐
2776       mum safety, however, don't use an mda command containing %F or %T  when
2777       fetchmail is run from the root account itself.
2778
2779       Fetchmail's  method  of  sending bounces due to errors or spam-blocking
2780       and spam bounces requires that port 25 of localhost  be  available  for
2781       sending mail via SMTP.
2782
2783       If you modify ~/.fetchmailrc while a background instance is running and
2784       break the syntax, the background instance will die silently.   Unfortu‐
2785       nately,  it  can't die noisily because we don't yet know whether syslog
2786       should be enabled.  On some systems, fetchmail  dies  quietly  even  if
2787       there is no syntax error; this seems to have something to do with buggy
2788       terminal ioctl code in the kernel.
2789
2790       The -f - option (reading a configuration from  stdin)  is  incompatible
2791       with the plugin option.
2792
2793       The 'principal' option only handles Kerberos IV, not V.
2794
2795       Interactively  entered  passwords are truncated after 63 characters. If
2796       you really need to use a longer password, you will have to use  a  con‐
2797       figuration file.
2798
2799       A  backslash  as  the  last  character  of a configuration file will be
2800       flagged as a syntax error rather than ignored.
2801
2802       The BSMTP error handling is virtually nonexistent and may leave  broken
2803       messages behind.
2804
2805       Send comments, bug reports, gripes, and the like to the fetchmail-devel
2806       list ⟨fetchmail-devel@lists.sourceforge.net⟩
2807
2808
2809       An HTML  FAQ  ⟨http://fetchmail.sourceforge.net/fetchmail-FAQ.html⟩  is
2810       available  at  the  fetchmail  home page, it should also accompany your
2811       installation.
2812
2813

AUTHOR

2815       Fetchmail is currently maintained by Matthias Andree and Rob Funk  with
2816       major  assistance  from  Sunil Shetye (for code) and Rob MacGregor (for
2817       the mailing lists).
2818
2819       Most of the code is from Eric S. Raymond ⟨esr@snark.thyrsus.com⟩ .  Too
2820       many other people to name here have contributed code and patches.
2821
2822       This  program  is descended from and replaces popclient, by Carl Harris
2823       ⟨ceharris@mal.com⟩ ; the internals have  become  quite  different,  but
2824       some  of  its  interface design is directly traceable to that ancestral
2825       program.
2826
2827       This manual page has been improved by Matthias Andree, R. Hannes  Bein‐
2828       ert, and Héctor García.
2829
2830

SEE ALSO

2832       README, README.SSL, README.SSL-SERVER, The Fetchmail FAQ ⟨http://
2833       www.fetchmail.info/fetchmail-FAQ.html⟩, mutt(1), elm(1), mail(1), send‐
2834       mail(8), popd(8), imapd(8), netrc(5).
2835
2836
2837       The fetchmail home page.  ⟨http://www.fetchmail.info/
2838
2839
2840       The fetchmail home page (alternative URI).  ⟨http://
2841       fetchmail.sourceforge.net/⟩
2842
2843
2844       The maildrop home page.  ⟨http://www.courier-mta.org/maildrop/
2845
2846

APPLICABLE STANDARDS

2848       Note that this list is just a collection of references and not a state‐
2849       ment  as  to  the actual protocol conformance or requirements in fetch‐
2850       mail.
2851
2852       SMTP/ESMTP:
2853            RFC 821, RFC 2821, RFC 1869, RFC 1652, RFC  1870,  RFC  1983,  RFC
2854            1985, RFC 2554.
2855
2856       mail:
2857            RFC 822, RFC 2822, RFC 1123, RFC 1892, RFC 1894.
2858
2859       POP2:
2860            RFC 937
2861
2862       POP3:
2863            RFC  1081,  RFC  1225, RFC 1460, RFC 1725, RFC 1734, RFC 1939, RFC
2864            1957, RFC 2195, RFC 2449.
2865
2866       APOP:
2867            RFC 1939.
2868
2869       RPOP:
2870            RFC 1081, RFC 1225.
2871
2872       IMAP2/IMAP2BIS:
2873            RFC 1176, RFC 1732.
2874
2875       IMAP4/IMAP4rev1:
2876            RFC 1730, RFC 1731, RFC 1732, RFC 2060, RFC 2061,  RFC  2195,  RFC
2877            2177, RFC 2683.
2878
2879       ETRN:
2880            RFC 1985.
2881
2882       ODMR/ATRN:
2883            RFC 2645.
2884
2885       OTP: RFC 1938.
2886
2887       LMTP:
2888            RFC 2033.
2889
2890       GSSAPI:
2891            RFC 1508, RFC 1734, Generic Security Service Application Program
2892            Interface (GSSAPI)/Kerberos/Simple Authentication and Security
2893            Layer (SASL) Service Names ⟨http://www.iana.org/assignments/
2894            gssapi-service-names/⟩.
2895
2896       TLS: RFC 2595.
2897
2898
2899
2900fetchmail                       fetchmail 6.4.1                   fetchmail(1)
Impressum