fetchmail gmail via IMAP to macosx for backup

by bram

first, enable IMAP in gmail.

$ vi .fetchmailrc

if you have a mta running:

poll imap.gmail.com protocol IMAP
user ‘
<snip>‘ there with password ‘<snip>’ is ‘<snip>‘ here
options ssl keep sslcertck sslcertpath “/Users/
<snip>/.ssl/certs”
folder ‘[Gmail]/All Mail’

if not, deliver via procmail to /var/mail…:

poll imap.gmail.com protocol IMAP
user ‘
<snip>‘ there with password ‘<snip>’ is ‘<snip>‘ here and wants mda “/usr/bin/procmail -d %T”
options ssl keep sslcertck sslcertpath “/Users/<snip>/.ssl/certs”
folder ‘[Gmail]/All Mail’

$ mkdir -p .ssl/certs

$ openssl s_client -connect pop.gmail.com:995 -showcerts

(copy the key)

$ vi .ssl/certs/gmailpop.pem

(paste the key)

$ wget http://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Certificate_Authority.cer ; mv Equifax_Secure_Certificate_Authority.cer .ssl/certs/equifax.pem ; c_rehash ~/.ssl/certs/

$ fetchmail -v