From: Michael Tremer Date: Thu, 22 Jan 2026 16:17:03 +0000 (+0000) Subject: accounts: Add a probe handler to people can reset their bounces X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b2eeccf7f86345da3553c32ace46d29898228b7;p=ipfire.org.git accounts: Add a probe handler to people can reset their bounces Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 7d2d5eaa..88a42447 100644 --- a/Makefile.am +++ b/Makefile.am @@ -370,6 +370,7 @@ templates_users_DATA = \ src/templates/users/edit.html \ src/templates/users/index.html \ src/templates/users/passwd.html \ + src/templates/users/probe.html \ src/templates/users/recently-joined.html \ src/templates/users/show.html \ src/templates/users/subscribe.html \ diff --git a/src/backend/accounts.py b/src/backend/accounts.py index ebe6fb4f..cc48f686 100644 --- a/src/backend/accounts.py +++ b/src/backend/accounts.py @@ -1790,6 +1790,31 @@ class Account(LDAPObject): return res.sent_at if res else None + def probe_received(self): + """ + Called when the user has clicked the link on the probe message + """ + log.info("Probe response received from %s" % self) + + # Delete all bounces + self.db.execute(""" + DELETE FROM + account_bounces + WHERE + uid = %s + """, self.uid, + ) + + # Delete the last probe + self.db.execute(""" + DELETE FROM + account_probes + WHERE + uid = %s + """, self.uid, + ) + + class Groups(Object): hidden_groups = ( "cn=LDAP Read Only,ou=Group,dc=ipfire,dc=org", diff --git a/src/templates/accounts/messages/probe.txt b/src/templates/accounts/messages/probe.txt index fe2e580a..34ab5dbc 100644 --- a/src/templates/accounts/messages/probe.txt +++ b/src/templates/accounts/messages/probe.txt @@ -12,11 +12,11 @@ to make sure you're still getting our updates if you want them! Click here to confirm you still want to hear from us: - [VERIFY_LINK] + https://www.ipfire.org/probe Or update your email address in your settings: - [SETTINGS_LINK] + https://www.ipfire.org/users/{{ account.uid }}/edit No worries if you'd rather not receive emails - just ignore this message and we'll stop trying and close your account. diff --git a/src/templates/users/probe.html b/src/templates/users/probe.html new file mode 100644 index 00000000..2f300e1b --- /dev/null +++ b/src/templates/users/probe.html @@ -0,0 +1,19 @@ +{% extends "../base.html" %} + +{% block title %}{{ _("Thank You") }}{% end block %} + +{% block container %} +
+
+
+
+ +
+ +

+ {{ _("You have confirmed your email address and will continue to receive email from us.") }} +

+
+
+
+{% end block %} diff --git a/src/web/__init__.py b/src/web/__init__.py index 7db26e64..d41bb98a 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -247,6 +247,9 @@ class Application(tornado.web.Application): (r"/subscribe", users.SubscribeHandler), (r"/unsubscribe", users.UnsubscribeHandler), + # Probe responses + (r"/probe", users.ProbeHandler), + # VoIP (r"/voip", voip.IndexHandler), diff --git a/src/web/users.py b/src/web/users.py index 79d51db2..0b347e61 100644 --- a/src/web/users.py +++ b/src/web/users.py @@ -387,6 +387,15 @@ class UnsubscribeHandler(base.BaseHandler): self.render("users/unsubscribed.html") +class ProbeHandler(base.BaseHandler): + @tornado.web.authenticated + def get(self): + with self.db.transaction(): + self.current_user.probe_received() + + self.render("users/probe.html") + + class ListModule(ui_modules.UIModule): def render(self, accounts, show_created_at=False): return self.render_string("users/modules/list.html", accounts=accounts,