mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 14:17:03 +02:00
Warn for blocking common domains
This commit is contained in:
@@ -858,7 +858,7 @@ public class EntityRule {
|
||||
return cal;
|
||||
}
|
||||
|
||||
static EntityRule blockSender(Context context, EntityMessage message, EntityFolder junk, boolean block_domain, List<String> whitelist) throws JSONException {
|
||||
static EntityRule blockSender(Context context, EntityMessage message, EntityFolder junk, boolean block_domain) throws JSONException {
|
||||
if (message.from == null || message.from.length == 0)
|
||||
return null;
|
||||
|
||||
@@ -873,17 +873,8 @@ public class EntityRule {
|
||||
if (block_domain) {
|
||||
int at = sender.indexOf('@');
|
||||
if (at > 0) {
|
||||
boolean whitelisted = false;
|
||||
String domain = UriHelper.getParentDomain(context, sender.substring(at + 1));
|
||||
for (String d : whitelist)
|
||||
if (domain.matches(d)) {
|
||||
whitelisted = true;
|
||||
break;
|
||||
}
|
||||
if (!whitelisted) {
|
||||
regex = true;
|
||||
sender = ".*@.*" + domain + ".*";
|
||||
}
|
||||
regex = true;
|
||||
sender = ".*@.*" + sender.substring(at + 1) + ".*";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user