-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
830c83d
commit 1795f8a
Showing
11 changed files
with
436 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
## NOTE: This file is automatically generated by Mail-in-a-Box. | ||
## Do not edit this file. It is continually updated by | ||
## Mail-in-a-Box and your changes will be lost. | ||
## | ||
## Mail-in-a-Box machines are not meant to be modified. | ||
## If you modify any system configuration you are on | ||
## your own --- please do not ask for help from us. | ||
|
||
namespace inbox { | ||
# Automatically create & subscribe some folders. | ||
# * Create and subscribe the INBOX folder. | ||
# * Our sieve rule for spam expects that the Spam folder exists. | ||
# * Z-Push must be configured with the same settings in conf/zpush/backend_imap.php (#580). | ||
|
||
# MUA notes: | ||
# * 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. | ||
# * Apple's OS X Mail app will create 'Sent Messages' if it doesn't see a folder with the \Sent flag (#571, #573) and won't be able to archive messages unless 'Archive' exists (#581). | ||
# * Thunderbird's default in its UI is 'Archives' (plural) but it will configure new accounts to use whatever we say here (#581). | ||
|
||
# auto: | ||
# 'create' will automatically create this mailbox. | ||
# 'subscribe' will both create and subscribe to the mailbox. | ||
|
||
# special_use is a space separated list of IMAP SPECIAL-USE | ||
# attributes as specified by RFC 6154: | ||
# \All \Archive \Drafts \Flagged \Junk \Sent \Trash | ||
|
||
mailbox INBOX { | ||
auto = subscribe | ||
} | ||
mailbox Spam { | ||
special_use = \Junk | ||
auto = subscribe | ||
} | ||
mailbox Drafts { | ||
special_use = \Drafts | ||
auto = subscribe | ||
} | ||
mailbox Sent { | ||
special_use = \Sent | ||
auto = subscribe | ||
} | ||
mailbox Trash { | ||
special_use = \Trash | ||
auto = subscribe | ||
} | ||
mailbox Archive { | ||
special_use = \Archive | ||
auto = subscribe | ||
} | ||
|
||
# dovevot's standard mailboxes configuration file marks two sent folders | ||
# with the \Sent attribute, just in case clients don't agree about which | ||
# they're using. We'll keep that, plus add Junk as an alterative for Spam. | ||
# These are not auto-created. | ||
mailbox "Sent Messages" { | ||
special_use = \Sent | ||
} | ||
mailbox Junk { | ||
special_use = \Junk | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,11 +60,13 @@ def setup_key_auth(mgmt_uri): | |
|
||
if len(sys.argv) < 2: | ||
print("""Usage: | ||
{cli} system default-quota [new default] (set default quota for system) | ||
{cli} user (lists users) | ||
{cli} user add [email protected] [password] | ||
{cli} user password [email protected] [password] | ||
{cli} user remove [email protected] | ||
{cli} user make-admin [email protected] | ||
{cli} user quota user@domain [new-quota] | ||
{cli} user remove-admin [email protected] | ||
{cli} user admins (lists admins) | ||
{cli} user mfa show [email protected] (shows MFA devices for user, if any) | ||
|
@@ -88,6 +90,10 @@ def setup_key_auth(mgmt_uri): | |
print(user['email'], end='') | ||
if "admin" in user['privileges']: | ||
print("*", end='') | ||
if user['quota'] == '0': | ||
print(" unlimited", end='') | ||
else: | ||
print(" " + user['quota'], end='') | ||
print() | ||
|
||
elif sys.argv[1] == "user" and sys.argv[2] in {"add", "password"}: | ||
|
@@ -117,6 +123,14 @@ def setup_key_auth(mgmt_uri): | |
if "admin" in user['privileges']: | ||
print(user['email']) | ||
|
||
elif sys.argv[1] == "user" and sys.argv[2] == "quota" and len(sys.argv) == 4: | ||
# Set a user's quota | ||
print(mgmt("/mail/users/quota?text=1&email=%s" % sys.argv[3])) | ||
|
||
elif sys.argv[1] == "user" and sys.argv[2] == "quota" and len(sys.argv) == 5: | ||
# Set a user's quota | ||
users = mgmt("/mail/users/quota", { "email": sys.argv[3], "quota": sys.argv[4] }) | ||
|
||
elif sys.argv[1] == "user" and len(sys.argv) == 5 and sys.argv[2:4] == ["mfa", "show"]: | ||
# Show MFA status for a user. | ||
status = mgmt("/mfa/status", { "user": sys.argv[4] }, is_json=True) | ||
|
@@ -138,6 +152,12 @@ def setup_key_auth(mgmt_uri): | |
elif sys.argv[1] == "alias" and sys.argv[2] == "remove" and len(sys.argv) == 4: | ||
print(mgmt("/mail/aliases/remove", { "address": sys.argv[3] })) | ||
|
||
elif sys.argv[1] == "system" and sys.argv[2] == "default-quota" and len(sys.argv) == 3: | ||
print(mgmt("/system/default-quota?text=1")) | ||
|
||
elif sys.argv[1] == "system" and sys.argv[2] == "default-quota" and len(sys.argv) == 4: | ||
print(mgmt("/system/default-quota", { "default_quota": sys.argv[3]})) | ||
|
||
else: | ||
print("Invalid command-line arguments.") | ||
sys.exit(1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.