MCPcopy Create free account
hub / github.com/M66B/FairEmail / isJunk

Method isJunk

app/src/main/java/eu/faircode/email/DnsBlockList.java:159–173  ·  view source on GitHub ↗
(Context context, String[] received)

Source from the content-addressed store, hash-verified

157 }
158
159 static Boolean isJunk(Context context, String[] received) {
160 if (received == null || received.length == 0)
161 return null;
162
163 String host = getFromHost(MimeUtility.unfold(received[received.length - 1]));
164 if (host == null)
165 return null;
166 boolean numeric = host.startsWith("[") && host.endsWith("]");
167 if (numeric)
168 host = host.substring(1, host.length() - 1);
169 else if (!PatternsCompat.DOMAIN_NAME.matcher(host).matches())
170 return null;
171
172 return isJunk(context, host, true, BLOCK_LISTS);
173 }
174
175 static Boolean isJunk(Context context, List<Address> addresses) {
176 if (ContactInfo.getLookupUri(addresses) != null)

Callers 4

onExecuteMethod · 0.95
evaluateMethod · 0.95
onSynchronizeMessagesMethod · 0.95
synchronizeMessageMethod · 0.95

Calls 15

getFromHostMethod · 0.95
unfoldMethod · 0.95
getLookupUriMethod · 0.95
getEmailDomainMethod · 0.95
isExpiredMethod · 0.95
isJunkMethod · 0.95
isEnabledMethod · 0.95
getAllByNameMethod · 0.95
iMethod · 0.95
wMethod · 0.95
getByNameMethod · 0.95
getToMethod · 0.80

Tested by

no test coverage detected