I have a Springboot+Camel+Email app where I am listening to emails on a mailbox over IMAP. While debugging I notice that the 'Authentication-Results' header is missing in my app whenever the 'X-MS-Exchange-Organization-AuthAs' is 'Internal'. However, in my email client I see the header 'Authentication-Results' present as in the image below. Does Camel truncate it under the hood? Or I am missing something. I do get this header 'Authentication-Results' in my logs when the header 'X-MS-Exchange-Organization-AuthAs' is 'Anonymous'. Thanks in advance for any suggestions. I need this header 'Authentication-Results' to build an anti spoofing check in my IMAP processing logic.
My Camel code snippet:
@Override
public void process(Exchange exchange) throws Exception {
if (!validateDmarc(exchange)) {
exchange.setException(new Exception(
"Authentication-Results header is empty"));
exchange.getIn().setHeader("spoofingDetected", "true");
return;
}
private boolean validateDmarc(Exchange exchange) {
Message message = exchange.getIn();
message.getHeaders().forEach((key, value) -> LOG.info("Key: {} | Value: {}", key, value));
// I don't get the 'Authentication-Results' header logged but the attached image contains it in email client
String authenticationResults = message.getHeader("Authentication-Results",
String.class);
if (null == authenticationResults || authenticationResults.trim().isEmpty()) {
return false;
}
}