Spring integration and release date

I'm using the latest spring integration libraries (4.1.5) javax.mail (1.4.7), but it looks like this problem has been sitting there from the start.

I'm trying to get the received date from a mail server over IMAP but SI always returns null. This is because of line 301 at https://github.com/spring-projects/spring-integration/blob/4.1.x/spring-integration-mail/src/main/java/org/springframework/integration/mail/AbstractMailReceiver .java

MimeMessage mimeMessage = new IntegrationMimeMessage((MimeMessage) filteredMessages[i]);

      

So instead of letting me get an IMAPMessage instance, it forces me to get a MimeMessage, which has a stub for the getReceivedDate method:

public Date getReceivedDate() throws MessagingException {
return null;    
}

      

I can see that the header contains a non null Received element , so the only option I see is to manually parse that header.

Is this correct SI behavior? Error or feature? And how to avoid manually parsing the resulting date header?

+3


source to share


2 answers


I am looking at Sun's code; it uses the selector INTERNALDATE

to populate the property receivedDate

...

Line 1194 in javamail 1.5.2 ...



else if (item instanceof INTERNALDATE)
    receivedDate = ((INTERNALDATE)item).getDate();

      

However, Spring does not disclose this; I created a JIRA issue .

+1


source


The resulting date is available as a selection item internaldate

.



Parsing Received is a big problem and probably the Spring devs haven't done it yet and why don't you hate it. See if there will be internaldate

.

+2


source







All Articles