Fixed parsing non essential addresses

pull/156/head
M66B 6 years ago
parent ffdeec1e79
commit 6486e306a8

@ -20,7 +20,6 @@ package eu.faircode.email;
*/ */
import android.content.Context; import android.content.Context;
import android.text.Html;
import android.text.TextUtils; import android.text.TextUtils;
import android.webkit.MimeTypeMap; import android.webkit.MimeTypeMap;
@ -483,6 +482,7 @@ public class MessageHelper {
} }
Address[] getReceiptTo() throws MessagingException { Address[] getReceiptTo() throws MessagingException {
try {
String to = imessage.getHeader("Disposition-Notification-To", null); String to = imessage.getHeader("Disposition-Notification-To", null);
if (to == null) if (to == null)
return null; return null;
@ -502,6 +502,10 @@ public class MessageHelper {
fix(address[0]); fix(address[0]);
return new Address[]{address[0]}; return new Address[]{address[0]};
} catch (AddressException ex) {
Log.w(ex);
return null;
}
} }
String getAuthentication() throws MessagingException { String getAuthentication() throws MessagingException {
@ -560,6 +564,7 @@ public class MessageHelper {
} }
Address[] getListPost() throws MessagingException { Address[] getListPost() throws MessagingException {
try {
// https://www.ietf.org/rfc/rfc2369.txt // https://www.ietf.org/rfc/rfc2369.txt
String list = imessage.getHeader("List-Post", null); String list = imessage.getHeader("List-Post", null);
if (list == null || "NO".equals(list)) if (list == null || "NO".equals(list))
@ -580,6 +585,10 @@ public class MessageHelper {
fix(address[0]); fix(address[0]);
return new Address[]{address[0]}; return new Address[]{address[0]};
} catch (AddressException ex) {
Log.w(ex);
return null;
}
} }
private static Address[] fix(Address[] addresses) { private static Address[] fix(Address[] addresses) {

Loading…
Cancel
Save