You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Jeff Huff (JIRA)" <se...@james.apache.org> on 2011/02/12 01:41:57 UTC

[jira] Created: (IMAP-257) appendMessages(Message[]) does not save the from address

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


[jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/IMAP-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993968#comment-12993968 ] 

Norman Maurer commented on IMAP-257:
------------------------------------

we upgrade to javamail 1.4.4 could you see if it make any difference with 1.4.3 `?

> 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


[jira] Updated: (JAMES-1199) appendMessages(Message[]) does skip the first header

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/JAMES-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Norman Maurer updated JAMES-1199:
---------------------------------

    Summary: appendMessages(Message[]) does skip the first header  (was: appendMessages(Message[]) does not save the from address)

Better reflect the real problem

> appendMessages(Message[]) does skip the first header
> ----------------------------------------------------
>
>                 Key: JAMES-1199
>                 URL: https://issues.apache.org/jira/browse/JAMES-1199
>             Project: JAMES Server
>          Issue Type: Bug
>            Reporter: Jeff Huff
>            Assignee: Norman Maurer
>
> 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


[jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/IMAP-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995493#comment-12995493 ] 

Norman Maurer commented on IMAP-257:
------------------------------------

the code for append is here:

http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java?view=markup

So you say when you append the message to the folder the from is not stored in the headers right ?

> 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


[jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address

Posted by "Jeff Huff (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/IMAP-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995544#comment-12995544 ] 

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

Ok, it is dropping the first header.  If I add one statement, setSentDate(new Date()), the From address is saved to the appended message, BUT the Date is missing.

So this code appends a message with the From, but looses the Date: header because it is the first one.

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

DEBUG: JavaMail version 1.4.4
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
DEBUG: mail.imap.statuscachetimeout: 1000
DEBUG: mail.imap.appendbuffersize: -1
DEBUG: mail.imap.minidletime: 10
DEBUG: trying to connect to host "localhost", port 143, isSSL false
* OK JAMES IMAP4rev1 Server  Server 169.254.53.191 is ready.
A0 CAPABILITY
* CAPABILITY IMAP4rev1 LITERAL+ CHILDREN IDLE NAMESPACE UIDPLUS UNSELECT
A0 OK CAPABILITY completed.
DEBUG: protocolConnect login, host=localhost, user=jhuff@localhost, password=<non-null>
A1 LOGIN jhuff@localhost carefx
A1 OK LOGIN completed.
A2 CAPABILITY
* CAPABILITY IMAP4rev1 LITERAL+ CHILDREN IDLE NAMESPACE UIDPLUS UNSELECT
A2 OK CAPABILITY completed.
A3 LIST "" Drafts
* LIST (\HasNoChildren) "." "Drafts"
A3 OK LIST completed.
DEBUG: connection available -- size: 1
A4 SELECT Drafts
* FLAGS (\Answered \Deleted \Draft \Flagged \Seen)
* 1 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1265750761]
* OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen)]
* OK [UIDNEXT 11]
A4 OK [READ-WRITE] SELECT completed.
A5 FETCH 1 (UID)
* 1 FETCH (UID 10)
A5 OK FETCH completed.
UID=10
A6 APPEND Drafts (\Draft) "16-Feb-2011 15:11:52 -0700" {420+}
Date: Wed, 16 Feb 2011 15:11:52 -0700 (MST)
From: Jeff Huff <jh...@localhost>
Message-ID: <93...@localhost>
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_0_1494824825.1297894312910"

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

test
------=_Part_0_1494824825.1297894312910--

* 2 EXISTS
* 1 RECENT
A6 OK [APPENDUID 1265750761 11] APPEND completed.
MessageUID=11
A7 CLOSE
A7 OK CLOSE completed.
DEBUG: added an Authenticated connection -- size: 1
DEBUG: connection available -- size: 1
A8 SELECT Drafts
* FLAGS (\Answered \Deleted \Draft \Flagged \Seen)
* 1 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1265750761]
* OK [UNSEEN 1]
* OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen)]
* OK [UIDNEXT 12]
A8 OK [READ-WRITE] SELECT completed.
A9 UID FETCH 11 (UID)
* 1 FETCH (UID 11)
A9 OK FETCH completed.
com.sun.mail.imap.IMAPMessage@6791d8c1
A10 CLOSE
A10 OK CLOSE completed.
DEBUG: added an Authenticated connection -- size: 1
A11 LOGOUT
* BYE IMAP4rev1 Server logging out
A11 OK LOGOUT completed.
DEBUG: IMAPStore connection dead
DEBUG: IMAPStore cleanup, force false
DEBUG: IMAPStore cleanup done


And the actual message appended...

From: Jeff Huff <jh...@localhost>
Message-ID: <93...@localhost>
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_0_1494824825.1297894312910"

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

test
------=_Part_0_1494824825.1297894312910--

Notice the first field from the mail.debug shows that a Date: header was there, but it did not make it into the appended message.


> 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


[jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address

Posted by "Jeff Huff (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/IMAP-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995543#comment-12995543 ] 

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

I don't think it is in the JPA code, I switched to the memory mailstore in mailbox.xml and the same issue.

If I turn on mail.debug = true in the properties that I connect with in the simple case from the Description of the issue, I see that the From is sent to the IMAP processor...


DEBUG: JavaMail version 1.4.4
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
DEBUG: mail.imap.statuscachetimeout: 1000
DEBUG: mail.imap.appendbuffersize: -1
DEBUG: mail.imap.minidletime: 10
DEBUG: trying to connect to host "localhost", port 143, isSSL false
* OK JAMES IMAP4rev1 Server  Server 169.254.53.191 is ready.
A0 CAPABILITY
* CAPABILITY IMAP4rev1 LITERAL+ CHILDREN IDLE NAMESPACE UIDPLUS UNSELECT
A0 OK CAPABILITY completed.
DEBUG: protocolConnect login, host=localhost, user=jhuff@localhost, password=<non-null>
A1 LOGIN jhuff@localhost carefx
A1 OK LOGIN completed.
A2 CAPABILITY
* CAPABILITY IMAP4rev1 LITERAL+ CHILDREN IDLE NAMESPACE UIDPLUS UNSELECT
A2 OK CAPABILITY completed.
A3 LIST "" Drafts
* LIST (\HasNoChildren) "." "Drafts"
A3 OK LIST completed.
DEBUG: connection available -- size: 1
A4 SELECT Drafts
* FLAGS (\Answered \Deleted \Draft \Flagged \Seen)
* 1 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1265750761]
* OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen)]
* OK [UIDNEXT 8]
A4 OK [READ-WRITE] SELECT completed.
A5 FETCH 1 (UID)
* 1 FETCH (UID 7)
A5 OK FETCH completed.
UID=7
A6 APPEND Drafts (\Draft) {368+}
From: Jeff Huff <jh...@localhost>
Message-ID: <93...@localhost>
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_0_233814070.1297893791029"

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


------=_Part_0_233814070.1297893791029--

* 2 EXISTS
* 1 RECENT
A6 OK [APPENDUID 1265750761 8] APPEND completed.
MessageUID=8
A7 CLOSE
A7 OK CLOSE completed.
DEBUG: added an Authenticated connection -- size: 1
DEBUG: connection available -- size: 1
A8 SELECT Drafts
* FLAGS (\Answered \Deleted \Draft \Flagged \Seen)
* 1 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1265750761]
* OK [UNSEEN 1]
* OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen)]
* OK [UIDNEXT 9]
A8 OK [READ-WRITE] SELECT completed.
A9 UID FETCH 8 (UID)
* 1 FETCH (UID 8)
A9 OK FETCH completed.
com.sun.mail.imap.IMAPMessage@39617189
A10 CLOSE
A10 OK CLOSE completed.
DEBUG: added an Authenticated connection -- size: 1
A11 LOGOUT
* BYE IMAP4rev1 Server logging out
A11 OK LOGOUT completed.
DEBUG: IMAPStore connection dead
DEBUG: IMAPStore cleanup, force false
DEBUG: IMAPStore cleanup done


> 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


[jira] Resolved: (JAMES-1199) appendMessages(Message[]) does skip the first header

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/JAMES-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Norman Maurer resolved JAMES-1199.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0-M3

fixed... Thanks for all the help

> appendMessages(Message[]) does skip the first header
> ----------------------------------------------------
>
>                 Key: JAMES-1199
>                 URL: https://issues.apache.org/jira/browse/JAMES-1199
>             Project: JAMES Server
>          Issue Type: Bug
>            Reporter: Jeff Huff
>            Assignee: Norman Maurer
>             Fix For: 3.0-M3
>
>
> 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


[jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/IMAP-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995689#comment-12995689 ] 

Norman Maurer commented on IMAP-257:
------------------------------------

Ah ok.. Thanks for all the debugging.

I guess the bug is in  org.apache.james.imapserver.netty.ImapRequestFrameDecoder

I will try to fix the problem ASAP.

> 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


[jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address

Posted by "Jeff Huff (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/IMAP-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995351#comment-12995351 ] 

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

This is very odd.  In another case, I clone a message from the Drafts folder and send it and also append it to the Sent folder.  The sent mail gets delivered with the From address, the appended message does not have the From address.


                // Get the source message from Drafts
                MimeMessage sourceMsg = (MimeMessage)source.getMessage (m_messageIds[0]);
                
                // Clone the original draft and update the changes
                MimeMessage message = new MimeMessage(sourceMsg);
                if (logger.isFinestLoggable ())
                {
                    logger.finest("Cloned From address: " + String.valueOf(message.getFrom ()));
                }
                message.setFrom (m_fromAddress);  // Should not have to do this and the cloned from is there
                message.setSentDate(new Date());
                message.setRecipients (RecipientType.TO, m_toAddresses);
                message.setRecipients (RecipientType.CC, m_ccAddresses);
                message.setSubject (m_subject);
                MailUtil.setText (message, m_messageText);
                MailUtil.setPHIHeader (message, m_phi);
                MailUtil.setContextData (message, m_phiData);
                MailUtil.setHighPriority (message, m_priority);
                message.saveChanges ();
                
                if (m_type == CommandType.SEND)
                {
                    message.setHeader("X-Mailer", "CarefxSecureInbox");
                    message.setFlag (Flags.Flag.DRAFT, false);
                    
                    // Send the message
                    logger.finest("Sending message");
                    Transport.send (message);
                    
                    if (logger.isFinestLoggable ())
                    {
                        logger.finest ("Copying message to folder " + target.getFullName ());
                    }

                    // Save a copy in the target folder Sent
                    target.appendMessages (new Message[] { message });
                }
                else
                {
                    // Save the updated draft
                    source.appendMessages (new Message[] { message });
                }
         
                // Delete the original draft
                sourceMsg.setFlag (Flags.Flag.DELETED, true);
                
                // Close the source and expunge
                if (source.isOpen ())
                {
                    source.close (true);
                }


The message saved in Sent...
Message-ID: <14...@localhost>
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_3_881188600.1297870940779"
Date: Wed, 16 Feb 2011 08:42:32 -0700 (MST)
To: Jeff Huff <jh...@localhost>
Subject: test
X-PHI: False
X-Mailer: CarefxSecureInbox

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

test
------=_Part_3_881188600.1297870940779--


The message recieved to INBOX...

Return-Path: <jh...@localhost>
MIME-Version: 1.0
Received: from 127.0.0.1 ([127.0.0.1])
          by 169.254.53.191 (JAMES SMTP Server ) with ESMTP ID 2082453048
          for <jh...@localhost>;
          Wed, 16 Feb 2011 08:42:33 -0700 (MST)
From: Jeff Huff <jh...@localhost>
Message-ID: <14...@localhost>
Content-Type: multipart/mixed; 
	boundary="----=_Part_3_881188600.1297870940779"
Date: Wed, 16 Feb 2011 08:42:32 -0700 (MST)
To: Jeff Huff <jh...@localhost>
Subject: test
X-PHI: False
X-Mailer: CarefxSecureInbox

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

test
------=_Part_3_881188600.1297870940779--

The only difference is the From address is not there on the Sent folder message that was appended.

I am having a hard time finding the IMAP code that saves the folders.  I can help look if I know which project it is in.  james-imap, or james-server?


> 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


[jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address

Posted by "Jeff Huff (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/IMAP-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995511#comment-12995511 ] 

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

Yes, the same message is sent via Transport.send() is then appended to the Sent folder.  The message received to the inbox that was sent has three additional headers that the one saved to the Sent folder does not: Return-Path, From, and Received.  When I look in the JPA tables in the database, james_mail_header, I can see that the Sent mail does not have the from address.  The return-path and received are probably added by the server on delivery.

It is looking like any call to appendMessages(Message[]) does save the from header to the database.  I am looking through the StoreMessageManager code to see how it works.

> 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


[jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address

Posted by "Jeff Huff (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/IMAP-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995582#comment-12995582 ] 

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

More of the same.  Always looses the first header does not matter what it is.
Simplist possible message and appendMessages()

            Message message = new MimeMessage(session);
            message.setText ("");
            message.saveChanges ();
            messageUID = drafts.getUIDNext ();
            drafts.appendMessages (new Message[] { message });

Debug commands sent to IMAP shows the Message-ID is sent....

A6 APPEND Drafts () {165+}
Message-ID: <19...@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


* 2 EXISTS
* 1 RECENT
A6 OK [APPENDUID 1265750761 12] APPEND completed.
MessageUID=12
A7 CLOSE
A7 OK CLOSE completed.

Message saved in Drafts is missing Message-ID...

MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Trying to see if it is ImapRequestLineReader or ImapRequestStreamLineReader or something in AppendCommandParser with a new test case.



> 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


[jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address

Posted by "Jeff Huff (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/IMAP-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995520#comment-12995520 ] 

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

If I look at both messages in the james_mail table and view the MAIL_BYTES column data, the raw message is consistent with the headers in james_mail_header.  The delivered one to the Inbox has the From: header, the one that was appended to the Sent folder does not.

> 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


[jira] Commented: (IMAP-257) appendMessages(Message[]) does not save the from address

Posted by "Jeff Huff (JIRA)" <se...@james.apache.org>.
    [ 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: <20...@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


[jira] Assigned: (JAMES-1199) appendMessages(Message[]) does not save the from address

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/JAMES-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Norman Maurer reassigned JAMES-1199:
------------------------------------

    Assignee: Norman Maurer

> appendMessages(Message[]) does not save the from address
> --------------------------------------------------------
>
>                 Key: JAMES-1199
>                 URL: https://issues.apache.org/jira/browse/JAMES-1199
>             Project: JAMES Server
>          Issue Type: Bug
>            Reporter: Jeff Huff
>            Assignee: Norman Maurer
>
> 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