[ https://issues.apache.org/jira/browse/JAMES-1910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15976361#comment-15976361 ]
Luc DUZAN commented on JAMES-1910: ---------------------------------- Hello leviluo, I am not sure to understand your last comment well. Do you still encounter problem with footer or this problem has been solved with https://issues.apache.org/jira/browse/JAMES-443 ? If no, could you send file with attachment instead of pasting it in JIRA please. > can't add footer when use email client (ex:foxmail) > --------------------------------------------------- > > Key: JAMES-1910 > URL: https://issues.apache.org/jira/browse/JAMES-1910 > Project: James Server > Issue Type: Bug > Components: Mailet Contributions > Affects Versions: 3.0.0-beta5 > Reporter: leviluo > Priority: Critical > Labels: patch > Original Estimate: 4h > Remaining Estimate: 4h > > config as below > {quote} > <mailet match="All" class="org.apache.james.transport.mailets.AddFooter"> > <text>================================add > footer=======================</text> > </mailet> > {quote} > I can get the footer when I use telnet wiht simple message. and I change the > email content to text at server just like below code.I think this change the > message type. > {quote} > public void service(Mail mail) throws MessagingException { > try { > MimeMessage message = mail.getMessage(); > message.setText("11111111111111111111"); > // message.getContent(); > if (attachFooter(message)) { > message.saveChanges(); > } else { > log("Unable to add footer to mail " + mail.getName()); > } > } catch (UnsupportedEncodingException e) { > log("UnsupportedEncoding Unable to add footer to mail " > + mail.getName()); > } catch (IOException ioe) { > throw new MessagingException("Could not read message", ioe); > } > } > {quote} > But i run the test case of AddFooterTest.java, It is work fine. > I add a test case for the same content of the foxmail client.and the test > case is OK. > Test case in AddFooterTest as below > {quote} > @Test > public void shouldAddFooterWhenMultipartRelatedHtmlMessage4() throws > MessagingException, IOException { > mailetConfig.setProperty("text", "==========================test > case============================"); > mailet.init(mailetConfig); > > String htmlMultipartRelatedMessagePart1 = Joiner.on("\r\n").join( > "MIME-Version: 1.0", > "Received: from 127.0.0.1 (EHLO levi-work) ([127.0.0.1])", > " by levi-work (JAMES SMTP Server ) with ESMTP ID 2126899460", > " for <luo...@linyanyan.cn>;", > " Mon, 16 Jan 2017 14:00:53 +0800 (CST)", > "Date: Mon, 16 Jan 2017 14:00:53 +0800", > "From: \"t...@linyanyan.cn\" <t...@linyanyan.cn>", > "To: \"luo...@linyanyan.cn\" <luo...@linyanyan.cn>", > "Subject: 01-16-15", > "References: <2017011417484072410...@linyanyan.cn>, ", > " <2017011611300751098...@linyanyan.cn>, ", > " <2017011611571368034...@linyanyan.cn>, ", > " <2017011612310328703...@linyanyan.cn>, ", > " <2017011612342956932...@linyanyan.cn>, ", > " <2017011612433319053...@linyanyan.cn>, ", > " <2017011612452625583...@linyanyan.cn>, ", > " <2017011613055188853...@linyanyan.cn>, ", > " <2017011613071917921...@linyanyan.cn>, ", > " <2017011613080283758...@linyanyan.cn>, ", > " <2017011613094076349...@linyanyan.cn>, ", > " <2017011613184900040...@linyanyan.cn>, ", > " <2017011613210755849...@linyanyan.cn>, ", > " <2017011613371787777...@linyanyan.cn>", > "X-Priority: 3", > "X-Has-Attach: no", > "X-Mailer: Foxmail 7, 2, 7, 26[cn]", > "Content-Type: multipart/alternative;", > " boundary=\"----=_001_NextPart801803664644_=----\"", > " ", > "This is a multi-part message in MIME format.", > "", > "------=_001_NextPart801803664644_=----", > "Content-Type: text/plain;", > " charset=\"ISO-8859-1\"", > "Content-Transfer-Encoding: base64", > "", > "WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhY", > "WFhYWFhYWFhYDQo=", > "", > "------=_001_NextPart801803664644_=----", > "Content-Type: text/html;", > " charset=\"ISO-8859-1\"", > "Content-Transfer-Encoding: quoted-printable", > "", > "<html><head><meta http-equiv=3D\"content-type\" content=3D\"text/html; > charse=", > "t=3DISO-8859-1\"><style>body { line-height: 1.5; }blockquote { margin-top: > =", > "0px; margin-bottom: 0px; margin-left: 0.5em; }div.foxdiv201701161400456737=", > "13 { }body { font-size: 10.5pt; font-family: ??; color: rgb(0, 0, 0); line=", > "-height: 1.5; }</style></head><body>=0A<div><span></span></div><blockquote=", > " style=3D\"margin-top: 0px; margin-bottom: 0px; margin-left: > 0.5em;\"><div><=", > "div class=3D\"FoxDiv20170116140045673713\"><blockquote style=3D\"margin-top: > =", > "0px; margin-bottom: 0px; margin-left: 0.5em;\"><div><div > class=3D\"FoxDiv201=", > "70116133708224697\"><blockquote style=3D\"margin-top: 0px; margin-bottom: > 0p=", > "x; margin-left: 0.5em;\"><div><div > class=3D\"FoxDiv20170116132059834934\"><bl=", > "ockquote style=3D\"margin-top: 0px; margin-bottom: 0px; margin-left: > 0.5em;=", > "\"><div><div class=3D\"FoxDiv20170116131842479478\"><blockquote > style=3D\"marg=", > "in-top: 0px; margin-bottom: 0px; margin-left: 0.5em;\"><div><div > class=3D\"F=", > "oxDiv20170116130934388968\"><blockquote style=3D\"margin-top: 0px; > margin-bo=", > "ttom: 0px; margin-left: 0.5em;\"><div><div > class=3D\"FoxDiv20170116130734603=", > "789\"><blockquote style=3D\"margin-top: 0px; margin-bottom: 0px; > margin-left=", > ": 0.5em;\"><div><div class=3D\"FoxDiv20170116130712731671\"><blockquote > style=", > "=3D\"margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;\"><div><div > cl=", > "ass=3D\"FoxDiv20170116130541763948\"><blockquote style=3D\"margin-top: 0px; > m=", > "argin-bottom: 0px; margin-left: 0.5em;\"><div><div > class=3D\"FoxDiv201701161=", > "24514335323\"><blockquote style=3D\"margin-top: 0px; margin-bottom: 0px; > mar=", > "gin-left: 0.5em;\"><div><div > class=3D\"FoxDiv20170116124321987400\"><blockquo=", > "te style=3D\"margin-top: 0px; margin-bottom: 0px; margin-left: > 0.5em;\"><div=", > "><div class=3D\"FoxDiv20170116123422143022\"><blockquote > style=3D\"margin-top=", > ": 0px; margin-bottom: 0px; margin-left: 0.5em;\"><div><div > class=3D\"FoxDiv2=", > "0170116123055868282\"><blockquote style=3D\"margin-top: 0px; margin-bottom: > =", > "0px; margin-left: 0.5em;\"><div > class=3D\"FoxDiv20170116115703081740\"><div><=", > "span style=3D\"font-size: 10.5pt; line-height: 1.5; background-color: > windo=", > "w;\">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</sp=", > "an></div><blockquote style=3D\"margin-top: 0px; margin-bottom: 0px; > margin-=", > "left: 0.5em;\"><div><div > class=3D\"FoxDiv20170116112952258988\">=0A</div></di=", > "v></blockquote>=0A</div></blockquote>=0A</div></div></blockquote>=0A</div>=", > "</div></blockquote>=0A</div></div></blockquote>=0A</div></div></blockquote=", > ">=0A</div></div></blockquote>=0A</div></div></blockquote>=0A</div></div></=", > "blockquote>=0A</div></div></blockquote>=0A</div></div></blockquote>=0A</di=", > "v></div></blockquote>=0A</div></div></blockquote>=0A</div></div></blockquo=", > "te>=0A</body></html>", > "------=_001_NextPart801803664644_=------", > ""); > Mail mail = FakeMail.fromMime(htmlMultipartRelatedMessagePart1 , > javaCharset, javaMailCharset); > mailet.service(mail); > // assertThat(MailUtil.toString(mail, > javaCharset)).isEqualTo("YWFhYWFhYWFhYmJiYmJiYg0K"); > } > {quote} > I try my best to solve, But i Don't know how to solve it. > If any advise will appreciation! -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org