Configure Fetchmail on your mailserver to collect email from your pop3 accounts all over the world. Examples added for non-secure and for secure pop3 accounts like gmail.
# vi /etc/init.d/fetchmail
#!/bin/bash # # fetchmail This shell script takes care of starting and stopping # fetchmail (remote POP/IMAP mail retrieval utility) # # chkconfig: – 55 45 # description: fetchmail is used to retrieve mail from remote servers. This # script provides support for running it as a system service. # probe: true # Derived from the Fedora Core 2 test 1 named script, as well as the Debian # Edited by Roderick Derks, used on RedHat Linux and Fedora. # Source function library. # Source networking configuration. RETVAL=0 FETCHMAIL=/usr/bin/fetchmail # Check that networking is up. # [ -r /etc/sysconfig/fetchmail ] && . /etc/sysconfig/fetchmail [ -x $FETCHMAIL ] || exit 0 ## [ -r $CONFFILE ] || exit 0 # Check for some things in the config file, to determine whether we need if ! grep -qs "set daemon" "$CONFFILE" ; then start() { # See how we were called. exit $? |
# chkconfig –level 3 fetchmail on
# vi etc/fetchmail.rc
# poll imap.gmail.com |
Test by using:
# chmod 700 /etc/fetmailrc
# fetchmail -f /etc/fetchmailrc
Configure service to run in runlevel 3
# chkconfig –level 3 fetchmail on
Start the service
# service fetchmail start – or – /etc/init.d/fetchmail start
Leave a Reply