33.1. Introduction to Fetchmail

Fetchmail is a relatively simple program that downloads email from another server using the POP3 or IMAP protocol and delivers it to a mailbox on your system. It is most useful if you want to run your own mail server, but cannot have mail delivered directly, for some reason. The solution is to have Fetchmail download email periodically using a protocol like POP3 and then connect to the SMTP server on your system to have it delivered as if it were sent directly.

If your system has a dial-up connection to the Internet that is only occasionally active, it is not usually possible to have mail delivered directly. The same applies if you do not have a fixed IP address. In situations like this, it is still possible to run your own email domain and server by having mail for your domain sent to a mailbox at your ISP and using Fetchmail to periodically transfer it to your system.

Even if you do not have your own Internet domain, Fetchmail can still be used to download email from an email account in your ISP's domain. Many mail clients like pine, elm, and Usermin read the UNIX mail file in /var/mail directly, instead of downloading messages via the POP3 or IMAP protocol. To use one of these programs, email must be downloaded to your system and delivered to a local user.

Fetchmail can download email from multiple mailboxes on different servers and deliver it to different addresses on your system. If email to all addresses in a domain has been combined into a single mailbox, Fetchmail can usually separate it for delivery to the correct users on your system. This is possibly Fetchmail's most useful feature, but unfortunately it is not 100 percent reliable.

The Fetchmail program can retrieve mail using the POP2, POP3, and IMAP protocols, one of which will be supported by almost all mail servers. It can also use the ETRN mode of the SMTP protocol to force a mail server to deliver all queued messages that are awaiting delivery to your system. Unfortunately, it does not support the retrieval of mail from proprietary email systems, like Exchange or Lotus Notes, or from web-based email services, like Hotmail, unless they support one of the standard protocols as well.

To perform periodic checks, Fetchmail is usually run as a background daemon process that connects to all mail servers at regular intervals. It can also be run from a Cron job at times and dates of your choosing, or even started manually from the command line or some other script.

Fetchmail is often run by individual users rather than the system administrator, each with their own separate .fetchmailrc configuration file in their home directory. Because it does not require root privileges to run, each user can safely configure Fetchmail on a multi-user UNIX system to download mail from his own remote mailboxes. This means that each user may have his own separate Fetchmail daemon process running that uses his own configuration.

A single configuration file can also be used and Fetchmail can be run as root to download email for all users on your system. This option makes more sense if you are the only user of your Linux box, or if you are downloading email for an entire domain to be redistributed to local users. Typically, /etc/fetchmailrc is used as the global configuration file.

In fact, it is possible for Fetchmail to be run on both individual users' configuration files and a global file at once. The Webmin module for configuring it, however, expects you to use one mode or the other.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.141.125