implement the imap metadata extension, rfc 5464

this allows setting per-mailbox and per-server annotations (metadata). we have
a fixed maximum for total number of annotations (1000) and their total size
(1000000 bytes). this size isn't held against the regular quota for simplicity.
we send unsolicited metadata responses when a connection is in the idle
command and a change to a metadata item is made.

we currently only implement the /private/ namespace.  we should implement the
/shared/ namespace, for mox-global metadata annotations.  only the admin should
be able to configure those, probably through the config file, cli, or admin web
interface.

for issue #290
This commit is contained in:
Mechiel Lukkien
2025-02-17 22:44:51 +01:00
parent 9dff879164
commit f30c44eddb
17 changed files with 820 additions and 41 deletions

View File

@ -1230,7 +1230,7 @@ func (Webmail) MailboxCreate(ctx context.Context, name string) {
})
}
// MailboxDelete deletes a mailbox and all its messages.
// MailboxDelete deletes a mailbox and all its messages and annotations.
func (Webmail) MailboxDelete(ctx context.Context, mailboxID int64) {
reqInfo := ctx.Value(requestInfoCtxKey).(requestInfo)
acc := reqInfo.Account

View File

@ -276,7 +276,7 @@
},
{
"Name": "MailboxDelete",
"Docs": "MailboxDelete deletes a mailbox and all its messages.",
"Docs": "MailboxDelete deletes a mailbox and all its messages and annotations.",
"Params": [
{
"Name": "mailboxID",

View File

@ -894,7 +894,7 @@ export class Client {
return await _sherpaCall(this.baseURL, this.authState, { ...this.options }, paramTypes, returnTypes, fn, params) as void
}
// MailboxDelete deletes a mailbox and all its messages.
// MailboxDelete deletes a mailbox and all its messages and annotations.
async MailboxDelete(mailboxID: number): Promise<void> {
const fn: string = "MailboxDelete"
const paramTypes: string[][] = [["int64"]]

View File

@ -573,7 +573,7 @@ var api;
const params = [name];
return await _sherpaCall(this.baseURL, this.authState, { ...this.options }, paramTypes, returnTypes, fn, params);
}
// MailboxDelete deletes a mailbox and all its messages.
// MailboxDelete deletes a mailbox and all its messages and annotations.
async MailboxDelete(mailboxID) {
const fn = "MailboxDelete";
const paramTypes = [["int64"]];

View File

@ -573,7 +573,7 @@ var api;
const params = [name];
return await _sherpaCall(this.baseURL, this.authState, { ...this.options }, paramTypes, returnTypes, fn, params);
}
// MailboxDelete deletes a mailbox and all its messages.
// MailboxDelete deletes a mailbox and all its messages and annotations.
async MailboxDelete(mailboxID) {
const fn = "MailboxDelete";
const paramTypes = [["int64"]];

View File

@ -573,7 +573,7 @@ var api;
const params = [name];
return await _sherpaCall(this.baseURL, this.authState, { ...this.options }, paramTypes, returnTypes, fn, params);
}
// MailboxDelete deletes a mailbox and all its messages.
// MailboxDelete deletes a mailbox and all its messages and annotations.
async MailboxDelete(mailboxID) {
const fn = "MailboxDelete";
const paramTypes = [["int64"]];