Has anyone used any IMAP module successfully to read a mailbox on an MS Exchange server? I've tried Net::IMAP::Simple and Mail::IMAPClient, with no luck so far.

Here's some code that I'm using with Mail::IMAPClient:

my $FOLDER_NAME = 'inbox'; my $server = Mail::IMAPClient->new( Server => $MAIL_SERVER, User => $MAIL_USER, Password => $MAIL_PASS, Fast_IO => 0, Uid => 1, Debug => 1, ); my @folders = @{$server->folders($FOLDER_NAME)}; foreach my $fold (@folders) { print "Processing folder $fold\n"; $server->select($fold); my @msgs = $server->search("ALL"); foreach my $msg (@msgs) { print "Processing message $msg in folder $fold.\n"; my $string = $server->message_string($msg); print "String = $string\n"; } }
This results in a correct login, but then gives the following errors:
Sending: 2 LIST "" "inbox" Sent 19 bytes Read: 2 NO There is no replica for that mailbox on this server. Use of uninitialized value in pattern match (m//) at d:/Perl/site/lib/ +Mail/IMAPClient.pm line 294. Use of uninitialized value in string eq at d:/Perl/site/lib/Mail/IMAPC +lient.pm line 296. Use of uninitialized value in length at d:/Perl/site/lib/Mail/IMAPClie +nt.pm line 296. Use of uninitialized value in substr at d:/Perl/site/lib/Mail/IMAPClie +nt.pm line 296. substr outside of string at d:/Perl/site/lib/Mail/IMAPClient.pm line 2 +96. Use of uninitialized value in concatenation (.) or string at d:/Perl/s +ite/lib/Mail/IMAPClient.pm line 1291. Sending: 3 LIST "" "inbox*" Sent 20 bytes Read: 3 OK LIST completed. Autoloading: STATUS "inbox" (MESSAGES) Sending: 4 STATUS "inbox" (MESSAGES) Sent 29 bytes Read: 4 NO There is no replica for that mailbox on this server.
Note that I can't use Win32-specific modules for this because I am building it to run on a Solaris server.

In reply to IMAP modules and MS Exchange by perrin

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.