📥 Fetchmail
Fetchmail collects mail from a POP3 or IMAP server and hands it to your local mail system. Sometimes it refuses the mail server’s certificate with an OpenSSL error. Two ways to fix that:
- Fetchmail OpenSSL error, part 1: pin the server’s certificate fingerprint in
.fetchmailrc. Quick, but it breaks again whenever the certificate is renewed. - Fetchmail OpenSSL error, part 2: let fetchmail verify the certificate properly, by saving the certificate chain and creating
c_rehashlinks. More work once, then it keeps working.
⚡ See what the server sends
# the certificate chain of an IMAP server (port 993)
openssl s_client -connect mail.example.org:993 -showcerts </dev/null
# its SHA-256 fingerprint, for part 1
openssl s_client -connect mail.example.org:993 </dev/null 2>/dev/null \
| openssl x509 -noout -fingerprint -sha256
fetchmail -v -c # check for mail without fetching, with details
🔗 Related
- SSL rehash and file permissions and the other SSL notes
- Sending mail instead of receiving it: postfix-docker-from-source, my Dockerfile that builds Postfix from source for a small outgoing mail server