diff --git a/src/main/java/uk/co/fivium/dmda/emailmessages/EmailMessage.java b/src/main/java/uk/co/fivium/dmda/emailmessages/EmailMessage.java index 73b1c08..563c406 100644 --- a/src/main/java/uk/co/fivium/dmda/emailmessages/EmailMessage.java +++ b/src/main/java/uk/co/fivium/dmda/emailmessages/EmailMessage.java @@ -127,7 +127,12 @@ private void readMessageBody(){ while(lHeaderEnumeration.hasMoreElements()){ Header lCurrentHeader = Header.class.cast(lHeaderEnumeration.nextElement()); - mHeaderMap.put(lCurrentHeader.getName(), decodeHeaderValue(lCurrentHeader)); + try { + mHeaderMap.put(lCurrentHeader.getName(), decodeHeaderValue(lCurrentHeader)); + } + catch(MessagingException ex) { + mLogger.warn("Failed to decode value for header {}", lCurrentHeader.getName(), ex); + } } stripAttachments(lMimeMessage);