Slight update...
#!/usr/bin/perl -w # -*- cperl -*- # Okay, nothin' fancy, just grab my mail and store it on disk: use Mail::POP3Client; use DateTime; use DateTime::Format::Mail; use File::Spec::Functions; my $basedir = '/home/nathan/mail-proxy/store'; my $EOL = "\015\012"; $|=1; my $pop = new Mail::POP3Client( USER => "jonadab", PASSWORD => "[secret]", HOST => "mail.bright.net" ); $pop->Connect(); my $cnt = $pop->Count(); if ($cnt) { print "The server has $cnt messages for me.\n"; my $now = DateTime->now(); my $nowdir = catfile($basedir, $now->ymd() . '_' . $now->hour() . '_ +' . $now->minute() . '_' . $now->second()); my $nowrcvd = DateTime::Format::Mail->new()->format_datetime($now); while (-e $nowdir) { my @c = qw(hai lou qan xi cho nau); $nowdir .= +$c[rand @c]; } mkdir $nowdir; for my $num (1..$cnt) { my $file = catfile($nowdir, $num); my $content = $pop->Retrieve($num); if ($content) { if (open MAIL, '>', $file) { print "."; print "\n" if not $num % 60; print MAIL "Received: from mail.bright.net by $0; $now$EOL"; print MAIL $content; close MAIL; $pop->Delete($num); } else { print "!"; print "\n" if not $num % 60; } } else { print "o"; print "\n" if not $num % 60; } } $pop->Close(); print "\n\n"; }

In reply to Re: the CPAN saves me from a huge mess with my mail by jonadab
in thread the CPAN saves me from a huge mess with my mail by jonadab

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.