Back to main page

The Quick-N-Dirty Guide to Fetchmail


In a command shell type

which fetchmail

This should return the path to fetchmail, probably /usr/bin/fetchmail. (In FreeBSD probably /usr/local/bin/fetchmail). If it finds it, go to step 3. If it doesn't go to step 2.


Go to the QND software guide for information about getting and installing fetchmail. We'll wait. If it turns out that fetchmail is not included with your particular flavor of Linux then try their home page which has rpms and source code.

3.) Configuring Fetchmail

For this guide we will assume that you have a user account at Your user name is john, your email address is Your password at is 1234. Your account on the Linux machine is jmith.'s pop server is called

Open your favorite text editor and create a new file, .fetchmailrc

poll proto pop3 user john password 1234
user john with pass 1234 is jsmith here
mda "/usr/bin/procmail -d %T"
This leaves your password in clear text. If you are on a box that has someone else as administrator, they will be able to read your password. The way around this is to leave out the password portion. Then the first two lines would read
poll proto pop3 user john
user john is jsmith here

If done this way, you will have to enter your password each time you invoke fetchmail.

While configuring procmail is beyond the scope of this QND guide, the last line simply makes sure that if no other MDA is running, that procmail will handle delivery of the mail. (Although one should make sure that they have it--imitate Step 1 above with a

which procmail

If the path is not usr/bin--in FreeBSD it will probably be /usr/local/bin--adjust your .fetchmailrc accordingly.)

4) Test fetchmail

Simply type


You should see something like

5 messages for john at (5855 octets).
reading message of 5 (1688) octets

and more in the same vein.

If you are not using sendmail, postfix or another major MDA you may also see error messages like

SMTP connect to localhost failed fetchmail: can't raise the listener; falling back to /usr/bin/procmail -d %T flushed

It may also poll the pop server a second time and say that authorization failed. As long as you are getting the "flushed" part after each message, these error messages can be ignored.

Once the message is received, you can read it with whatever MUA (Mail User Agent) that you like, such as mutt.

Congratulations, you should be done. If you prefer to have fetchmail running constantly in the background, you can do so by typing

fetchmail -d 600

The 600 refers to seconds--this would poll every 10 minutes--you can adjust that number as desired. You could also add the line to your .bash_profile, .profile or .bashrc (depending upon O/S and distribution) so that fetchmail starts running as daemon each time you log into the machine.


man fetchmail
Fetchmail home page

Back to main page