diff --git a/app/dashboard/views/notification.py b/app/dashboard/views/notification.py index 82270e4f..e22c8e2c 100644 --- a/app/dashboard/views/notification.py +++ b/app/dashboard/views/notification.py @@ -23,6 +23,10 @@ def notification_route(notification_id): ) return redirect(url_for("dashboard.index")) + if not notification.read: + notification.read = True + Session.commit() + if request.method == "POST": notification_title = notification.title or notification.message[:20] Notification.delete(notification_id) diff --git a/email_handler.py b/email_handler.py index e76de0ec..67ba6a12 100644 --- a/email_handler.py +++ b/email_handler.py @@ -1401,6 +1401,15 @@ def handle_bounce_forward_phase(msg: Message, email_log: EmailLog): f"Disable alias {alias} because {reason}. {alias.mailboxes} {alias.user}. Last contact {contact}" ) alias.enabled = False + + Notification.create( + user_id=user.id, + title=f"{alias.email} has been disabled due to multiple bounces", + message=Notification.render( + "notification/alias-disable.html", alias=alias, mailbox=mailbox + ), + ) + Session.commit() send_email_with_rate_control( diff --git a/templates/header.html b/templates/header.html index 3e602142..656317ba 100644 --- a/templates/header.html +++ b/templates/header.html @@ -38,15 +38,13 @@