First make an empty file named “.fetchmailrc” in your home directory. The easiest way for it is to use the command “touch”.
$ cd ~/
$ touch .fetchmailrc
Then change the permission of that file to 600 (that is, readable and writable only by the owner of the file).
$ chmod 600 .fetchmailrc
Now add these lines to .fetchmailrc file
poll SERVER with proto PROTOCOL
user REMOTE_USER there with password REMOTE_PASSWORD is LOCAL_USER here
You must replace all the capital-letter words with the real values.
SERVER is the name of server you use to receive e-mails.
PROTOCOL is the type of SERVER (for example, IMAP or POP3). If you don’t know, use AUTO.
REMOTE_USER is the user name of the account you have on the SERVER.
REMOTE_PASSWORD is the password for REMOTE_USER.
LOCAL_USER is the user name of the account you have on your machine. Don’t use “root”.
Example: You can have multiple account configuration
poll pop.anydomain.com with proto POP3
user nikesh there with password password is otheruser here
poll pop.otherdomain with proto POP3
user user1 there with password pass is user2 here
It’s the time to run fetchmail.
You can use “-v” option to see what is going on.
$ fetchmail -v
For an automatic pick-up of your mail, you could write your own script that calls fetchmail every hour and delivers the mail. But in stead of using the cron-daemon you can start fetchmail also in daemon mode. This is very easily done by this command : fetchmail –daemon 3600
Interval (3600) is a numeric argument that specifies the polling interval in seconds.
Link : http://www.howtoforge.com/debian_etch_fetchmail
Fetchmail is a program for retrieving emails from remote servers. Imagine you have five email accounts on five different servers. Of course, you don't want to connect to each of them to get your emails. This is where fetchmail comes into play. If you have a user account on a Linux server, you can make fetchmail download emails from remote servers and put them into just one mailbox (the one of your Linux user), from where you can retrieve them with your email client (e.g. Thunderbird or Outlook).
Or imagine you have an email account at a provider that doesn't do spam- and virus filtering. In that case you could use fetchmail to download the mails to your own server and pipe them through spam- and virus filters (e.g. SpamAssassin and ClamAV) before you download the mails with your email client.
I do not issue any guarantee that this will work for you!
apt-get install fetchmail
# This file will be used to declare some vars for fetchmailgedit /etc/fetchmailrc
# /etc/fetchmailrc for system-wide daemon mode
At the beginning of the file we have some global options such as set daemon 300 (which means fetchmail should retrieve emails every 300 seconds) that control the operation of the program. The meanings of the above options are as follows:
Then we have the server and the user options options. These go together into the lines beginning with poll; if there are options that are the same for each poll line, we can as well specify them before the poll lines in a section that begins with defaults: (such as timeout, antispam, and batchlimit in our example).
The poll lines are self-explanatory; as you see fetchmail retrieves emails from both of falko's external email accounts and puts them into one account.
You will notice that the poll lines have different endings (e.g. nofetchall (default), fetchall, keep, nokeep). The meanings are as follows:
To learn more about all available configuration settings, take a look at man fetchmail
chmod 600 /etc/fetchmailrc
Outro Link: http://www.webmonkey.com/tutorial/Set_Up_a_Debian_or_Ubuntu_Machine_as_a_Maildrop