For this tutorial, you will need to have the Mail::POP3Client and the MD5 (as a depency) modules installed on your computer.
Download the modules from CPAN and install them.
You will also need a POP3 server account to test your code against.
For example, you can use Cucipop, available in FreeBSD as a port: /usr/ports/mail/cucipop
First, send some test mail to yourself.
If you want to send mail using Perl, check the Mail::Send tutorial.
With a local POP3 server, you can send yourself some test mail (type text written in bold):
# mail [email protected]
Subject: my 1st This is my 1st test. .
EOT
Repeat with 2nd and 3rd.
First check it manually:
# mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/mail/kuuse": 3 messages 3 new 3 unread
N 1 kuuse Wed Sep 26 13:34 15/388 "my 1st"
N 2 kuuse Wed Sep 26 13:38 14/359 "my 2nd"
N 3 kuuse Wed Sep 26 13:38 14/358 "my 3rd"
& x
Then create a Perl script called pop3.pl containing the following code: