From 6df72bf4ac9683557d3f56594d3045d966127e07 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sun, 22 Mar 2015 13:24:55 +0000 Subject: [PATCH] create the Trash folder on new user creation (fixes #359) --- management/mailconfig.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/management/mailconfig.py b/management/mailconfig.py index 5ac7d10b..47507b97 100755 --- a/management/mailconfig.py +++ b/management/mailconfig.py @@ -293,9 +293,11 @@ def add_mail_user(email, pw, privs, env): # write databasebefore next step conn.commit() - # Create the user's INBOX, Spam, and Drafts folders, and subscribe them. - # K-9 mail will poll every 90 seconds if a Drafts folder does not exist, so create it - # to avoid unnecessary polling. + # Create & subscribe the user's INBOX, Trash, Spam, and Drafts folders. + # * Our sieve rule for spam expects that the Spam folder exists. + # * Roundcube will show an error if the user tries to delete a message before the Trash folder exists (#359). + # * K-9 mail will poll every 90 seconds if a Drafts folder does not exist, so create it + # to avoid unnecessary polling. # Check if the mailboxes exist before creating them. When creating a user that had previously # been deleted, the mailboxes will still exist because they are still on disk. @@ -306,7 +308,7 @@ def add_mail_user(email, pw, privs, env): conn.commit() return ("Failed to initialize the user: " + e.output.decode("utf8"), 400) - for folder in ("INBOX", "Spam", "Drafts"): + for folder in ("INBOX", "Trash", "Spam", "Drafts"): if folder not in existing_mboxes: utils.shell('check_call', ["doveadm", "mailbox", "create", "-u", email, "-s", folder])