1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-22 02:17:26 +00:00

create the Trash folder on new user creation (fixes #359)

This commit is contained in:
Joshua Tauberer 2015-03-22 13:24:55 +00:00
parent 01f2451349
commit 6df72bf4ac

View File

@ -293,8 +293,10 @@ def add_mail_user(email, pw, privs, env):
# write databasebefore next step # write databasebefore next step
conn.commit() conn.commit()
# Create the user's INBOX, Spam, and Drafts folders, and subscribe them. # Create & subscribe the user's INBOX, Trash, Spam, and Drafts folders.
# K-9 mail will poll every 90 seconds if a Drafts folder does not exist, so create it # * 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. # to avoid unnecessary polling.
# Check if the mailboxes exist before creating them. When creating a user that had previously # Check if the mailboxes exist before creating them. When creating a user that had previously
@ -306,7 +308,7 @@ def add_mail_user(email, pw, privs, env):
conn.commit() conn.commit()
return ("Failed to initialize the user: " + e.output.decode("utf8"), 400) 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: if folder not in existing_mboxes:
utils.shell('check_call', ["doveadm", "mailbox", "create", "-u", email, "-s", folder]) utils.shell('check_call', ["doveadm", "mailbox", "create", "-u", email, "-s", folder])