I found this at
http://www.arda.homeunix.net/mailsetup.shtml#fetchmail and thought that it might help.
Let me know what you think,
Mark
Retrieving Mail from my ISP
In addition to the mail accounts I have set up on my own mail server, I still have an email account with my ISP that I just haven’t been able to ween myself away from. Rather than have mail in two different locations, I decided it would be nice to be able to automatically download mail from this account into an account on my own mail server. Another reason to do this is because I get spammed on this account from time to time. Rather than pay my ISP to apply their anti-spam measures to my account, I’d rather download the messages to my server and use my own spam-stopping tools. This is what I’m using Fetchmail to accomplish.
Fetchmail really is a gem of a program. My simple setup doesn’t do justice to its capabilities. If anyone needs a program to take mail from one or more mail accounts and deliver it to accounts on one or more other mail servers, you should take a look at Fetchmail. You’ll be glad you did.
Since my ISP mail account doesn’t see a lot of volume, I’m running Fetchmail twice a day from a cron job to check for mail on my ISP’s mail server and download it to Callisto. Here is what the cron job in /etc/crontab looks like.
# check my ISP mail account twice a day
24 5,18 * * * vmail /usr/local/bin/fetchmail -f /home/vmail/.fetchmailrc
Fetchmail runs as vmail, the system account I use to control virtual mail accounts on Callisto. Fetchmail doesn’t have to run as vmail, but I didn’t see any reason why it should run as root and running it as vmail is convenient.
In my setup, Fetchmail gets most its runtime parameters from a configuration file, /home/vmail/.fetchmailrc. Here is what the file looks like.
# fetchmail configuration file
set postmaster postmaster@arda.homeunix.net
set syslog
poll pop1.ISP.domain.dom protocol pop3 authenticate password
user "
"
password ""
is "andrewISP"
smtpaddress arda.homeunix.net
Since this file contains the password to my mail account on my ISP’s server, I’ve set the permissions on this file to 600; something that Fetchmail requires, in fact. It’s nice when a program does the Right Thing by default. Here is a listing of the configuration file.
-rw------- 1 vmail vmail 230 Mar 26 23:38 /home/vmail/.fetchmailrc
This configuration file tells Fetchmail to connect to my ISP’s mail server using the POP3 protocol, log in with my user ID and password, and deliver any mail it finds there to andrewISP@arda.homeunix.net on my local mail server. The smtpaddress parameter is necessary because otherwise Fetchmail will try to deliver mail to andrewISP@localhost, something my qmail setup doesn’t like. By default, Fetchmail tries to connect to port 25 on localhost to deliver mail it has retrieved which is why I don’t need to tell Fetchmail where my mail server is.
Once Fetchmail was set up, I needed to create an entry in qmail’s user database and set up an account directory in /home/vmail/arda-homeunix-net just like I would with any other mail user account.
And that’s it. For very little effort, I am able to pull all of my mail delivered to my ISP’s mail server into my own mail server where I can manipulate it to my heart's content.