const usage = await api.mail.usage();
// { pack, mailboxes, maxMailboxes, aliases, hosts, usedBytes, quotaBytes, extraMailboxCredits }
if (!usage.maxMailboxes) {
// This plan has no mail service. Show the limit, with a link to the plans.
}usage = api.mail.usage()
# {"pack", "mailboxes", "maxMailboxes", "aliases", "hosts", "usedBytes", "quotaBytes", "extraMailboxCredits"}
if not usage["maxMailboxes"]:
pass # This plan has no mail service. Show the limit, with a link to the plans.packstringWhich plan.
mailboxes · maxMailboxesintegerHow many exist, and how many the plan allows.
aliasesintegerHow many alias addresses exist.
hostsintegerHow many hosts have mail enabled.
usedBytes · quotaBytesintegerWhat mail holds, against the account's object storage.
extraMailboxCreditsintegerWhat an additional mailbox is priced at.
Read the zero
maxMailboxes: 0 is the signal that this plan has no mail — the same shape as maxHosts: 0 for hosting. A page that reads the number keeps working when the plans change; a page that matches on a plan's name lies that day.
The quota is not per mailbox
quotaBytes is the account's object storage, shared with files and with whatever hosts keep online. It is re-read each time — so a mailbox can become full because something else filled up.
What happens when it is full
Delivery is refused with a retry-later answer, so the sender's server tries again rather than giving up. The copy of a send is the exception: refusing it would lose the trace of a message already gone without freeing anything.
Showing it
const u = await api.mail.usage();
if (!u.maxMailboxes) return showPlanLimit();
if (u.mailboxes >= u.maxMailboxes) return showAtLimit(u.extraMailboxCredits);
return showCreateButton();def mail_screen():
u = api.mail.usage()
if not u["maxMailboxes"]:
return show_plan_limit()
if u["mailboxes"] >= u["maxMailboxes"]:
return show_at_limit(u["extraMailboxCredits"])
return show_create_button()