How to get attachment from non-multipart message

I have a problem when trying to retrieve attachements coming from outside servers on my IMAP server in MS Outlook.

Some of senders have Multipart content type and I have no problems getting attached files.

But some messages with attachments have Text /Plain Content type and attached file is not visible.

May somebody help - how to get attachments when message content type is not Multipart?

[416 byte] By [sunfina] at [2007-10-2 3:26:57]
# 1

I have found the answer on my question on jguru board:

http://www.jguru.com/faq/view.jsp?EID=1041227

The real problem was - content type could not be recognized and assumed as Plain/Text, because message was in uuencode.

Answer

First, uuencode/uudecode is not reliable (several characters vary in different implementations, and it is easy to damage, or incorrectly calculate/incompletely insert, the encoding). That's why MIME's base64 was invented.

Second, uuencoded content is simply pasted in the main message body and is not a "multipart" message (has no MIME structure) and hence does not contain "attachments" (multiple body parts), from the MIME point of view.

As far as actually doing the uuencode/decode operations... see the encode and decode methods of the MimeUtility class of the javax.mail.internet package.

sunfina at 2007-7-15 22:36:35 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...