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: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..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"; } }
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 | |
by daddyefsacks (Pilgrim) on Nov 18, 2004 at 17:35 UTC |