Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Overcoming 990 character per line limit for MIME attachments

843830Oct 12 2006 — edited Oct 16 2006
I am using the JavaMail 1.4 API to try to send an email with a text file attachment but my attachment never reaches the destination without being modified. The attachment is 991 charcter string followed by a new line. The attachement is always received as a 990 character string ending with "!" followed by a new line with some blank spaces and another new line.

Any help would be greatly appreciated! Thanks!

This issue has been brought up in May 2003 but I have not found a reply. Here is the original message to the JavaMail mailing list:

Date: Mon, 12 May 2003 22:22:28 +0300
Reply-To: Shamir Lior <Lior_Shamir@ICOMVERSE.COM>
Sender: "A mailing list for discussion of the JavaMail(tm) API"
<JAVAMAIL-INTEREST@JAVA.SUN.COM>
From: Shamir Lior <Lior_Shamir@ICOMVERSE.COM>
Subject: Send message with a long text line (512-998 characters)
Content-Type: multipart/alternative;

Hi, I have a problem when I send a message with a long text line (maximum line length is 998) that contains only ASCII characters. The maximum line length is 998 characters, since the problems occurs only when the JavaMail set the Content-Transfer-Encoding to 7bit. If the text line length is more the 998 characters then JavaMail set the Content-Transfer-Encoding to quoted-printable. I have tested it with two SMTP servers. In both of the SMTP servers the message was sent successfully, but ... When I fetch the message that was sent from the first SMTP server, after 512 characters I get CRLF. When I fetch the message that was sent from the second SMTP server, after 990 characters I get !CRLF. (exclamation mark + CRLF) Example of the MIME message: From: ... To: ... Subject: ... Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit aaaaaaaaaaaaaaaaaaaaa ... (512 to 998 characters) Did any of you encounter with the problem ? Thanks, Lior

Source: http://72.14.253.104/search?q=cache:QdJtEl_-haQJ:archives.java.sun.com/cgi-bin/wa%3FA2%3Dind0305%26L%3Djavamail-interest%26P%3D1158+javamail+mime+990+character&hl=en&gl=ca&ct=clnk&cd=1
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 13 2006
Added on Oct 12 2006
6 comments
1,311 views