mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Use authentication results of last receiving server only
This commit is contained in:
parent
5372365935
commit
7dd51b817a
1 changed files with 13 additions and 7 deletions
|
@ -1278,14 +1278,20 @@ public class MessageHelper {
|
|||
String[] getAuthentication() throws MessagingException {
|
||||
ensureHeaders();
|
||||
|
||||
String[] headers = imessage.getHeader("Authentication-Results");
|
||||
if (headers == null)
|
||||
List<String> auths = new ArrayList<>();
|
||||
Enumeration<Header> headers = imessage.getAllHeaders();
|
||||
while (headers.hasMoreElements()) {
|
||||
Header header = headers.nextElement();
|
||||
if ("Received".equals(header.getName()))
|
||||
break;
|
||||
else if ("Authentication-Results".equals(header.getName()))
|
||||
auths.add(MimeUtility.unfold(header.getValue()));
|
||||
}
|
||||
|
||||
if (auths.size() == 0)
|
||||
return null;
|
||||
|
||||
for (int i = 0; i < headers.length; i++)
|
||||
headers[i] = MimeUtility.unfold(headers[i]);
|
||||
|
||||
return headers;
|
||||
else
|
||||
return auths.toArray(new String[0]);
|
||||
}
|
||||
|
||||
static Boolean getAuthentication(String type, String[] headers) {
|
||||
|
|
Loading…
Reference in a new issue