use of com.zimbra.soap.mail.type.AttachmentsInfo in project zm-mailbox by Zimbra.
the class TestContentTransferEncoding method testBug98015.
/*
* Tests that the message from bug 98015 retains the correct Content Transfer Encoding via the mechanism of
* inferring it from the existing message referenced by the "origid" parameter.
* This scenario also happens to test the case when a CTE header on a sub-part is inherited from the top-level.
*/
@Ignore("disabled until bug 98015 is fixed")
@Test
public void testBug98015() throws Exception {
MimeMessage mimeMsg = new ZMimeMessage(JMSession.getSession(), new SharedByteArrayInputStream(getBug98015MimeString().getBytes()));
ParsedMessage pm = new ParsedMessage(mimeMsg, true);
DeliveryOptions dopt = new DeliveryOptions().setFolderId(Mailbox.ID_FOLDER_INBOX);
Message msg = mbox.addMessage(null, pm, dopt, null);
MsgToSend msgToSend = new MsgToSend();
msgToSend.setOrigId(String.valueOf(msg.getId()));
msgToSend.setReplyType("w");
msgToSend.setSubject("Fwd: QP bug");
msgToSend.setMimePart(MimePartInfo.createForContentTypeAndContent("text/plain", "\n\n----- Forwarded Message -----\nSubject: QP Bug\n\n\\รถ/\nid=577281"));
AttachmentsInfo attach = new AttachmentsInfo();
attach.addAttachment(new MimePartAttachSpec(String.valueOf(msg.getId()), "2"));
msgToSend.setAttachments(attach);
SendMsgRequest req = new SendMsgRequest();
req.setMsg(msgToSend);
MimeMessage parsed = sendForwardedMessage(req, msg);
ZMimeMultipart mmp = (ZMimeMultipart) parsed.getContent();
assertEquals("8bit", mmp.getBodyPart(0).getHeader("Content-Transfer-Encoding")[0]);
assertEquals("base64", mmp.getBodyPart(1).getHeader("Content-Transfer-Encoding")[0]);
}
Aggregations