diff --git a/FAQ.md b/FAQ.md
index a65f621f04..e391315ee2 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -300,6 +300,8 @@ Fonts, sizes, colors, etc should be material design whenever possible.
* [(164) Can you add customizable themes?](#user-content-faq164)
* [(165) Is Android Auto supported?](#user-content-faq165)
* [(166) Can I snooze a message across multiple devices?](#user-content-faq166)
+* [(167) How can I use DeepL?](#user-content-faq168)
+* [(168) What is a spam block list?](#user-content-faq167)
[I have another question.](#user-content-support)
@@ -3714,6 +3716,20 @@ This feature requires an internet connection and is not available in the Play st
+
+**(168) What is a spam block list?**
+
+A spam block list is basically a list of domain names which have been used to send spam or to spread malware.
+
+For more information, please see [this article](https://en.wikipedia.org/wiki/Domain_Name_System-based_blackhole_list).
+
+FairEmail currently uses the following block lists:
+
+* [Spamhaus zen](https://www.spamhaus.org/zen/) - [Terms of Use](https://www.spamhaus.org/organization/dnsblusage/)
+* [Spamcop](https://www.spamcop.net/) - [Legal info](https://www.spamcop.net/fom-serve/cache/297.html)
+
+
+
Get support
FairEmail is supported on Android smartphones and tablets and ChromeOS only.
diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java
index 1fe0c2dbb8..6639a79f7b 100644
--- a/app/src/main/java/eu/faircode/email/Core.java
+++ b/app/src/main/java/eu/faircode/email/Core.java
@@ -3367,6 +3367,21 @@ class Core {
}
runRules(context, imessage, account, folder, message, rules);
+
+ if (message.blocklist != null && message.blocklist) {
+ boolean use_blocklist = prefs.getBoolean("use_blocklist", false);
+ if (use_blocklist) {
+ EntityLog.log(context, "Block list" +
+ " folder=" + folder.name +
+ " message=" + message.id +
+ "@" + new Date(message.received) +
+ ":" + message.subject);
+ EntityFolder junk = db.folder().getFolderByType(message.account, EntityFolder.JUNK);
+ if (junk != null)
+ EntityOperation.queue(context, message, EntityOperation.MOVE, junk.id, false);
+ }
+ }
+
if (download && !message.ui_hide &&
MessageClassifier.isEnabled(context) && folder.auto_classify_source)
db.message().setMessageUiHide(message.id, true); // keep local value
diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogJunk.java b/app/src/main/java/eu/faircode/email/FragmentDialogJunk.java
index 2685a99250..b9b0a43d58 100644
--- a/app/src/main/java/eu/faircode/email/FragmentDialogJunk.java
+++ b/app/src/main/java/eu/faircode/email/FragmentDialogJunk.java
@@ -54,7 +54,8 @@ public class FragmentDialogJunk extends FragmentDialogBase {
final boolean inJunk = args.getBoolean("inJunk");
final boolean canBlock = args.getBoolean("canBlock");
- View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_junk, null);
+ final Context context = getContext();
+ final View view = LayoutInflater.from(context).inflate(R.layout.dialog_junk, null);
final TextView tvMessage = view.findViewById(R.id.tvMessage);
final ImageButton ibInfoProvider = view.findViewById(R.id.ibInfoProvider);
final CheckBox cbBlockSender = view.findViewById(R.id.cbBlockSender);
@@ -64,9 +65,15 @@ public class FragmentDialogJunk extends FragmentDialogBase {
final Button btnEditRules = view.findViewById(R.id.btnEditRules);
final CheckBox cbJunkFilter = view.findViewById(R.id.cbJunkFilter);
final ImageButton ibInfoFilter = view.findViewById(R.id.ibInfoFilter);
+ final CheckBox cbBlocklist = view.findViewById(R.id.cbBlocklist);
+ final ImageButton ibInfoBlocklist = view.findViewById(R.id.ibInfoBlocklist);
final Group grpInJunk = view.findViewById(R.id.grpInJunk);
final Group grpMore = view.findViewById(R.id.grpMore);
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ boolean check_blocklist = prefs.getBoolean("check_blocklist", false);
+ boolean use_blocklist = prefs.getBoolean("use_blocklist", false);
+
// Wire controls
ibInfoProvider.setOnClickListener(new View.OnClickListener() {
@@ -119,7 +126,7 @@ public class FragmentDialogJunk extends FragmentDialogBase {
@Override
protected void onExecuted(Bundle args, EntityFolder inbox) {
- LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(getContext());
+ LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_EDIT_RULES)
.putExtra("account", account)
@@ -135,7 +142,7 @@ public class FragmentDialogJunk extends FragmentDialogBase {
}
}.execute(FragmentDialogJunk.this, args, "junk:rules");
} else {
- LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(getContext());
+ LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_EDIT_RULES)
.putExtra("account", account)
@@ -208,13 +215,31 @@ public class FragmentDialogJunk extends FragmentDialogBase {
}
});
+ cbBlocklist.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ prefs.edit()
+ .putBoolean("check_blocklist", isChecked)
+ .putBoolean("use_blocklist", isChecked)
+ .apply();
+ }
+ });
+
+ ibInfoBlocklist.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Helper.viewFAQ(v.getContext(), 168, true);
+ }
+ });
+
// Initialize
tvMessage.setText(inJunk
? getString(R.string.title_folder_junk)
: getString(R.string.title_ask_spam_who, from));
- cbBlockSender.setEnabled(canBlock && ActivityBilling.isPro(getContext()));
+ cbBlockSender.setEnabled(canBlock && ActivityBilling.isPro(context));
cbBlockDomain.setEnabled(false);
ibMore.setImageLevel(1);
+ cbBlocklist.setChecked(check_blocklist && use_blocklist);
grpInJunk.setVisibility(inJunk ? View.GONE : View.VISIBLE);
grpMore.setVisibility(inJunk ? View.VISIBLE : View.GONE);
@@ -259,7 +284,7 @@ public class FragmentDialogJunk extends FragmentDialogBase {
}
}.execute(FragmentDialogJunk.this, args, "junk:filter");
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext())
+ AlertDialog.Builder builder = new AlertDialog.Builder(context)
.setView(view)
.setNegativeButton(android.R.string.cancel, null);
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java
index 940e01d788..f818f862ed 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java
@@ -96,7 +96,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
"enabled", "poll_interval", "auto_optimize", "schedule", "schedule_start", "schedule_end",
"sync_nodate", "sync_unseen", "sync_flagged", "delete_unseen", "sync_kept", "gmail_thread_id",
"sync_folders", "sync_shared_folders", "subscriptions",
- "check_authentication", "check_reply_domain", "check_mx", "check_blocklist", "tune_keep_alive"
+ "check_authentication", "check_reply_domain", "check_mx", "check_blocklists", "tune_keep_alive"
};
@Override
diff --git a/app/src/main/res/layout/dialog_junk.xml b/app/src/main/res/layout/dialog_junk.xml
index 472020a3d3..694b6b9e11 100644
--- a/app/src/main/res/layout/dialog_junk.xml
+++ b/app/src/main/res/layout/dialog_junk.xml
@@ -150,6 +150,44 @@
app:layout_constraintTop_toTopOf="@id/cbJunkFilter"
app:srcCompat="@drawable/twotone_info_24" />
+
+
+
+
+
+
+ cbJunkFilter,tvJunkFilterHint,ibInfoFilter,
+ cbBlocklist,tvBlocklistHint,ibInfoBlocklist" />
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 7c703da61a..c5ef1971db 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -99,6 +99,7 @@
Use local spam filter
This can increase battery usage and incorrectly mark messages as spam
+ Use spam block lists
Sending messages
Waiting for suitable connection
@@ -971,7 +972,7 @@
Moving to %1$s (%2$d)
Open with
%1$s authentication failed
- On blocklist
+ On spam block list
Read receipt: %1$s
This read receipt only acknowledges that the message was displayed. There is no guarantee that the recipient has read the message contents.