Use authentication results of last receiving server only

pull/206/head
M66B 3 years ago
parent 5372365935
commit 7dd51b817a

@ -1278,14 +1278,20 @@ public class MessageHelper {
String[] getAuthentication() throws MessagingException { String[] getAuthentication() throws MessagingException {
ensureHeaders(); ensureHeaders();
String[] headers = imessage.getHeader("Authentication-Results"); List<String> auths = new ArrayList<>();
if (headers == null) Enumeration<Header> headers = imessage.getAllHeaders();
return null; while (headers.hasMoreElements()) {
Header header = headers.nextElement();
for (int i = 0; i < headers.length; i++) if ("Received".equals(header.getName()))
headers[i] = MimeUtility.unfold(headers[i]); break;
else if ("Authentication-Results".equals(header.getName()))
auths.add(MimeUtility.unfold(header.getValue()));
}
return headers; if (auths.size() == 0)
return null;
else
return auths.toArray(new String[0]);
} }
static Boolean getAuthentication(String type, String[] headers) { static Boolean getAuthentication(String type, String[] headers) {

Loading…
Cancel
Save