最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

email client - Why I am not getting the 'Authentication-Results' header in my Exchange headers in Camel? - Stack

programmeradmin2浏览0评论

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;
}
}

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论