Runtime Control script for Red Hat / Fedora Core::

Fetchmail Logo

Intro

I am pleased to be able to offer a Red Hat / Fedora Core Linux based runtime-control script for running Fetchmail. The script is free to download and modify for your own system needs. If you make improvements, please feel free to email the changes back to me.

1: Do I have Fetchmail?

From a 'root' user prompt (or super-user) enter the command rpm -q fetchmail. If you do not have Fetchmail installed, you can install it, either from the RPM on the DVD/CD (e.g. rpm -i /media/cdrom/Fedora/RPMS/fetchmail-6.2.5-6.i386.rpm), or if you use YUM, via the following command: yum install fetchmail.

2: Download Runtime script

The script is available in gzip format from my FTP server. After downloading the file, remember to gzip -d fetchmail.gz to decompress the file. A text version of the script is also available for reference, printing, etc.

3: Install Runtime script

Copy the expanded file into your /etc/init.d/ directory; check the permissions are 755 (chmod 755 fetchmail); and the user:group rights are both set to 'root' (chown root:root fetchmail); then run the following command:

/sbin/chkconfig --add fetchmail

The 'chkconfig' program creates the symlinks in the rc0.d, rc1.d,... rc6.d directories.

4: .fetchmailrc

As this script runs as 'root', you must create your .fetchmailrc file in /root/ and give it 600 permissions (else Fetchmail fails).

Please note: You do not need to set any time defaults in your .fetchmailrc. The RC script controls the timing interval.

An example .fetchmailrc:

# Fetchmail configuration file
#
# Last updated: 4th April 2005
#
defaults proto pop3

poll pop.somemailserver.com user "andy@dontlikeit.com" password "thatone"
   is "andy" here

poll pop.anothermailserver.com user "vicky@pollard.mail" password "YeahButNo"
   is "inprison" here

5. Testing

Run the command fetchmail -v -c to verify your settings in your .fetchmailrc file are correct.

6. Running

You may now enter the following commands to control Fetchmail:

/etc/init.d/fetchmail start
/etc/init.d/fetchmail stop
/etc/init.d/fetchmail status
/etc/init.d/fetchmail restart
/etc/init.d/fetchmail condrestart

External Links

Fetchmail

Best viewed
with:
Mozilla | Opera