mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-27 10:17:18 +00:00
Fixed received from IP
This commit is contained in:
parent
5c47f41b36
commit
3a7f3bce01
1 changed files with 12 additions and 3 deletions
|
@ -849,9 +849,18 @@ public class MessageHelper {
|
|||
if (received == null || received.length == 0)
|
||||
return null;
|
||||
|
||||
String[] h = MimeUtility.unfold(received[received.length - 1]).split("\\s+");
|
||||
if (h.length > 1 && h[0].equalsIgnoreCase("from"))
|
||||
return h[1];
|
||||
String origin = MimeUtility.unfold(received[received.length - 1]);
|
||||
|
||||
String[] h = origin.split("\\s+");
|
||||
if (h.length > 1 && h[0].equalsIgnoreCase("from")) {
|
||||
String host = h[1];
|
||||
if (host.startsWith("["))
|
||||
host = host.substring(1);
|
||||
if (host.endsWith("]"))
|
||||
host = host.substring(0, host.length() - 1);
|
||||
if (!TextUtils.isEmpty(host))
|
||||
return host;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue