Quantcast
Channel: Aspose.Email Product Family
Viewing all articles
Browse latest Browse all 1367

MailMessage.validateMessage returns errors on well-formed addresses

$
0
0
Hi,

We validate .eml files before processing with the following code

ileInputStream fContentstream = new FileInputStream(inFilePath.toFile());
EmlValidationErrorCollection errors = MailMessage.validateMessage(fContentstream);
boolean isFatal = false;

Iterator<EmlValidationError> iterator = errors.iterator();
while (iterator.hasNext()) {
EmlValidationError error = iterator.next();
Logger.debug("ERROR:" + error.getErrorMessage(), null);
Logger.debug("ERROR-TYPE:" + error.getErrorType(), null);
Logger.debug("ERROR-LINENUMBER:" + error.getLineNumber(), null);
Logger.debug("ERROR-CLASS:" + error.getClass(), null);
}
The problem we are encountering now is that the validator is returning errors on what to us appears to be a valid eml, on lines that look be correctly formatted addresses.

The error returned is:
error.getErrorMessage() => Special character is found at inappropriate position.
error.getErrorType() => 1
error.getLineNumber() => 53
error.getClass() =>1 class com.aspose.email.EmlValidationError
in the .eml line 53 and 55 are
To: dev.captiva <dev.captiva@fidea.be>
Cc: dev2.captiva <dev2.captiva@fidea.be>
When this is changed to
To: "dev.captiva" <dev.captiva@fidea.be>
Cc: "dev2.captiva" <dev2.captiva@fidea.be>
The validation dies not return errors. This however should not cause these errors.

Other online eml validators show no errors in the .eml file.

could you please investigate? In attachment you will find the email in question

We are using email 16.10.0

regards

Viewing all articles
Browse latest Browse all 1367

Trending Articles