diff --git a/app/dashboard/templates/dashboard/mailbox.html b/app/dashboard/templates/dashboard/mailbox.html
index 12727d32..b86affe8 100644
--- a/app/dashboard/templates/dashboard/mailbox.html
+++ b/app/dashboard/templates/dashboard/mailbox.html
@@ -43,11 +43,17 @@
🚫
{% endif %}
-
+ {% if mailbox.id == current_user.default_mailbox_id %}
+
Default Mailbox
+
+ {% endif %}
+
Created {{ mailbox.created_at | dt }}
{{ mailbox.nb_alias() }} aliases.
+
Edit âž¡
@@ -60,7 +66,8 @@
-
+
Delete
diff --git a/app/dashboard/views/mailbox.py b/app/dashboard/views/mailbox.py
index 5ce2ed5e..796c0001 100644
--- a/app/dashboard/views/mailbox.py
+++ b/app/dashboard/views/mailbox.py
@@ -44,6 +44,10 @@ def mailbox_route():
flash("Unknown error. Refresh the page", "warning")
return redirect(url_for("dashboard.mailbox_route"))
+ if mailbox.id == current_user.default_mailbox_id:
+ flash("You cannot delete default mailbox", "error")
+ return redirect(url_for("dashboard.mailbox_route"))
+
email = mailbox.email
Mailbox.delete(mailbox_id)
db.session.commit()