mirror of https://github.com/apache/nifi.git
NIFI-6695: ExtractEmailAttachments/ExtractEmailHeaders should not validate 'SendDate'
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #3757.
This commit is contained in:
parent
c7a2885c0c
commit
aba450d658
|
@ -22,7 +22,6 @@ import java.io.InputStream;
|
|||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -134,11 +133,6 @@ public class ExtractEmailAttachments extends AbstractProcessor {
|
|||
if (from == null) {
|
||||
throw new MessagingException("Message failed RFC-2822 validation: No Sender");
|
||||
}
|
||||
Date sentDate = originalMessage.getSentDate();
|
||||
if (sentDate == null) {
|
||||
// Throws MessageException due to lack of minimum required headers
|
||||
throw new MessagingException("Message failed RFC2822 validation: No Sent Date");
|
||||
}
|
||||
originalFlowFilesList.add(originalFlowFile);
|
||||
if (parser.hasAttachments()) {
|
||||
final String originalFlowFileName = originalFlowFile.getAttribute(CoreAttributes.FILENAME.key());
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.io.InputStream;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -178,11 +177,7 @@ public class ExtractEmailHeaders extends AbstractProcessor {
|
|||
if (from == null) {
|
||||
throw new MessagingException("Message failed RFC-2822 validation: No Sender");
|
||||
}
|
||||
Date sentDate = originalMessage.getSentDate();
|
||||
if (sentDate == null ) {
|
||||
// Throws MessageException due to lack of minimum required headers
|
||||
throw new MessagingException("Message failed RFC-2822 validation: No Sent Date");
|
||||
} else if (capturedHeadersList.size() > 0){
|
||||
if (capturedHeadersList.size() > 0){
|
||||
Enumeration headers = originalMessage.getAllHeaders();
|
||||
while (headers.hasMoreElements()) {
|
||||
Header header = (Header) headers.nextElement();
|
||||
|
|
Loading…
Reference in New Issue