fetchmail

Fetchmail is a free, full-featured, robust, well-documented remote mail retrieval and forwarding utility for POP3, IMAP, supporting TLS (SSL), SMTP and local delivery agents.