Using Fetchmail

Most of this chapter assumes that you're installing an SMTP server, and possibly a POP or IMAP server, on a computer that's part of an ordinary SMTP mail path, as depicted in Figure 25.1. Sometimes, though, you may want to extend that mail path beyond the end point as shown in Figure 25.1. For instance, if you use an external ISP for some or all of your incoming mail, chances are you must retrieve that mail via a POP or IMAP client. In some cases, though, you might not want to use a conventional mail reader to do that retrieval. For instance, you might want to use an IMAP client, but your ISP might support only POP; or you might want to combine several ISPs' mail streams into one; or you might want to take mail addressed to one account and deliver it to several local users. To accomplish these goals, you must effectively extend the SMTP mail path as shown in Figure 25.1 beyond the initial POP or IMAP connection. Figure 25.3 shows one possible configuration.

Figure 25.3: Fetchmail enables a computer to retrieve mail with a pull mail protocol and inject it into an SMTP queue for further processing.

In this network, the local mail server (mail.example.com) has a direct connection to the Internet and can send and receive mail like any other mail server. It serves mail to a series of local mail clients using POP or IMAP, and it can relay mail from these clients. In addition to these conventional roles, though, mail.example.com pulls mail from two ISPs' mail servers using pull protocols and merges that mail into the local mail stream. This configuration, or a subset of it, is most useful for individuals and small businesses that use an ISP for receipt of some or all of their external mail. You can inject mail into a local queue for reading with mail readers running on the mail server itself, omitting the local mail client computers in Figure 25.3; or you can use the full local network as depicted in the figure. You can add or delete external mail servers, accept or not accept direct incoming SMTP connections from the Internet, send outgoing SMTP mail directly or via one of the ISP's mail servers, and make other changes. In any event, the goal is the same, and the Linux tool to accomplish this goal is the same: Fetchmail (http://catb.org/~esr/fetchmail/).

Fetchmail acts like a pull mail client, but instead of displaying the mail to users, it uses SMTP or other delivery mechanisms to send the mail on to other mail servers. Typically, Fetchmail passes the mail it pulls on to a mail server that runs on the same computer on which it runs. In order to accomplish this task, you must configure Fetchmail with information on both the servers to which it talks—the pull mail server and the push mail server. Once you've configured an account, you must run Fetchmail. Typically, you configure it to retrieve mail at regular intervals—say, once a day or once an hour.

Internet Entrepreneurship Survival Guide

Internet Entrepreneurship Survival Guide

Master The Backwoods of Internet Entrepreneurship All Distilled into a Single Most Powerful Guide! Like a long pole, that can shift a great weight with little effort such is the case with succeeding in business. Your chances of succeeding-as an 'army of one' fall somewhere between zip, zilch and nill.

Get My Free Ebook


Post a comment