Improved list post header parsing

This commit is contained in:
M66B 2019-06-21 08:52:06 +02:00
parent f3e5159168
commit 3314ffaa09
1 changed files with 4 additions and 2 deletions

View File

@ -609,9 +609,11 @@ public class MessageHelper {
// https://www.ietf.org/rfc/rfc2368.txt
for (String _to : list.split(",")) {
String to = _to.trim();
if (to.startsWith("<") && to.endsWith(">"))
int lt = to.indexOf("<");
int gt = to.lastIndexOf(">");
if (lt >= 0 && gt > lt)
try {
MailTo mailto = MailTo.parse(to.substring(1, to.length() - 1));
MailTo mailto = MailTo.parse(to.substring(lt + 1, gt));
if (mailto.getTo() != null)
return new Address[]{new InternetAddress(mailto.getTo().split(",")[0])};
} catch (android.net.ParseException ex) {