zzMail.pl - Mail Forwarding (in Perl)
I wrote a small perl script which retrieves pop3 mails and forwards them to another address via smtp. The motivation of doing this sounds weird apparently. There are so many mail clients available to perfectly handle pop3 mails. Why am I so keen on torturing myself to do that stuff? In fact, my original idea of doing it is to converge all my mails from different accounts to gmail, which I feel it's so better using gmail than suffering in different mail clients with different flaws. As a final result, I should be able to read my mails only via browser and enjoy all features of Gmail.
However, the main challenge is that free accounts of yahoo, hotmail, and even my university exchange system don't provide mail forwarding service. What's more, hotmail and exchange has no POP3 access available. Fortunately, there are some ongoing open source projects for webmail like "hotwayd" which behaves as a POP3 agent/gateway for translating httpmail protocols. Except that I can only access my exchange account via OWA or outlook or Evolution, other accounts are all able to be acessed via POP3.
At the beginning, I checked some popular tools "fetchmail", "getmail" for my purpose of retrieving mail and forwarding to another account. But unfortunately none of them perfectly meet my need, or I happened to miss their potential ability of doing that. Gradually, I found it looks pretty easy to use Perl for handling POP3 and SMTP, nothing better fit myself than doing it on my own.
However, there are two main issues in using Perl for POP3/SMTP. The first one is POP3 retrieving without duplicate dowloading, where UIDL helps out here. The other one is SMTP with proper authention method support, where
Mail::SMTP_auth.pm module helps here.
I share my source code
here for your free usage, modification, or redistribution. Please use it at your own risk. Strongly encourage you reading the source code before using it.
P.S.
Probably MS Outlook is the most powerful mail client in this world despite of its underlying reasons for the "powerful". It supports almost all internet mail protocols, with which you probably don't need anything else. However, people, especially in the open world, hate it somehow. I decide to seek for better solutions to release myself from outlook's "powerfulness".