I spent some time today trying to get fetchmail to work, but ran into some snags. I remember fetchmail fondly from my days using Slackware Linux, in order to pull mail from the ISP server and UCSD's mail servers onto my local network. However, when running fetchmail under Debian, I found that postfix was rejecting the mail once fetchmail tried to pass it off. This was because fetchmail tries to deliver to user@localhost rather than user@disasterzone.net as it was configured for. In order to fix this, I had to change this line:
original /etc/postfix/main.cf
mydestination = $myhostname localhost.$mydomain $mydomain
revised /etc/postfix/main.cf
mydestination = $myhostname localhost.$mydomain $mydomain localhost
After restarting the postfix server, it now recognizes user@localhost as a deliverable address, and handles the mail properly. I wondered why localhost was originally omitted? I ran a few open relay tests, but saw no problems. Once this was all working, I went ahead and created my user .fetchmailrc. It is important to chmod this file 600 when putting the password in, to prevent others from viewing the password. Alternatively, one can omit the password and let fetchmail prompt for the password.
.fetchmailrc
set daemon 6000
poll imap.aim.com proto imap
user myusername with password 'mypassword'
ssl
poll pop.gmail.com proto pop3
user myusername with password 'mypassword'
ssl
With everything in place, I pulled all of the old emails from AIM and Gmail onto disasterzone.net's mail server. As far as I can tell, my emails only go back to late 2006. I'm not sure what happened to the other mails. It is probable I forgot to back up the data when decommissioning my old mail server.