You can write it in PHP, using PEAR packages Net_POP3 or Net_IMAP