My understanding is that AOL uses IMAP 4 -- not POP. Although AOL's mail is usually described as "proprietary" IMAP is a standard. Not as widely supported as POP, but still a standard. Our Exchange server at work uses IMAP and I've written a lot of Perl code to access folders and messages. I did all of that with Mail::IMAPClient
Having not tried my IMAP access against any AOL accounts, it may be that AOL uses a version/variant of IMAP that Mail::IMAPClient does not support. I see several other specific IMAP 4 clients out there, such as Mail::Box::IMAP4 but the ones I checked all had "under development" disclaimers.
Here's an old script I wrote to show my IMAP server folders. It may help you see if you can access AOL using Mail::IMAPClient.
use Mail::IMAPClient;
use Getopt::Std;
$mail_server = 'XXX.XXX.XXX.XXX'; # mail server IP
$delimiter = "\t";
sub parse_options()
{
getopts("cd:m:v");
$mail_server = $opt_m if ($opt_m);
$delimiter = $opt_d if ($opt_d);
die "Usage: $0 [-c] [-m mail_server] [-d delimiter] user_name pass
+word\n"
if (scalar(@ARGV) != 2);
$user_name = $ARGV[0];
$password = $ARGV[1];
}
sub show_folders()
{
local $user_name;
local $password;
my $client;
my @folders;
parse_options();
print "Connecting to mail server $mail_server as user '$user_name'
+, " .
"password '$password'.\n" if ($opt_v);
$client = Mail::IMAPClient->new(Server => $mail_server,
User => "$user_name",
Password => $password) or
die "Can't open IMAP connection to mail server $mail_server: $
+!\n";
@folders = $client->folders();
foreach my $folder (@folders)
{
if ($opt_c)
{
printf "%s%s%d\n", $folder, $delimiter,
$client->message_count($folder);
}
else
{
print "$folder\n";
}
}
}
show_folders();
"imapfolders" 69 lines, 1418 characters |