looking for a specific "howto" example with Mail::IMAPClient

From: New2code (perl-beginners.20.new2code_at_spamgourmet.com)
Date: 06/04/04


Date: Thu, 03 Jun 2004 19:30:54 -0700
To: beginners@perl.org

hi,

i've inherited my company's mail server (the tech guy quit), and i need to manage a 'cleanup'.

in doing so, i've come to understand that a perl script will best do what i need.

as i'm new to perl, i'm hoping to get help with a specific howto example from someone here that'll get me started ...

for my particular issue, i need to:

(1) login to the imap mail server as its "postmaster" (user with full priveleges)
(2) get a list of Domains & Accounts on the server
(3) for each existing Domain+Account pair, access two folders with the same relative-path, e.g. "/test/good" & "/test/bad"
(4) delete all the messages in each "/test/bad" folder
(5) move all the messages in each "/test/good" folder to the same Account's "/Inbox" folder

I've got perl version 5.8.4 running, and can write/execute simple scripts now.

I've also installed the Mail::IMAPClient module using the cpan utility.

I've managed the obvious part, well i stole it from an example:

        $host = "mail.mydomain.com";
        $id = "postmaster";
        $pass = "XXXXXXX";
        $imap = Mail::IMAPClient->new(
                Server => $host,
                User => $id,
                Password=> $pass,
        ) or die "Cannot connect to $host as $id: $@";

but get lost as to how to do the rest. These objects (are they?) have me a bit confused ...

can someone help with a walk through of the rest?

kate



Relevant Pages

  • Re: free source search engine (simple) ## comments?
    ... >into writing search engines, and I'm planning on making it into a more ... thing, is about *Perl*, not about web development. ... his/her own new bbs (crappy) code, guestbook code, blog ... >mail server my indenting is gonna be screwed up, ...
    (comp.lang.perl.misc)
  • Re: connecting to a mail server via IMAP
    ... connecting to a mail server via IMAP ... I think perl can send mail other ways more ... connecting to a mail server via IMAP ...
    (perl.beginners)
  • mimedefang, perl, and amd64 trouble
    ... (copying wes@, the mimedefang maintainer, just because it might ... freshly-cvsupped 7.0 amd64 box as a mail server. ... Wine has had some mmap problems, but I imagine a Perl failure would be ...
    (freebsd-questions)
  • Re: connecting to a mail server via IMAP
    ... connecting to a mail server via IMAP ... > John wrote: ... >> Can perl connect to a mail server via imap and then send some ...
    (perl.beginners)
  • RE: Segmentation Fault(Core dumped)
    ... But when I started testing my perl script, ... Compilation failed in require at ./test.pl line 13. ... > official business of Sender. ...
    (perl.dbi.users)