#!/usr/bin/perl use Mail::POP3Client; use Mail::MboxParser::Mail; my $pop = new Mail::POP3Client ('my','password','server'); for my $i (1 .. $pop->Count) { my $msg = Mail::MboxParser::Mail->new( [ $pop->Head($i) ], [ $pop->Body($i) ] ); $msg->store_all_attachments( path => '/tmp' ); }