Mail from first header

pull/215/head
M66B 7 months ago
parent 420d78efeb
commit bce1420a4e

@ -2204,18 +2204,17 @@ public class MessageHelper {
} }
Address[] getMailFrom(String[] headers) { Address[] getMailFrom(String[] headers) {
if (headers == null) if (headers == null || headers.length == 0)
return null; return null;
Address[] mailfrom = null; Address[] mailfrom = null;
for (String header : headers) { String spf = getKeyValues(headers[0]).get("spf");
String spf = getKeyValues(header).get("spf");
if (spf == null) if (spf == null)
continue; return null;
int i = spf.indexOf(SMTP_MAILFORM + "="); int i = spf.indexOf(SMTP_MAILFORM + "=");
if (i < 0) if (i < 0)
continue; return null;
String v = spf.substring(i + SMTP_MAILFORM.length() + 1); String v = spf.substring(i + SMTP_MAILFORM.length() + 1);
int s = v.indexOf(' '); int s = v.indexOf(' ');
@ -2230,7 +2229,6 @@ public class MessageHelper {
} catch (Throwable ex) { } catch (Throwable ex) {
Log.w(ex); Log.w(ex);
} }
}
return mailfrom; return mailfrom;
} }

Loading…
Cancel
Save