Runtime Control script for Red Hat / Fedora::
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 via Yum: yum install fetchmail.
2: Download Runtime script
The script is available via the link below. 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.
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 "firstname.lastname@example.org" password "thatone"
is "andy" here
poll pop.anothermailserver.com user "email@example.com" password "YeahButNo"
is "inprison" here
Run the command fetchmail -v -c to verify your settings in your .fetchmailrc file are correct.
You may now enter the following commands (as SU) to control Fetchmail:
service fetchmail start
service fetchmail stop
service fetchmail status
service fetchmail restart
service fetchmail condrestart
Page updated: 17th February 2014