in reply to Exchange Server and IMAP

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!

Replies are listed 'Best First'.
Re^2: Exchange Server and IMAP
by jfroebe (Parson) on Nov 18, 2004 at 17:29 UTC

    Getting the emails is easy if you can get access to the mail account... getting access to all of the mail accounts is the hard part...

    Team Sybase member

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

      Aww it's not that hard, just ask each user for their username and password and log in! :)

      I realize that's the hard part and it's a good thing it is hard, I just thought I'd give some pointers on the parts I know a little bit about.