problems read email with attachment sended with unix "mailx" command

Hi all,

I receive with javamail (IMAP protocol) from Excenge server mails with attachment sended with mailx unix command like this:

cat /SDSP/dirlist/destinatari_cruscotto_daily.txt | while read addr_smtp

do

(echo "Report relativi al cruscotto live daily"; uuencode live_cruscotto_daily.zip `basename live_cruscotto_daily.zip`) | mailx -s

"SDSP Report - cruscotto live daily" $addr_smtp

done

When a read this kind of mail in my web java program and I test it if is a Multipart message I find that this is

ContentType : TEXT/PLAIN; charset=US-ASCII

When I retraive the content I have this string

begin 644 BWBLogs20070607.tar.gz

M'XL(")I):48 T)70DQO9W,R,# W,#8P-RYT87( [%UM;QO)D<[G^Q5$/OC+

..........

How can I save the attachment in this format ?

If I forward the same mail from MSoutlook I obtain a Multipart message and I can save the attachment.

Thanks and regards,

Marco

[983 byte] By [mcavannaa] at [2007-11-27 7:01:39]
# 1
Could you please send email in EML format please... (i don't have mailx in my linux) Your question interest me...
alterna at 2007-7-12 18:52:30 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

You seem to be living in the 1980's pre-MIME world. Sadly, mailx is stuck there.

The simplest thing to do is to scan the text content of the message

looking for the uuencode BEGIN line and then extract all the data

starting there through the END line and feed it to uudecode.

bshannona at 2007-7-12 18:52:30 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
thanks,infact I have solved the problem with the code present in this link : http://forum.java.sun.com/thread.jspa?forumID=43&messageID=1211599&threadID=302234Best regardsMarco
mcavannaa at 2007-7-12 18:52:30 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...