• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL



fetchmail Fetches mail from a POP-, IMAP-, or ETRN-capable server.
fetchmail [options] [<mailserver>...]


fetchmail fetches mail from remote servers and delivers it to your local machine. The retrieved mail can be read via conventional programs, such as mail or elm. fetchmail can be run in daemon mode to repeatedly poll one or more servers at a specified interval.
If fetchmailconf is available, it can be used to assist in setting up and editing your .fetchmailrc configuration file. fetchmailconf runs under the X Window System and requires pythong and tk. If fetchmailconf is not available, you can also use a text editor to create your .fetchmailrc file.
fetchmail can be run at the command line, but the preferred way is through the .fetchmailrc file in your home directory. See the fetchmail man page for details on setting up a .fetchmailrc file.
If you run fetchmail at the command line and also have a .fetchmailrc file, options specified in the command line override specifications in the .fetchmailrc. Each server that you specify on the command line will be queried according to the options given. If no server is specified, each poll entry of the .fetchmailrc is queried.
Almost all the options have a corresponding keyword that can be used to declare them in the .fetchmailrc. The following options rarely have to be used at the command line after you have a working .fetchmailrc.
—help Displays a list of options with brief descriptions.
—version Displays version information.
—check Checks for messages without fetching them.
—silent Silent mode. Suppresses progress/status and error messages. Is overridden by -verbose.
—verbose Verbose mode. Produces diagnostic output. Overrides -silent. Doubling the option (-v -v) causes extra diagnostic information to be printed.
—daemon Runs as a daemon once per n seconds.
—nodetach Does not detach daemon process.
—quit Kills daemon process.
—logfile Specifies logfile name.
—syslog Uses syslog(3) for most messages when running as a daemon.
—invisible Does not write Received and enables host spoofing.
—postmaster Specifies last resort recipient.
—nobounce Redirects bounces from user to postmaster.
—all Retrieves all messages, both read and unread. Default is to retrieve only unread messages.
—keep Saves new messages after retrieval. Default is to delete messages from the server after they have been retrieved. This does not work with ETRN.
—nokeep Deletes new messages after retrieval. Useful if you have specified a default of -keep in .fetchmailrc. Option is forced on with ETRN.
—flush POP/IMAP only. Deletes previously retrieved messages from server. Does not work with ETRN. If your MTA hangs and fetchmail is aborted, the next time you run fetchmail, it will delete the messages that were not delivered to you. The -keep option is recommended instead.
-p <proto>  
—protocol <proto> Specifies retrieval protocol to use when retrieving mail from the remote server. If no protocol is specified AUTO is assumed. See man page for list of protocols.
—uidl Forces UIDL (unique ID listing) use (POP3 only). Forces client-side tracking of newness of messages.
—port Specifies TCP/IP port for making connection. Rarely necessary, as the protocols have well-established default port numbers.
—timeout Specifies server nonresponse timeout in seconds.
—plugin Specifies external command to open TCP connection. Useful for using socks or a special firewall setup.
—plugout Specifies external command to open SMTP connection.
-r <folder>  
—folder <folder> Specifies remote folder name.
-S <hosts>  
—smtphost <hosts> Specifies a hunt list of SMTP forwarding hosts.
-D <domain>  
—smptaddress <domain> Sets SMTP delivery domain to use.
-Z <nnn>  
—antispam <nnn>[,<nnn>[,<nnn>…] Sets antispam response values. A value of -1 disables this option. For the command-line option, list should be a comma-separated list.
—mda Forces mail to be passed to an MDA directly rather than forwarded to port 25. Not recommended unless running an SMTP listener is impossible.
—lmtp Uses LMTP (Local Mail Transfer Protocol, RFC2033) for delivery. Service port must be specified because the default port 25 will not be accepted.
—bsmtp Appends fetched mail to a BSMTP file. File contains the SMTP commands that would normally be generated by fetchmail when passing mail to an SMTP listener daemon.
—limit Does not fetch messages larger a specified size. Takes a maximum octet size as argument. Does not work with ETRN.
—warnings Interval in seconds between warning mail notification.
—batchlimit Sets batch limit for SMTP connections. Default is 0, no limit.
—fetchlimit Sets fetch limit for number of messages accepted from a given server in a single poll. Does not work with ETRN.
—expunge Makes deletions final after a given number of messages. Does not work with ETRN.
-u <name>  
—username <name> Specifies user identification to be used when logging in to the mailserver. Default is login name on the client machine running fetchmail.
—preauth Specifies preauthentication type. Possible values are password, kerberos_v5, or kerberos.
-f <pathname>  
—fetchmailrc <pathname> Specifies an alternative run control file. Unless -version is also on, the name file must have permissions no more open than 0600 or else be /dev/null.
-i <pathname>  
—iidfile <pathname> Specifies alternative name for the .fetchids file used to save POP3 UIDs.
—norewrite Does not rewrite header addresses. Normally fetches rewrite headers in fetched mail so that any mail IDs local to the server are expanded to full addresses so that replies on the client are addressed correctly, rather than to the local users.
—envelope Changes the header that fetchmail assumes will carry a copy of the mail's envelope address.
—qvirtual Prefix to remove from local user ID. Useful if you are using fetchmail to retrieve mail for an entire domain and your ISP is using qmail.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint