fetchmail is a powerfull tool to retrieve your mails. I use it to for all my mail accounts. Mail are delivered to my local MTA.
You can specify your accounts in ~/.fetchmailrc (or whatever file you want by using fetchmail -f <your_file>) using the following syntax:
# use pop3 by default to get mails defaults protocol pop3 # first account poll pop.domain.name username "myusername" password "PaSsWoRd" # second account poll pop.domain2.name username "myusername2" password "pAsSwOrD" # account using imap poll imap.domain2.name protocol imap username "myusername2" password "pa55w0rd"
Because passwords are stored in this file, change the permissions on it so that you are the only one who can read it.
You can easily retrieve your mail using ssl by adding the ssl keyword to your configuration:
# account with POPs poll pops.domain.name username "myusername" password "PaSsWoRd" ssl
You will maybe have the following error:
unable to get local issuer certificate certificate not trusted unable to verify the first certificateThis means that you don't have the root certificat in your ssl certificats path. You have to download it add add it to the list. By default, fetchmail looks at certificated in /etc/ssl/certs but you can specify an other by with sslcertpath <your_path> Once, you have added the certificate, call the c_rehash program (provided by OpenSSL suite) in you certificates directory.