Red Hat Enterprise Linux at Iowa State University

Using kfetchmail to read your Iowa State e-mail

This document describes how to use kfetchmail to download your Iowa State e-mail. Kfetchmail is a version of fetchmail configured with kerberized pop support, the pop support that is used at Iowa State.

Subscribing to the ISU Beta Channel

The kfetchmail package is currently located in the ISU beta channel. Your machine will need to be subscribed to that package before you can install kfetchmail. Information on doing that is located in the Red Hat Network documentation.

You will also need to import the PGP key that signed the kfetchmail package. To do so, do the following as root on your system:

wget www.public.iastate.edu/~kula/pgp/keys/RPM-GPG-KEY.kula-at-iastate.edu.txt
rpm --import RPM-GPG-KEY.kula-at-iastate.edu.txt

Installing kfetchmail

As root, type the command:

up2date -i kfetchmail

This will install kfetchmail and any dependencies it might need.

Configuring kerberos

Your machine will have to have the kerberos client software installed and be configured to use the Iowa State kerberos servers. If your system has any part of the Iowa State Linux packages installed, you will have everything you need. Otherwise, as root, do the following:

up2date -i krb5-libs
up2date -i krb5-workstation
wget ftp://ftp.iastate.edu/pub/unix/kerberos/krb5.conf
mv krb5.conf /etc/krb5.conf

Configuring kfetchmail

Using your favorite editor, create a file called .fetchmailrc in your home directory:

poll netid.mail.iastate.edu with proto KPOP auth kerberos_v4 uidl
principal pop.pop.iastate.edu@IASTATE.EDU
user netid there is localusername here warnings 3600
mda 'procmail -f- -m /home/localusername/.procmailrc'
keep

Replace netid with your ISU Network-ID and localusername with the name of your user on you local machine

This tells kfetchmail to download your mail using kerberos authentication and to hand the mail off to procmail, which will actually put the mail in a local mail file your e-mail client can read. It also tells kfetchmail to leave your mail on the server. If you do not want kfetchmail to leave your mail on the server, remove the uidl and keep words above.

After you have created the file, you will need to change its file permissions so that only you can read it. To do so, run the command chmod 700 .fetchmailrc

Configuring procmail

Procmail is the program that actually handles putting the messages kfetchmail has retrieved into a local mail file your e-mail client can read. Procmail can also be used to filter e-mail, although that is outside of the scope of this document. To configure procmail, create a .procmailrc file in your home directory containing the following:

 

MAILDIR=/home/localusername/mail
ORGMAIL=$MAILDIR/inbox
DEFAULT=$ORGMAIL
SHELL=/bin/sh
 
:0 :
$DEFAULT

Once again, replace localusername with your local user name.

You will also need to make sure that a folder called mail in your home directory exists. Running mkdir ~/mail will do that.

This configures procmail to put your mail in an inbox file in a directory called mail in your home directory. The standard location is /var/spool/mail/, but putting it in your home directory makes it easier to backup and also allows you to access it from different machines if your home directory is in AFS or some other network file system.

Running kfetchmail

The first time you log in and use kfetchmail, you will need to get kerberos tickets. If you are using the isl-pvattach module of Iowa State Linux, you will already have tickets when you log in. Otherwise, run the following commands:

kinit netid
krb524init

If your local username matches your Iowa State Network-ID, then you can leave out the netid part of the kinit line.

To actually run kfetchmail, run the command:

kfetchmail

This will run kfetchmail once and download your e-mail. If you want it to in the background downloading mail every five minutes you can either run the command kfetchmail -d 300 will run kfetchmail in daemon mode (in the background) and check your mail every 300 seconds (5 minutes). You can vary the time between mail checks, but you should not configure it to be less than 300 seconds. To permanently configure kfetchmail to run in daemon mode, add the following line to your .fetchmailrc:

set daemon 300

In any case, before you log out, or whenever you want kfetchmail to stop checking your mail, run the command kfetchmail --quit

Using kfetchmail with e-mail clients

See other documents in this section on configuring your e-mail client to work with kfetchmail. In general, if you can configure your e-mail client to read from an "mbox" file and point it to the inbox file located in the mail directory in your home directory, it should work.