mirror of https://github.com/M66B/FairEmail.git
Merge pull request #211 from keykey7/dmarc-spf-ip-without-prefix
allow DMARC row validation for SPF IP without prefix
This commit is contained in:
commit
dbac9f4f4c
|
@ -272,9 +272,11 @@ public class ActivityDmarc extends ActivityBase {
|
|||
ip = ip.toLowerCase(Locale.ROOT);
|
||||
if (ip.startsWith("ip4:") || ip.startsWith("ip6:")) {
|
||||
String[] net = ip.substring(4).split("/");
|
||||
if (net.length != 2)
|
||||
if (net.length > 2)
|
||||
continue;
|
||||
Integer prefix = Helper.parseInt(net[1]);
|
||||
Integer prefix = ip.startsWith("ip4:") ? 32 : 128;
|
||||
if (net.length == 2)
|
||||
prefix = Helper.parseInt(net[1]);
|
||||
if (prefix == null)
|
||||
continue;
|
||||
if (ConnectionHelper.inSubnet(text, net[0], prefix)) {
|
||||
|
|
Loading…
Reference in New Issue