1
0
spogulis no https://github.com/mail-in-a-box/mailinabox.git synced 2025-12-27 05:08:50 +01:00

create the Drafts folder for users so K-9 mail doesn't poll unnecessarily, see #129

Šī revīzija ir iekļauta:
Joshua Tauberer 2014-08-09 16:49:57 +00:00
vecāks b56f82cb92
revīzija e294f7c181

Parādīt failu

@ -89,7 +89,9 @@ def add_mail_user(email, pw, env):
# write databasebefore next step
conn.commit()
# Create the user's INBOX and Spam folders and subscribe them.
# 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.
# 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.
@ -100,8 +102,9 @@ def add_mail_user(email, pw, env):
conn.commit()
return ("Failed to initialize the user: " + e.output.decode("utf8"), 400)
if "INBOX" not in existing_mboxes: utils.shell('check_call', ["doveadm", "mailbox", "create", "-u", email, "-s", "INBOX"])
if "Spam" not in existing_mboxes: utils.shell('check_call', ["doveadm", "mailbox", "create", "-u", email, "-s", "Spam"])
for folder in ("INBOX", "Spam", "Drafts"):
if folder not in existing_mboxes:
utils.shell('check_call', ["doveadm", "mailbox", "create", "-u", email, "-s", folder])
# Update things in case any new domains are added.
return kick(env, "mail user added")