logo: a hand presenting an envelope

Fetchmail

ADDITIONAL FIXES FOR FETCHMAIL 6.3.8 RELEASE

New 2008-06-17: After the fetchmail-6.3.8 release described below, two denial-of-service vulnerabilities (CVE-2007-4565) were discovered, but a new release is not yet available. Patches are parts of the security announcements:

On 2008-04-24, the FAQ (also available as PDF), manual page and fetchmail-SA-2007-01.txt (CVE-2007-1558) have been revised.

On 2007-04-06, fetchmail-6.3.8 was released (this is the download link), fixing up further fallout from the CVE-2006-5867 fix, fixing long-standing bugs, and strengthening the APOP client in response to CVE-2007-1558. Click here to see the change details.

FETCHMAIL 6.2.X UNSUPPORTED AND VULNERABLE - USE 6.3.X INSTEAD

fetchmail 6.2.X versions are susceptible to CVE-2006-5867 and CVE-2007-1558 and should be replaced by the most current 6.3.X version. Support has been discontinued as of 2006-01-22.

SECURITY ALERTS

NEW CVE-2008-2711: Fetchmail can crash in verbose mode when logging long message headers. This bug will be fixed in release 6.3.9. For the nonce, use the patch contained in the security announcement.

CVE-2007-4565: Fetchmail can crash when the SMTP server refuses a warning message generated by fetchmail. This bug was introduced in fetchmail 4.6.8 and will be fixed in release 6.3.9. For the nonce, use the patch contained in this security announcement.

CVE-2007-1558: Fetchmail's APOP client was found to validate APOP challenges insufficiently, making man-in-the-middle attacks on APOP secrets unnecessarily easier than need be. This bug was long-standing, fetchmail 6.3.8 validates the APOP challenge stricter.

CVE-2006-5974: Fetchmail was found to crash when refusing a message that was bound to be delivered by an MDA. This bug was introduced into fetchmail 6.3.5 and fixed in 6.3.6.

CVE-2006-5867: Fetchmail was found to omit TLS or send the password in clear text despite the configuration stating otherwise. This was a long-standing bug reported by Isaac Wilcox, fixed in fetchmail 6.3.6. There will be no 6.2.X releases to fix this bug in 6.2.X.

CVE-2006-0321: Fetchmail was found to crash after bouncing a message with bad addresses. This bug was introduced with fetchmail 6.3.0 and fixed in fetchmail 6.3.2.

CVE-2005-4348: Fetchmail was found to contain a bug (null pointer dereference) that can be exploited to a denial of service attack when fetchmail runs in multidrop mode. 6.2.5.5 and 6.3.1 have this bug fixed.

CVE-2005-3088: Fetchmailconf was found to open the configuration files world-readable, writing data to them, and only then tightening up permissions, which may cause password information to be visible to other users. This bug affected fetchmail 6.2.0, 6.2.5 and 6.2.5.2. The bug is fixed in fetchmail 6.2.5.4 and 6.3.0.

CVE-2005-2335: Fetchmail was found to contain a remotely exploitable code injection vulnerability (potentially privileged code) in the POP3 code, affecting both the 6.2.0 and 6.2.5 releases. 6.2.5.2, 6.2.5.4 and 6.3.0 have got this bug fixed. (Other versions have not been checked if they contain this bug.)

Please update to fetchmail version 6.3.8 and apply the two patches from the security announcements CVE-2007-4565 and CVE-2008-2711 above.

What fetchmail does:

Fetchmail is a full-featured, robust, well-documented remote-mail retrieval and forwarding utility intended to be used over on-demand TCP/IP links (such as SLIP or PPP connections). It supports every remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP, KPOP, all flavors of IMAP, ETRN, and ODMR. It can even support IPv6 and IPSEC.

Fetchmail retrieves mail from remote mail servers and forwards it via SMTP, so it can then be read by normal mail user agents such as mutt, elm(1) or BSD Mail. It allows all your system MTA's filtering, forwarding, and aliasing facilities to work just as they would on normal mail.

Fetchmail offers better protection against password-sniffing than any other Unix remote-mail client. It supports APOP, KPOP, OTP, Compuserve RPA, Microsoft NTLM, and IMAP RFC1731 encrypted authentication methods including CRAM-MD5 to avoid sending passwords en clair. It can be configured to support end-to-end encryption via tunneling with ssh, the Secure Shell.

Fetchmail can be used as a POP/IMAP-to-SMTP gateway for an entire DNS domain, collecting mail from a single drop box on an ISP and SMTP-forwarding it based on header addresses. (We don't really recommend this, though, as it may lose important envelope-header information. ETRN or a UUCP connection is better.)

Fetchmail can be started automatically and silently as a system daemon at boot time. When running in this mode with a short poll interval, it is pretty hard for anyone to tell that the incoming mail link is not a full-time "push" connection.

Fetchmail is easy to configure. You can edit its dotfile directly, or use the interactive GUI configurator (fetchmailconf) supplied with the fetchmail distribution. It is also directly supported in linuxconf versions 1.16r8 and later.

Fetchmail is fast and lightweight. It packs all its standard features (POP3, IMAP, and ETRN support) in 196K of core on a Pentium under Linux.

Fetchmail is open-source and free software.

Where to find out more about fetchmail:

See the Fetchmail Feature List for more about what fetchmail does.

See the on-line manual page for basics.

See the HTML Fetchmail FAQ for troubleshooting help.

See the Fetchmail Design Notes for discussion of some of the design choices in fetchmail.

See the project's To-Do list for indications of known problems and requested features.

The developers use Subversion for revision control. To get the latest development version, point your subversion client at http://mknod.org/svn/fetchmail/trunk/.

See the project page for more, including downloads. (However, note that we no longer use the subversion repository that Berlios provides.)

Getting help with fetchmail:

There is a fetchmail-users list for help and other user discussion of fetchmail. It's a MailMan list, which you can sign up for at fetchmail-users@lists.berlios.de. There is also a fetchmail-devel list for people who want to discuss fixes and improvements in fetchmail and help co-develop it. That one is at fetchmail-devel@lists.berlios.de. Finally, there is an announcements-only list, fetchmail-announce@lists.berlios.de.

Note: before submitting a question to the lists, please read the FAQ (especially item G3 on how to report bugs). We tend to get the same three newbie questions over and over again. The FAQ covers them like a blanket.

Maintainer History

Fetchmail originated as a program called popclient, written by Carl Harris. In 1996, Eric S. Raymond took over; he soon renamed the program to fetchmail after adding IMAP support.

In 2004 a new team took over, led by Rob Funk, Graham Wilson, and Matthias Andree. Since then, Graham Wilson has retreated, and Sunil Shetye has contributed several important pieces of code.

You can help improve fetchmail:

We welcome your code contributions. But even if you don't write code, you can help fetchmail improve.

If you administer a site that runs a post-office server, you may be able help improve fetchmail by lending us a test account on your site. Note that we do not need a shell account for this purpose, just a mailbox and a mail address. Nor are we interested in collecting maildrops per se -- what we're collecting is different kinds of servers.

Before each release, we run a test harness that sends date-stamped test mail to each site on our regression-test list, then tries to retrieve it. Please take a look at the list of test servers. If you can lend us an account on a kind of server that is not already on this list, please do.

Where you can use fetchmail:

The fetchmail code was developed under Linux, but has also been extensively tested under 4.4BSD, SunOS, Solaris, AIX, and NEXTSTEP. It should be readily portable to other Unix variants (it requires only POSIX plus BSD sockets, and uses GNU autoconf).

Fetchmail is supported only for Unix by its official maintainers. However, it is reported to build and run correctly under BeOS, AmigaOS, Rhapsody, and QNX as well. There is a CygWin port.

Related works

Similar software

fdm: A recently appeared software package that integrates basic filtering is Nicholas Marriott's fdm.

getmail: When fetchmail's development was stalled before the latest team took over, Charles Cazabon's getmail came along as an intended replacement. It still doesn't do everything that fetchmail does, and often suffers from Python library shortcomings, for instance when it comes to SSL, but it's close enough to give us a bit of competition.

animail: Another contender with integrated filtering is Juanjo Álvarez Martínez's Animail.

Complementary and extension software

Jochen Hayek is developing a set of IMAP tools in Python that read your .fetchmailrc file and are designed to work with fetchmail. Jochen's tools can report selected header lines, or move incoming messages to named mailboxes based on the contents of headers.

Peter Hawkins has written a script called gotmail that can retrieve Hotmail. Another script, yosucker, can retrieve Yahoo webmail.

There's a program called mailfilter which can be used to do spam filtering, that works particularly well called from fetchmail's preconnect directive.

A hacker identifying himself simply as 'Steines' has written a filter which rewrites the to-line with a line which only includes receipients for a given domain and renames the old to-line. It also rewrites the domain-part of addresses if the offical domain is different from the local domain. You can find it here.

BerliOS Logo