2. When you say storing this in a directory structure, do you mean on a different machine or on the Exchange server?

If you just want to download the messages, strip the attachments and store them locally this can be done with something like Email::Mime::Attachment::Stripper:
my $message_count = $server->select( 'folder' ); print "Found $message_count messages\n"; foreach my $message_number ( 1 .. $message_count ) { print "Processing message number $message_number\n"; my $email = Email::MIME->new( join '', @{$server->get( $message_nu +mber )} ); my $stripper = Email::MIME::Attachment::Stripper->new($email); my @attachments = $stripper->attachments; foreach my $attachment ( @attachments ) { print $attachment->{filename}, " ", $attachment->{content_type +}, "\n"; } }
In my brief experience I haven't had problems using similar code to access an Exchange server in the past (although the code above is untested as I don't have access to that code right now) other than dealing with ms-tnef attachments from Outlook users sending RTF messages..

3. Suggestions on handling this depend more on your requirements. You can always append the date/time of the message you are processing to the attachment name or perhaps see if an attachment by the name you have already exists and append a number to the end etc..

Hope that helps!

In reply to Re: Exchange Server and IMAP by daddyefsacks
in thread Exchange Server and IMAP by Anonymous Monk

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.