From cbf626ac8615e3e32c5acd743f1cdfdafd99b6f7 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 1 Apr 2022 11:53:49 +0200 Subject: [PATCH] Validate rule forward email address --- app/src/main/java/eu/faircode/email/EntityRule.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index 12c9d1f8fb..271fedbefb 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -539,6 +539,8 @@ public class EntityRule { String to = jargs.optString("to"); if (TextUtils.isEmpty(to)) throw new IllegalArgumentException(context.getString(R.string.title_rule_answer_missing)); + else if (!Helper.EMAIL_ADDRESS.matcher(to).matches()) + throw new IllegalArgumentException(context.getString(R.string.title_email_invalid, to)); } else { EntityAnswer answer = db.answer().getAnswer(aid); if (answer == null)