james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Huff (JIRA)" <server-...@james.apache.org>
Subject [jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address
Date Mon, 14 Feb 2011 16:29:57 GMT

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

Jeff Huff commented on IMAP-257:
--------------------------------

Same result.   Switched to JavaMail 1.4.4.  It seems that appending a message requires a sentDate
to be there even though the message may not be sent for a while.

...

            InternetAddress addr = new InternetAddress ("jhuff@localhost", "Jeff Huff");
            Message message = new MimeMessage(session);
            message.setFrom (addr);
            message.setFlag (Flags.Flag.DRAFT, true);
            MimeBodyPart textPart = new MimeBodyPart();
            textPart.setText ("");
            Multipart mp = new MimeMultipart();
            mp.addBodyPart (textPart);
            message.setContent (mp);
            message.saveChanges ();
            messageUID = drafts.getUIDNext ();
            drafts.appendMessages (new Message[] { message });
            System.out.println("MessageUID=" + messageUID);


....

And here is what is saved

Message-ID: <2039470468.1.1297700695502.JavaMail.jhuff@localhost>
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_0_1479099022.1297700695474"

------=_Part_0_1479099022.1297700695474
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


------=_Part_0_1479099022.1297700695474--



> appendMessages(Message[]) does not save the from address
> --------------------------------------------------------
>
>                 Key: IMAP-257
>                 URL: https://issues.apache.org/jira/browse/IMAP-257
>             Project: JAMES Imap
>          Issue Type: Bug
>            Reporter: Jeff Huff
>
> Creating a new empty message in a Drafts folder stopped saving the from address when
calling appendMessages(Message[]).
>             InternetAddress addr = new InternetAddress ("jhuff@localhost", "Jeff Huff");
>             Message message = new MimeMessage(session);
>             message.setFrom (addr);
>             message.setFlag (Flags.Flag.DRAFT, true);
>             message.setText ("");
>             message.saveChanges ();
>             messageUID = drafts.getUIDNext ();
>             drafts.appendMessages (new Message[] { message });
>             System.out.println("MessageUID=" + messageUID);
> Yet if you add a call to setSentDate(new Date()); on a MimeMessage right after setFrom,
it will set the From address.  I have tried calling other methods to get it to refresh the
headers, but nothing else seems to cause the from address to stick when added to the folder.
> This was working in M2.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message