commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Kohll (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (EMAIL-129) hasPlainContent and hasHtmlContent both return false
Date Thu, 25 Jul 2013 11:43:48 GMT

    [ https://issues.apache.org/jira/browse/EMAIL-129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13719533#comment-13719533
] 

Oliver Kohll commented on EMAIL-129:
------------------------------------

Hi Benedikt,

Thanks for looking at it. rawEmail is just a String with the complete content of an email,
i.e. what you get when you choose 'view raw source' or similar in an email client. In the
example that fails for me, that's the content pasted at the end of the bug report, starting
with the Return-Path line.

The example is from Apple Mail. I haven't tested more widely I'm afraid.

Oliver
                
> hasPlainContent and hasHtmlContent both return false
> ----------------------------------------------------
>
>                 Key: EMAIL-129
>                 URL: https://issues.apache.org/jira/browse/EMAIL-129
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>         Environment: Ubuntu Linux 12 LTS, OpenJDK 7
>            Reporter: Oliver Kohll
>
> Using the following code
> 		InputStream is = new ByteArrayInputStream(rawEmail.getBytes());
> 		MimeMessage message = new MimeMessage(s, is);
> 		MimeMessageParser emailParser = new MimeMessageParser(message);
> 		if (emailParser.hasPlainContent()) {
> 		  logger.debug(emailParser.getPlainContent());
> 		} else if (emailParser.hasHtmlContent()) {
> 		  logger.debug(emailParser.getHtmlContent());
> 		} else {
> 		  throw new Exception("No content found for email");
> 		}
> the Exception is thrown for sample rawEmail:
> Return-Path: <oliver@agilebase.co.uk>
> X-Original-To: oliver@agilebase.co.uk
> Delivered-To: oliver.gtwm@li349-29.members.linode.com
> Received: from [192.168.1.5] (unknown [88.211.41.14])
> 	by li349-29.members.linode.com (Postfix) with ESMTPSA id D63B05AE4F7;
> 	Thu, 25 Jul 2013 12:03:29 +0100 (BST)
> From: Oliver Kohll <oliver@agilebase.co.uk>
> Content-Type: multipart/alternative; boundary="Apple-Mail=_E3FC6CFD-A540-4365-BA9C-6DDC7A28F052"
> Subject: test
> Date: Thu, 25 Jul 2013 12:03:31 +0100
> Message-Id: <8F52AB54-5366-41A6-8C4A-72895DC4D92A@agilebase.co.uk>
> Cc: "contacts@gtwm.agilebase.co.uk" <contacts@gtwm.agilebase.co.uk>
> To: "oliver@agilebase.co.uk" <oliver@agilebase.co.uk>
> Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
> X-Mailer: Apple Mail (2.1508)
> --Apple-Mail=_E3FC6CFD-A540-4365-BA9C-6DDC7A28F052
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain;
> 	charset=us-ascii
> test content
> www.agilebase.co.uk / 0117 321 0104 / 07814 828608
> www.twitter.com/agilebase
> --Apple-Mail=_E3FC6CFD-A540-4365-BA9C-6DDC7A28F052
> Content-Transfer-Encoding: quoted-printable
> Content-Type: text/html;
> 	charset=us-ascii
> <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
> charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
> -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">test =
> content<br><div apple-content-edited=3D"true">
> <div style=3D"color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
> medium; font-style: normal; font-variant: normal; font-weight: normal; =
> letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
> -webkit-auto; text-indent: 0px; text-transform: none; white-space: =
> normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; =
> -webkit-text-stroke-width: 0px; word-wrap: break-word; =
> -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div =
> style=3D"color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; =
> font-style: normal; font-variant: normal; font-weight: normal; =
> letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
> -webkit-auto; text-indent: 0px; text-transform: none; white-space: =
> normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; =
> -webkit-text-stroke-width: 0px; word-wrap: break-word; =
> -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span =
> class=3D"Apple-style-span" style=3D"border-collapse: separate; color: =
> rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: =
> normal; font-weight: normal; letter-spacing: normal; line-height: =
> normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; =
> text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
> border-spacing: 0px; -webkit-text-decorations-in-effect: none; =
> -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
> font-size: medium; "><div style=3D"word-wrap: break-word; =
> -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span =
> class=3D"Apple-style-span" style=3D"border-collapse: separate; color: =
> rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: =
> normal; font-weight: normal; letter-spacing: normal; line-height: =
> normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; =
> text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
> border-spacing: 0px; -webkit-text-decorations-in-effect: none; =
> -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
> font-size: medium; "><div style=3D"word-wrap: break-word; =
> -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span =
> class=3D"Apple-style-span" style=3D"border-collapse: separate; color: =
> rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: =
> normal; font-weight: normal; letter-spacing: normal; line-height: =
> normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; =
> text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
> border-spacing: 0px; -webkit-text-decorations-in-effect: none; =
> -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
> font-size: medium; "><div style=3D"word-wrap: break-word; =
> -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span =
> class=3D"Apple-style-span" style=3D"border-collapse: separate; color: =
> rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: =
> normal; font-weight: normal; letter-spacing: normal; line-height: =
> normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; =
> text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
> border-spacing: 0px; -webkit-text-decorations-in-effect: none; =
> -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
> font-size: medium; "><div style=3D"word-wrap: break-word; =
> -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span =
> class=3D"Apple-style-span" style=3D"border-collapse: separate; color: =
> rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: =
> normal; font-weight: normal; letter-spacing: normal; line-height: =
> normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: =
> normal; widows: 2; word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-style: normal; font-variant: normal; font-weight: =
> normal; letter-spacing: normal; line-height: normal; orphans: 2; =
> text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
> word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div =
> style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
> -webkit-line-break: after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-size: medium; font-style: normal; font-variant: normal; =
> font-weight: normal; letter-spacing: normal; line-height: normal; =
> orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
> widows: 2; word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
> break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
> after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-size: medium; font-style: normal; font-variant: normal; =
> font-weight: normal; letter-spacing: normal; line-height: normal; =
> orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
> widows: 2; word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
> break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
> after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-size: medium; font-style: normal; font-variant: normal; =
> font-weight: normal; letter-spacing: normal; line-height: normal; =
> orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
> widows: 2; word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
> break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
> after-white-space; "><span class=3D"Apple-style-span" =
> style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
> Helvetica; font-size: medium; font-style: normal; font-variant: normal; =
> font-weight: normal; letter-spacing: normal; line-height: normal; =
> orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
> widows: 2; word-spacing: 0px; border-spacing: 0px; =
> -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
> auto; -webkit-text-stroke-width: 0px; "><span class=3D"Apple-style-span" =
> style=3D"font-size: 12px; "><div><br =
> class=3D"Apple-interchange-newline"><a =
> href=3D"http://www.agilebase.co.uk">www.agilebase.co.uk</a> / 0117 321 =
> 0104&nbsp;/ 07814 828608</div><div><a =
> href=3D"http://www.twitter.com/agilebase">www.twitter.com/agilebase</a></d=
> iv></span></span></div></span></div></span></div></span></div></span></div=
> ></span></div></span></div></span></div></span></div></span></div></span><=
> /div></span></div></span></div></span></div></span></div></span></div></sp=
> an></div></span></div></span></div></span></div></div>
> </div>
> <br></body></html>=
> --Apple-Mail=_E3FC6CFD-A540-4365-BA9C-6DDC7A28F052--

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message