diff --git a/api.js b/api.js index 694d0910..0213a421 100644 --- a/api.js +++ b/api.js @@ -355,7 +355,7 @@ server.use(async (req, res) => { req.role = tokenData.role; req.user = tokenData.user; - // make a reference to original method, otherwise might be overrided + // make a reference to original method, otherwise might be overridden let setAuthToken = userHandler.setAuthToken.bind(userHandler); req.accessToken = { diff --git a/config/imap.toml b/config/imap.toml index f7fde20a..dd113e38 100644 --- a/config/imap.toml +++ b/config/imap.toml @@ -13,11 +13,11 @@ maxMB = 25 # delete messages from \Trash and \Junk after retention days retention = 30 -# Default max donwload bandwith per day in megabytes +# Default max download bandwidth per day in megabytes # Replaced by 'const:max:imap:download' setting maxDownloadMB = 10240 -# Default max upload bandwith per day in megabytes +# Default max upload bandwidth per day in megabytes # Replaced by 'const:max:imap:upload' setting maxUploadMB = 10240 @@ -35,8 +35,8 @@ enableCompression = false # If true, then expect HAProxy PROXY header as the first line of data useProxy = false -# useProxy=true # expect PROXY from all conections -# useProxy=['*'] # expect PROXY from all conections +# useProxy=true # expect PROXY from all connections +# useProxy=['*'] # expect PROXY from all connections # useProxy=['1.2.3.4', '1.2.3.5'] # expect PROXY only from connections from listed IP addresses # an array of IP addresses to ignore (not logged) @@ -54,7 +54,7 @@ ignoredHosts = [] #secure=false #ignoreSTARTTLS=true -# Apple push notificiations +# Apple push notifications # TODO: missing actual implementation for Apple Push Service [aps] enabled = false diff --git a/config/pop3.toml b/config/pop3.toml index 1e66a8db..51a08a69 100644 --- a/config/pop3.toml +++ b/config/pop3.toml @@ -1,28 +1,28 @@ # If enabled then WildDuck exposes a limited POP3 interface for listing and fetching emails -enabled=true -port=9995 +enabled = true +port = 9995 # by default bind to localhost only -host="0.0.0.0" +host = "0.0.0.0" # Use `true` for port 995 and `false` for 110 -secure=true +secure = true # If true, then do not show server info in CAPA response -disableVersionString=false +disableVersionString = false # How many latest messages to list for LIST and UIDL # POP3 server never lists all messages but only a limited length list -maxMessages=250 +maxMessages = 250 -# Max donwload bandwith per day in megabytes +# Max download bandwidth per day in megabytes # Replaced by 'const:max:pop3:download' setting -maxDownloadMB=10240 +maxDownloadMB = 10240 # If true, then expect HAProxy PROXY header as the first line of data -useProxy=false +useProxy = false # an array of IP addresses to ignore (not logged) -ignoredHosts=[] +ignoredHosts = [] #name="WildDuck POP3" #version="1.0.0" @@ -34,7 +34,7 @@ ignoredHosts=[] [setup] # Public configuration for POP3 -hostname="localhost" -secure=true +hostname = "localhost" +secure = true # port defaults to pop3.port #port=9995 diff --git a/config/tls.toml b/config/tls.toml index baf9bc3c..6734924e 100644 --- a/config/tls.toml +++ b/config/tls.toml @@ -1,5 +1,5 @@ -# Default TLS keys (can be overriden by individual services) +# Default TLS keys (can be overridden by individual services) #key="/path/to/server/key.pem" #ca=["/path/to/server/ca1.pem", "/path/to/server/ca2.pem"] #cert="/path/to/server/cert.pem" -#dhparam="/path/to/server/dhparam.pem" \ No newline at end of file +#dhparam="/path/to/server/dhparam.pem" diff --git a/docs/api-error-codes.md b/docs/api-error-codes.md index d9e1a1ea..8cca62cd 100644 --- a/docs/api-error-codes.md +++ b/docs/api-error-codes.md @@ -26,7 +26,7 @@ - `FileNotFound`: This file does not exist - `InsecurePasswordError`: Provided password was found from breached passwords list - `ERRCOMPOSE`: Could not queue message for delivery -- `KeyGenereateError`: Failed to generate private or public key +- `KeyGenerateError`: Failed to generate private or public key - `InternalConfigError`: Invalid encryption settings - `HashError` - `UserUpdateFail`: Could not update user diff --git a/docs/api/openapidocs.json b/docs/api/openapidocs.json index 38950ac4..08c8f4ed 100644 --- a/docs/api/openapidocs.json +++ b/docs/api/openapidocs.json @@ -1 +1 @@ -{"openapi":"3.0.0","info":{"title":"WildDuck API","description":"WildDuck API docs","contact":{"url":"https://github.com/nodemailer/wildduck"},"version":"1.45.0"},"servers":[{"url":"https://api.wildduck.email"}],"tags":[{"name":"Addresses"},{"name":"ApplicationPasswords"},{"name":"Archive","description":"Archive includes all deleted messages. Once messages are old enough then these are permanenetly deleted from the archive as well. Until then you can restore the deleted messages."},{"name":"Audit","description":"Auditing allows to monitor an email account. All existing, deleted and new emails are copied to the auditing system. See also https://github.com/nodemailer/wildduck-audit-manager"},{"name":"Authentication"},{"name":"Autoreplies"},{"name":"Certs","description":"WildDuck allows to register TLS certificates to be used with SNI connections. These certificates are used by IMAP, POP3, API and SMTP servers when a SNI capable client establishes a TLS connection. This does not apply for MX servers."},{"name":"DKIM","description":"Whenever an email is sent WildDuck checks if there is a DKIM key registered for the domain name of the sender address and uses it to sign the message."},{"name":"DomainAccess","description":"Add sender domain names to allowlist (messages are all accepted) or blocklist (messages are sent to Spam folder)"},{"name":"DomainAliases"},{"name":"Filters"},{"name":"Mailboxes"},{"name":"Messages"},{"name":"Settings"},{"name":"Storage","description":"Storage allows easier attachment handling when composing Draft messages. Instead of uploading the attachmnent with every draft update, you store the attachment to the Storage and then link stored file for the Draft."},{"name":"Submission"},{"name":"TwoFactorAuth"},{"name":"Users"},{"name":"Webhooks"}],"paths":{"/users":{"get":{"tags":["Users"],"summary":"List registered Users","operationId":"users","parameters":[{"name":"query","in":"query","description":"Partial match of username or default email address","required":false,"schema":{"type":"string"}},{"name":"forward","in":"query","description":"Partial match of a forward email address or URL","required":false,"schema":{"type":"string"}},{"name":"tags","in":"query","description":"Comma separated list of tags. The User must have at least one to be set","required":false,"schema":{"type":"string"}},{"name":"requiredTags","in":"query","description":"Comma separated list of tags. The User must have all listed tags to be set","required":false,"schema":{"type":"string"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"internalData","in":"query","description":"If true, then includes internalData in the response. Not shown for user-role tokens.","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"query":{"type":"string","description":"Partial match of username or default email address","required":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetUsersResult"},"description":"User listing"}},"required":["success","total","page","previousCursor","nextCursor","query","results"]}}}}}},"post":{"tags":["Users"],"summary":"Create new user","operationId":"postusers","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"Username of the User. Dots are allowed but informational only (\"user.name\" is the same as \"username\").","required":true},"password":{"type":"string","description":"Password for the account. Set to boolean false to disable password usage for the master scope, Application Specific Passwords would still be allowed","required":true,"enum":[false,""]},"hashedPassword":{"type":"boolean","description":"If true then password is already hashed, so store as is. Supported hashes: pbkdf2, bcrypt ($2a, $2y, $2b), md5 ($1), sha512 ($6), sha256 ($5), argon2 ($argon2d, $argon2i, $argon2id). Stored hashes are rehashed to pbkdf2 on first successful password check.","required":false},"allowUnsafe":{"type":"boolean","description":"If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.","required":false},"address":{"type":"string","description":"Default email address for the User (autogenerated if not set)","required":false},"emptyAddress":{"type":"boolean","description":"If true then do not autogenerate missing email address for the User. Only needed if you want to create a user account that does not have any email address associated","required":false},"language":{"type":"string","description":"Language code for the User","required":false},"retention":{"type":"number","description":"Default retention time (in ms). Set to 0 to disable","required":false},"name":{"type":"string","description":"Name of the User","required":false},"targets":{"type":"array","items":{"type":"string","required":false},"description":"An array of forwarding targets. The value could either be an email address or a relay url to next MX server (\"smtp://mx2.zone.eu:25\") or an URL where mail contents are POSTed to"},"spamLevel":{"type":"number","description":"Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam","required":false},"quota":{"type":"number","description":"Allowed quota of the user in bytes","required":false},"recipients":{"type":"number","description":"How many messages per 24 hour can be sent","required":false},"forwards":{"type":"number","description":"How many messages per 24 hour can be forwarded","required":false},"filters":{"type":"number","description":"How many filters are allowed for this account","required":false},"requirePasswordChange":{"type":"boolean","description":"If true then requires the user to change password, useful if password for the account was autogenerated","required":false},"imapMaxUpload":{"type":"number","description":"How many bytes can be uploaded via IMAP during 24 hour","required":false},"imapMaxDownload":{"type":"number","description":"How many bytes can be downloaded via IMAP during 24 hour","required":false},"pop3MaxDownload":{"type":"number","description":"How many bytes can be downloaded via POP3 during 24 hour","required":false},"pop3MaxMessages":{"type":"number","description":"How many latest messages to list in POP3 session","required":false},"imapMaxConnections":{"type":"number","description":"How many parallel IMAP connections are alowed","required":false},"receivedMax":{"type":"number","description":"How many messages can be received from MX during 60 seconds","required":false},"fromWhitelist":{"type":"array","items":{"type":"string","required":false},"description":"A list of additional email addresses this user can send mail from. Wildcard is allowed."},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this user"},"addTagsToAddress":{"type":"boolean","description":"If true then autogenerated address gets the same tags as the user","required":false},"uploadSentMessages":{"type":"boolean","description":"If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.","required":false},"mailboxes":{"$ref":"#/components/schemas/Mailboxes"},"disabledScopes":{"type":"array","items":{"type":"string","required":false,"enum":["imap","pop3","smtp"]},"description":"List of scopes that are disabled for this user (\"imap\", \"pop3\", \"smtp\")"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional metadata for internal use, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"pubKey":{"type":"string","description":"Public PGP key for the User that is used for encryption. Use empty string to remove the key","required":false},"encryptMessages":{"type":"boolean","description":"If true then received messages are encrypted","required":false},"encryptForwarded":{"type":"boolean","description":"If true then forwarded messages are encrypted","required":false},"featureFlags":{"type":"object","description":"Feature flags to specify","properties":{"indexing":{"type":"boolean","required":false}},"required":[]},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["username","password"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true}},"required":["success","id"]}}}}}}},"/users/resolve/:username":{"get":{"tags":["Users"],"summary":"Resolve ID for a username","operationId":"getusersresolveusername","parameters":[{"name":"username","in":"path","description":"Username of the User. Alphanumeric value. Must start with a letter, dots are allowed but informational only (\"user.name\" is the same as \"username\")","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Unique ID (24 byte hex)","required":true,"example":"609d201236d1d936948f23b1"}},"required":["success","id"]}}}}}}},"/users/:user":{"get":{"tags":["Users"],"summary":"Request User information","operationId":"getusersuser","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Users unique ID (24 byte hex)","required":true},"username":{"type":"string","description":"Username of the User","required":true},"name":{"type":"string","description":"Name of the User","required":true},"address":{"type":"string","description":"Main email address of the User","required":true},"retention":{"type":"number","description":"Default retention time (in ms). false if not enabled","required":true},"enabled2fa":{"type":"array","items":{"type":"string","required":false},"description":"List of enabled 2FA methods"},"autoreply":{"type":"boolean","description":"Is autoreply enabled or not (start time may still be in the future or end time in the past)","required":true},"encryptMessages":{"type":"boolean","description":"If true then received messages are encrypted","required":true},"encryptForwarded":{"type":"boolean","description":"If true then forwarded messages are encrypted","required":true},"pubKey":{"type":"string","description":"Public PGP key for the User that is used for encryption","required":true},"keyInfo":{"$ref":"#/components/schemas/KeyInfo"},"metaData":{"type":"object","description":"Custom metadata object set for this user","required":true,"format":"any"},"internalData":{"type":"object","description":"Custom internal metadata object set for this user. Not available for user-role tokens","properties":{},"required":[]},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets"},"spamLevel":{"type":"number","description":"Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam","required":true},"limits":{"$ref":"#/components/schemas/UserLimits"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the User"},"fromWhitelist":{"type":"array","items":{"type":"string","required":false},"description":"A list of additional email addresses this user can send mail from. Wildcard is allowed."},"disabledScopes":{"type":"array","items":{"type":"string","required":false,"enum":["imap","pop3","smtp"]},"description":"Disabled scopes for this user"},"hasPasswordSet":{"type":"boolean","description":"If true then the User has a password set and can authenticate","required":true},"activated":{"type":"boolean","description":"Is the account activated","required":true},"disabled":{"type":"boolean","description":"If true then the user can not authenticate or receive any new mail","required":true},"suspended":{"type":"boolean","description":"If true then the user can not authenticate","required":true}},"required":["success","id","username","name","address","retention","enabled2fa","autoreply","encryptMessages","encryptForwarded","pubKey","keyInfo","metaData","internalData","targets","spamLevel","limits","tags","disabledScopes","hasPasswordSet","activated","disabled","suspended"]}}}}}},"put":{"tags":["Users"],"summary":"Update User information","operationId":"putusersuser","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"existingPassword":{"type":"string","description":"If provided then validates against account password before applying any changes","required":false},"password":{"type":"string","description":"New password for the account. Set to boolean false to disable password usage for the master scope, Application Specific Passwords would still be allowed","required":false,"enum":[false,""]},"hashedPassword":{"type":"boolean","description":"If true then password is already hashed, so store as is. Supported hashes: pbkdf2, bcrypt ($2a, $2y, $2b), md5 ($1), sha512 ($6), sha256 ($5), argon2 ($argon2d, $argon2i, $argon2id). Stored hashes are rehashed to pbkdf2 on first successful password check.","required":false},"allowUnsafe":{"type":"boolean","description":"If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.","required":false},"language":{"type":"string","description":"Language code for the User","required":false},"name":{"type":"string","description":"Name of the User","required":false},"targets":{"type":"array","items":{"type":"string","required":false},"description":"An array of forwarding targets. The value could either be an email address or a relay url to next MX server (\"smtp://mx2.zone.eu:25\") or an URL where mail contents are POSTed to"},"spamLevel":{"type":"number","description":"Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam","required":false},"uploadSentMessages":{"type":"boolean","description":"If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.","required":false},"fromWhitelist":{"type":"array","items":{"type":"string","required":false},"description":"A list of additional email addresses this user can send mail from. Wildcard is allowed."},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional internal metadata, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"pubKey":{"type":"string","description":"Public PGP key for the User that is used for encryption. Use empty string to remove the key","required":false},"encryptMessages":{"type":"boolean","description":"If true then received messages are encrypted","required":false},"encryptForwarded":{"type":"boolean","description":"If true then forwarded messages are encrypted","required":false},"retention":{"type":"number","description":"Default retention time (in ms). Set to 0 to disable","required":false},"quota":{"type":"number","description":"Allowed quota of the user in bytes","required":false},"recipients":{"type":"number","description":"How many messages per 24 hour can be sent","required":false},"forwards":{"type":"number","description":"How many messages per 24 hour can be forwarded","required":false},"filters":{"type":"number","description":"How many filters are allowed for this account","required":false},"imapMaxUpload":{"type":"number","description":"How many bytes can be uploaded via IMAP during 24 hour","required":false},"imapMaxDownload":{"type":"number","description":"How many bytes can be downloaded via IMAP during 24 hour","required":false},"pop3MaxDownload":{"type":"number","description":"How many bytes can be downloaded via POP3 during 24 hour","required":false},"pop3MaxMessages":{"type":"number","description":"How many latest messages to list in POP3 session","required":false},"imapMaxConnections":{"type":"number","description":"How many parallel IMAP connections are alowed","required":false},"receivedMax":{"type":"number","description":"How many messages can be received from MX during 60 seconds","required":false},"disable2fa":{"type":"boolean","description":"If true, then disables 2FA for this user","required":false},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this user"},"disabledScopes":{"type":"array","items":{"type":"string","required":false,"enum":["imap","pop3","smtp"]},"description":"List of scopes that are disabled for this user (\"imap\", \"pop3\", \"smtp\")"},"disabled":{"type":"boolean","description":"If true then disables user account (can not login, can not receive messages)","required":false},"featureFlags":{"type":"object","description":"Enabled feature flags","properties":{"indexing":{"type":"boolean","required":false}},"required":[]},"suspended":{"type":"boolean","description":"If true then disables authentication","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"delete":{"tags":["Users"],"summary":"Delete a User","description":"This method deletes user and address entries from DB and schedules a background task to delete messages. You can call this method several times even if the user has already been deleted, in case there are still some pending messages.","operationId":"deleteusersuser","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"deleteAfter","in":"query","description":"Delete user entry from registry but keep all user data until provided date. User account is fully recoverable up to that date.","required":false,"schema":{"type":"date","enum":[false]}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"code":{"type":"string","description":"Task code. Should be TaskScheduled","required":false,"example":"TaskScheduled"},"user":{"type":"string","description":"User ID","required":false},"addresses":{"type":"object","properties":{"deleted":{"type":"number","description":"Number of deleted addresses","required":false}},"required":[]},"deleteAfter":{"type":"string","description":"Delete after date","required":false,"format":"date-time"},"task":{"type":"string","description":"Task ID","required":false}},"required":["success"]}}}}}}},"/users/:user/logout":{"put":{"tags":["Users"],"summary":"Log out User","operationId":"putusersuserlogout","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","description":"Message to be shown to connected IMAP client","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/quota/reset":{"post":{"tags":["Users"],"summary":"Recalculate User quota","description":"This method recalculates quota usage for a User. Normally not needed, only use it if quota numbers are way off. This method is not transactional, so if the user is currently receiving new messages then the resulting value is not exact.","operationId":"postusersuserquotareset","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"storageUsed":{"type":"number","description":"Calculated quota usage for the user","required":true},"previousStorageUsed":{"type":"number","description":"Previous storage used","required":true}},"required":["success","storageUsed","previousStorageUsed"]}}}}}}},"/quota/reset":{"post":{"tags":["Users"],"summary":"Recalculate Quota for all Users","description":"This method recalculates quota usage for all Users. Normally not needed, only use it if quota numbers are way off. This method is not transactional, so if the user is currently receiving new messages then the resulting value is not exact.","operationId":"postquotareset","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"task":{"type":"string","description":"Task ID","required":true}},"required":["success","task"]}}}}}}},"/data/export":{"post":{"tags":["Export"],"summary":"Export data","description":"Export data for matching users. Export dump does not include emails, only account structure (user data, password hashes, mailboxes, filters, etc.). A special \"export\"-role access token is required for exporting and importing.","operationId":"postdataexport","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"string","required":true},"description":"An array of User ID values to export"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"An array of user tags to export. If set then at least one tag must exist on an user."},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/octet-stream":{"schema":{"type":"string","required":false,"format":"binary"}}}}}}},"/data/import":{"post":{"tags":["Export"],"summary":"Import user data","description":"Import data from an export dump. If a database entry already exists, it is not modified. A special \"export\"-role access token is required for exporting and importing.","operationId":"postdataimport","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"number","description":"How many database entries were found from the export file","required":false},"imported":{"type":"number","description":"How many database entries were imported from the export file","required":false},"failed":{"type":"number","description":"How many database entries were not imported due to some error","required":false},"existing":{"type":"number","description":"How many database existing entries were not imported","required":false}},"required":[]}}}}}}},"/users/:user/password/reset":{"post":{"tags":["Users"],"summary":"Reset password for a User","description":"This method generates a new temporary password for a User. Additionally it removes all two-factor authentication settings","operationId":"postusersuserpasswordreset","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"validAfter":{"type":"string","description":"Allow using the generated password not earlier than provided time","required":false,"format":"date-time","enum":[false]},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"password":{"type":"string","description":"Temporary password","required":true},"validAfter":{"type":"string","description":"The date password is valid after","required":false,"format":"date-time"}},"required":["success","password"]}}}}}}},"/users/:user/restore":{"get":{"tags":["Users"],"summary":"Return recovery info for a deleted user","operationId":"getusersuserrestore","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"user":{"type":"string","description":"ID of the deleted User","required":true},"username":{"type":"string","description":"Username of the User","required":true},"storageUsed":{"type":"number","description":"Calculated quota usage for the user","required":true},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the User"},"deleted":{"type":"string","description":"Datestring of the time the user was deleted","required":true,"format":"date-time"},"recoverableAddresses":{"type":"array","items":{"type":"string","required":false},"description":"List of email addresses that can be restored"}},"required":["success","user","username","storageUsed","tags","deleted","recoverableAddresses"]}}}}}},"post":{"tags":["Users"],"summary":"Cancel user deletion task","description":"Use this endpoint to cancel a timed deletion task scheduled by DELETE /user/{id}. If user data is not yet deleted then the account is fully recovered, except any email addresses that might have been already recycled","operationId":"postusersuserrestore","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"code":{"type":"string","description":"Task status code","required":true},"user":{"type":"string","description":"User ID","required":false},"task":{"type":"string","description":"Existing task id","required":false},"addresses":{"type":"object","properties":{"recovered":{"type":"number","description":"Number of recovered addresses","required":false},"main":{"type":"string","description":"Main address","required":false}},"required":[]}},"required":["success","code"]}}}}}}},"/addresses":{"get":{"tags":["Addresses"],"summary":"List registered Addresses","operationId":"addresses","parameters":[{"name":"query","in":"query","description":"Partial match of an address","required":false,"schema":{"type":"string"}},{"name":"forward","in":"query","description":"Partial match of a forward email address or URL","required":false,"schema":{"type":"string"}},{"name":"tags","in":"query","description":"Comma separated list of tags. The Address must have at least one to be set","required":false,"schema":{"type":"string"}},{"name":"requiredTags","in":"query","description":"Comma separated list of tags. The Address must have all listed tags to be set","required":false,"schema":{"type":"string"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"internalData","in":"query","description":"If true, then includes internalData in the response. Not shown for user-role tokens.","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"query":{"type":"string","description":"Partial match of an address","required":true},"total":{"type":"number","description":"How many results were found","required":true},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetAddressesResult"},"description":"Address listing"}},"required":["success","query","total","page","previousCursor","nextCursor","results"]}}}}}}},"/users/:user/addresses":{"post":{"tags":["Addresses"],"summary":"Create new Address","description":"Add a new email address for a User. Addresses can contain unicode characters. Dots in usernames are normalized so no need to create both \"firstlast@example.com\" and \"first.last@example.com\" Special addresses `*@example.com`, `*suffix@example.com` and `username@*` catches all emails to these domains or users without a registered destination (requires allowWildcard argument)","operationId":"postusersuseraddresses","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"oneOf":[{"type":"string","description":"E-mail Address","required":true},{"type":"string","required":false}],"description":"E-mail Address"},"name":{"type":"string","description":"Identity name","required":false},"main":{"type":"boolean","description":"Indicates if this is the default address for the User","required":false},"allowWildcard":{"type":"boolean","description":"If true then address value can be in the form of `*@example.com`, `*suffix@example.com` and `username@*`, otherwise using * is not allowed. Static suffix can be up to 32 characters long.","required":false},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this address"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional metadata for internal use, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the address","required":true}},"required":["success","id"]}}}}}},"get":{"tags":["Addresses"],"summary":"List registered Addresses for a User","operationId":"getusersuseraddresses","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"internalData","in":"query","description":"If true, then includes internalData in the response. Not shown for user-role tokens.","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetUserAddressesResult"},"description":"Address listing"}},"required":["success","results"]}}}}}}},"/users/:user/addresses/:address":{"get":{"tags":["Addresses"],"summary":"Request Addresses information","operationId":"getusersuseraddressesaddress","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"address","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Address","required":true},"name":{"type":"string","description":"Identity name","required":true},"address":{"type":"string","description":"E-mail Address","required":true},"main":{"type":"boolean","description":"Indicates if this is the default address for the User","required":true},"created":{"type":"string","description":"Datestring of the time the address was created","required":true,"format":"date-time"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the Address"},"metaData":{"type":"object","description":"Metadata object (if available)","properties":{},"required":[]},"internalData":{"type":"object","description":"Internal metadata object (if available), not included for user-role requests","properties":{},"required":[]}},"required":["success","id","name","address","main","created","tags"]}}}}}},"delete":{"tags":["Addresses"],"summary":"Delete an Address","operationId":"deleteusersuseraddressesaddress","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"address","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/addresses/:id":{"put":{"tags":["Addresses"],"summary":"Update Address information","operationId":"putusersuseraddressesid","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Identity name","required":false},"address":{"type":"string","description":"New address if you want to rename existing address. Only affects normal addresses, special addresses that include * can not be changed","required":false},"main":{"type":"boolean","description":"Indicates if this is the default address for the User","required":false},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this address"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional metadata for internal use, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/addressregister":{"get":{"tags":["Addresses"],"summary":"List addresses from communication register","operationId":"getusersuseraddressregister","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"query","in":"query","description":"Prefix of an address or a name","required":true,"schema":{"type":"string","example":"`query=john`"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number","example":"`limit=25`"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetUserAddressesregisterResult"},"description":"Address listing"}},"required":["success","results"]}}}}}}},"/addresses/forwarded":{"post":{"tags":["Addresses"],"summary":"Create new forwarded Address","description":"Add a new forwarded email address. Addresses can contain unicode characters. Dots in usernames are normalized so no need to create both \"firstlast@example.com\" and \"first.last@example.com\" Special addresses `*@example.com` and `username@*` catches all emails to these domains or users without a registered destination (requires allowWildcard argument)","operationId":"postaddressesforwarded","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"oneOf":[{"type":"string","description":"E-mail Address","required":true},{"type":"string","required":false}],"description":"E-mail Address"},"name":{"type":"string","description":"Identity name","required":false},"targets":{"type":"array","items":{"type":"string","required":false},"description":"An array of forwarding targets. The value could either be an email address or a relay url to next MX server (\"smtp://mx2.zone.eu:25\") or an URL where mail contents are POSTed to"},"forwards":{"type":"number","description":"Daily allowed forwarding count for this address","required":false},"allowWildcard":{"type":"boolean","description":"If true then address value can be in the form of `*@example.com`, otherwise using * is not allowed","required":false},"autoreply":{"$ref":"#/components/schemas/Autoreply"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this address"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional metadata for internal use, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["address"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Address","required":true}},"required":["success","id"]}}}}}}},"/addresses/forwarded/:id":{"put":{"tags":["Addresses"],"summary":"Update forwarded Address information","operationId":"putaddressesforwardedid","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","description":"New address. Only affects normal addresses, special addresses that include * can not be changed","required":false},"name":{"type":"string","description":"Identity name","required":false},"targets":{"type":"array","items":{"type":"string","required":false},"description":"An array of forwarding targets. The value could either be an email address or a relay url to next MX server (\"smtp://mx2.zone.eu:25\") or an URL where mail contents are POSTed to. If set then overwrites previous targets array"},"forwards":{"type":"number","description":"Daily allowed forwarding count for this address","required":false},"autoreply":{"$ref":"#/components/schemas/Autoreply"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this address"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional metadata for internal use, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"forwardedDisabled":{"type":"boolean","description":"If true then disables forwarded address (stops forwarding messages)","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"id","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/addresses/forwarded/:address":{"delete":{"tags":["Addresses"],"summary":"Delete a forwarded Address","operationId":"deleteaddressesforwardedaddress","parameters":[{"name":"address","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"get":{"tags":["Addresses"],"summary":"Request forwarded Addresses information","operationId":"getaddressesforwardedaddress","parameters":[{"name":"address","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Address","required":true},"address":{"type":"string","description":"E-mail Address","required":true},"name":{"type":"string","description":"Identity name","required":true},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets"},"limits":{"$ref":"#/components/schemas/AddressLimits"},"autoreply":{"$ref":"#/components/schemas/AutoreplyInfo"},"created":{"type":"string","description":"Datestring of the time the address was created","required":true,"format":"date-time"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the Address"},"metaData":{"type":"object","description":"Metadata object (if available)","properties":{},"required":[]},"internalData":{"type":"object","description":"Internal metadata object (if available), not included for user-role requests","properties":{},"required":[]},"forwardedDisabled":{"type":"boolean","description":"Specifies whether forwarding is disabled","required":false}},"required":["success","id","address","name","limits","autoreply","created","tags"]}}}}}}},"/addresses/resolve/:address":{"get":{"tags":["Addresses"],"summary":"Get Address info","operationId":"getaddressesresolveaddress","parameters":[{"name":"address","in":"path","description":"ID of the Address or e-mail address string","required":true,"schema":{"type":"alternatives"}},{"name":"allowWildcard","in":"query","description":"If true then resolves also wildcard addresses","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Address","required":true},"address":{"type":"string","description":"E-mail Address","required":true},"name":{"type":"string","description":"Identity name","required":true},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets if this is a Forwarded address"},"limits":{"$ref":"#/components/schemas/AddressLimits"},"autoreply":{"$ref":"#/components/schemas/AutoreplyInfo"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the Address"},"created":{"type":"string","description":"Datestring of the time the address was created","required":true,"format":"date-time"},"metaData":{"type":"object","description":"Metadata object (if available)","properties":{},"required":[]},"internalData":{"type":"object","description":"Internal metadata object (if available), not included for user-role requests","properties":{},"required":[]}},"required":["success","id","address","name","limits","autoreply","tags","created"]}}}}}}},"/addresses/renameDomain":{"put":{"tags":["Addresses"],"summary":"Rename domain in addresses","description":"Renames domain names for addresses, DKIM keys and Domain Aliases","operationId":"putaddressesrenamedomain","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"oldDomain":{"type":"string","description":"Old Domain Name","required":true},"newDomain":{"type":"string","description":"New Domain Name","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["oldDomain","newDomain"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"modifiedAddresses":{"type":"number","description":"Number of modified addresses","required":true},"modifiedUsers":{"type":"number","description":"Number of modified users","required":true},"modifiedDkim":{"type":"number","description":"Number of modified DKIM keys","required":true},"modifiedAliases":{"type":"number","description":"Number of modified Domain Aliases","required":true}},"required":["success","modifiedAddresses","modifiedUsers","modifiedDkim","modifiedAliases"]}}}}}}},"/users/:user/mailboxes":{"get":{"tags":["Mailboxes"],"summary":"List Mailboxes for a User","operationId":"getusersusermailboxes","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"specialUse","in":"query","description":"Should the response include only folders with specialUse flag set.","required":false,"schema":{"type":"boolean"}},{"name":"showHidden","in":"query","description":"Hidden folders are not included in the listing by default.","required":false,"schema":{"type":"boolean"}},{"name":"counters","in":"query","description":"Should the response include counters (total + unseen). Counters come with some overhead.","required":false,"schema":{"type":"boolean"}},{"name":"sizes","in":"query","description":"Should the response include mailbox size in bytes. Size numbers come with a lot of overhead as an aggregated query is ran.","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Mailbox","required":true},"name":{"type":"string","description":"Name for the mailbox (unicode string)","required":true},"path":{"type":"string","description":"Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)","required":true},"specialUse":{"type":"string","description":"Either special use identifier or null. One of Drafts, Junk, Sent or Trash","required":true},"modifyIndex":{"type":"number","description":"Modification sequence number. Incremented on every change in the mailbox.","required":true},"subscribed":{"type":"boolean","description":"Mailbox subscription status. IMAP clients may unsubscribe from a folder.","required":true},"retention":{"type":"number","description":"Default retention policy for this mailbox (in ms). If set then messages added to this maibox will be automatically deleted after retention time.","required":false},"hidden":{"type":"boolean","description":"Is the folder hidden or not","required":true},"total":{"type":"number","description":"How many messages are stored in this mailbox","required":true},"unseen":{"type":"number","description":"How many unseen messages are stored in this mailbox","required":true},"size":{"type":"number","description":"Total size of mailbox in bytes.","required":false}},"required":["id","name","path","specialUse","modifyIndex","subscribed","hidden","total","unseen"]},"description":"List of user mailboxes"}},"required":["success","results"]}}}}}},"post":{"tags":["Mailboxes"],"summary":"Create new Mailbox","operationId":"postusersusermailboxes","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)","required":true},"hidden":{"type":"boolean","description":"Is the folder hidden or not. Hidden folders can not be opened in IMAP.","required":false},"retention":{"type":"number","description":"Retention policy for the created Mailbox. Milliseconds after a message added to mailbox expires. Set to 0 to disable.","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["path"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Mailbox","required":true}},"required":["success","id"]}}}}}}},"/users/:user/mailboxes/:mailbox":{"get":{"tags":["Mailboxes"],"summary":"Request Mailbox information","operationId":"getusersusermailboxesmailbox","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","description":"If mailbox is specified as `resolve` in the path then use this param as mailbox path instead of the given mailbox id.","required":false,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Mailbox","required":true},"name":{"type":"string","description":"Name for the mailbox (unicode string)","required":true},"path":{"type":"string","description":"Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)","required":true},"specialUse":{"type":"string","description":"Either special use identifier or null. One of Drafts, Junk, Sent or Trash","required":true,"example":"\\Draft"},"modifyIndex":{"type":"number","description":"Modification sequence number. Incremented on every change in the mailbox.","required":true},"subscribed":{"type":"boolean","description":"Mailbox subscription status. IMAP clients may unsubscribe from a folder.","required":true},"hidden":{"type":"boolean","description":"Is the folder hidden or not","required":true},"total":{"type":"number","description":"How many messages are stored in this mailbox","required":true},"unseen":{"type":"number","description":"How many unseen messages are stored in this mailbox","required":true}},"required":["success","id","name","path","specialUse","modifyIndex","subscribed","hidden","total","unseen"]}}}}}},"put":{"tags":["Mailboxes"],"summary":"Update Mailbox information","operationId":"putusersusermailboxesmailbox","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Full path of the mailbox, use this to rename an existing Mailbox","required":false},"retention":{"type":"number","description":"Retention policy for the Mailbox (in ms). Changing retention value only affects messages added to this folder after the change","required":false},"subscribed":{"type":"boolean","description":"Change Mailbox subscription state","required":false},"hidden":{"type":"boolean","description":"Is the folder hidden or not. Hidden folders can not be opened in IMAP.","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"delete":{"tags":["Mailboxes"],"summary":"Delete a Mailbox","operationId":"deleteusersusermailboxesmailbox","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/mailboxes/:mailbox/messages":{"get":{"tags":["Messages"],"summary":"List messages in a Mailbox","description":"Lists all messages in a mailbox","operationId":"messages","parameters":[{"name":"user","in":"path","description":"ID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"unseen","in":"query","description":"If true, then returns only unseen messages","required":false,"schema":{"type":"boolean"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"threadCounters","in":"query","description":"If true, then includes threadMessageCount in the response. Counters come with some overhead","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"order","in":"query","description":"Ordering of the records by insert date","required":false,"schema":{"type":"any","enum":["asc","desc"]}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}},{"name":"includeHeaders","in":"query","description":"Comma separated list of header keys to include in the response","required":false,"schema":{"type":"alternatives"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true},"total":{"type":"number","description":"How many results were found","required":true},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"specialUse":{"type":"string","description":"Special use. If available","required":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetMessagesResult"},"description":"Message listing"}},"required":["success","total","page","previousCursor","nextCursor","specialUse","results"]}}}}}},"put":{"tags":["Messages"],"summary":"Update Message information","description":"This method updates message flags and also allows to move messages to a different mailbox","operationId":"putusersusermailboxesmailboxmessages","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Message ID. Either singular or comma separated number (1,2,3) or colon separated range (3:15), or a range from UID to end (3:*)","required":true},"moveTo":{"type":"string","description":"ID of the target Mailbox if you want to move messages","required":false},"seen":{"type":"boolean","description":"State of the \\Seen flag","required":false},"deleted":{"type":"boolean","description":"State of the \\Deleted flag","required":false},"flagged":{"type":"boolean","description":"State of the \\Flagged flag","required":false},"draft":{"type":"boolean","description":"State of the \\Draft flag","required":false},"expires":{"oneOf":[{"type":"string","required":false,"format":"date-time"},{"type":"boolean","required":false,"enum":[false]}],"description":"Either expiration date or false to turn off autoexpiration"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["message"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"array","items":{"type":"object","properties":{},"required":[]},"description":"If messages were moved then lists new ID values. Array entry is an array with first element pointing to old ID and second to new ID"},"mailbox":{"type":"string","description":"MoveTo mailbox address","required":false},"updated":{"type":"number","description":"If messages were not moved, then indicates the number of updated messages","required":false}},"required":["success"]}}}}}},"delete":{"tags":["Messages"],"summary":"Delete all Messages from a Mailbox","operationId":"deleteusersusermailboxesmailboxmessages","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"async","in":"query","description":"Schedule deletion task","required":false,"schema":{"type":"boolean"}},{"name":"skipArchive","in":"query","description":"Skip archived messages","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"deleted":{"type":"number","description":"Indicates the count of deleted messages","required":true},"errors":{"type":"number","description":"Indicate the count of errors during the delete","required":true}},"required":["success","deleted","errors"]}}}}}},"post":{"tags":["Messages"],"summary":"Upload Message","description":"This method allows to upload either an RFC822 formatted message or a message structure to a mailbox. Raw message is stored unmodified, no headers are added or removed. If you want to generate the uploaded message from structured data fields, then do not use the raw property.","operationId":"postusersusermailboxesmailboxmessages","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","description":"Date","required":false,"format":"date-time"},"unseen":{"type":"boolean","description":"Is the message unseen or not","required":false},"flagged":{"type":"boolean","description":"Is the message flagged or not","required":false},"draft":{"type":"boolean","description":"Is the message a draft or not","required":false},"raw":{"type":"string","description":"base64 encoded message source. Alternatively, you can provide this value as POST body by using message/rfc822 MIME type. If raw message is provided then it overrides any other mail configuration","required":false,"format":"binary"},"from":{"$ref":"#/components/schemas/AddressOptionalName"},"replyTo":{"$ref":"#/components/schemas/AddressOptionalName"},"to":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the To: header"},"cc":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the Cc: header"},"bcc":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the Bcc: header"},"headers":{"type":"array","items":{"$ref":"#/components/schemas/Header"},"description":"Custom headers for the message. If reference message is set then In-Reply-To and References headers are set automatically"},"subject":{"type":"string","description":"Message subject. If not then resolved from Reference message","required":false},"text":{"type":"string","description":"Plaintext message","required":false},"html":{"type":"string","description":"HTML formatted message","required":false},"files":{"type":"array","items":{"type":"string","required":false},"description":"Attachments as storage file IDs. NB! When retrieving message info then an array of objects is returned. When uploading a message then an array of IDs is used."},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"},"description":"Attachments for the message"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"reference":{"$ref":"#/components/schemas/ReferenceWithAttachments"},"replacePrevious":{"type":"object","description":"If set, then deletes a previous message when storing the new one. Useful when uploading a new Draft message.","properties":{"mailbox":{"type":"string","required":false},"id":{"type":"number","required":true}},"required":["id"]},"bimi":{"$ref":"#/components/schemas/Bimi"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"message":{"type":"object","description":"Message information","properties":{"id":{"type":"number","description":"Message ID in mailbox","required":true},"malbox":{"type":"string","description":"Mailbox ID the message was stored into","required":true},"size":{"type":"number","description":"Size of the RFC822 formatted email","required":true}},"required":["id","malbox","size"]},"previousDeleted":{"type":"boolean","description":"Set if replacing a previous message was requested","required":false},"previousDeleteError":{"type":"string","description":"Previus delete error message","required":false}},"required":["success","message"]}}}}}}},"/users/:user/search":{"get":{"tags":["Messages"],"summary":"Search for messages","description":"This method allows searching for matching messages.","operationId":"search","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","description":"Additional query string","required":false,"schema":{"type":"string"}},{"name":"mailbox","in":"query","description":"ID of the Mailbox","required":false,"schema":{"type":"string"}},{"name":"id","in":"query","description":"Message ID values, only applies when used in combination with `mailbox`. Either comma separated numbers (1,2,3) or colon separated range (3:15), or a range from UID to end (3:*)","required":false,"schema":{"type":"string"}},{"name":"thread","in":"query","description":"Thread ID","required":false,"schema":{"type":"string"}},{"name":"or","in":"query","description":"At least onOne of the included terms must match","required":false,"schema":{"type":"object"}},{"name":"query","in":"query","description":"Search string, uses MongoDB fulltext index. Covers data from mesage body and also common headers like from, to, subject etc.","required":false,"schema":{"type":"string"}},{"name":"datestart","in":"query","description":"Datestring for the earliest message storing time","required":false,"schema":{"type":"date"}},{"name":"dateend","in":"query","description":"Datestring for the latest message storing time","required":false,"schema":{"type":"date"}},{"name":"from","in":"query","description":"Partial match for the From: header line","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","description":"Partial match for the To: and Cc: header lines","required":false,"schema":{"type":"string"}},{"name":"subject","in":"query","description":"Partial match for the Subject: header line","required":false,"schema":{"type":"string"}},{"name":"minSize","in":"query","description":"Minimal message size in bytes","required":false,"schema":{"type":"number"}},{"name":"maxSize","in":"query","description":"Maximal message size in bytes","required":false,"schema":{"type":"number"}},{"name":"attachments","in":"query","description":"If true, then matches only messages with attachments","required":false,"schema":{"type":"boolean"}},{"name":"flagged","in":"query","description":"If true, then matches only messages with \\Flagged flags","required":false,"schema":{"type":"boolean"}},{"name":"unseen","in":"query","description":"If true, then matches only messages without \\Seen flags","required":false,"schema":{"type":"boolean"}},{"name":"includeHeaders","in":"query","description":"Comma separated list of header keys to include in the response","required":false,"schema":{"type":"string","example":"List-ID, MIME-Version"}},{"name":"searchable","in":"query","description":"If true, then matches messages not in Junk or Trash","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}},{"name":"threadCounters","in":"query","description":"If true, then includes threadMessageCount in the response. Counters come with some overhead","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"order","in":"query","description":"Ordering of the records by insert date. If no order is supplied, results are sorted by heir mongoDB ObjectId.","required":false,"schema":{"type":"any","enum":["asc","desc"]}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true},"query":{"type":"string","required":true},"total":{"type":"number","required":true},"page":{"type":"number","required":true},"previousCursor":{"oneOf":[{"type":"boolean","required":false},{"type":"string","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"boolean","required":false},{"type":"string","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetMessagesResult"},"description":"Message listing"}},"required":["success","query","total","page","previousCursor","nextCursor","results"]}}}}}},"post":{"tags":["Messages"],"summary":"Search and update messages","description":"This method allows applying an action to all matching messages. This is an async method so that it will return immediately. Actual modifications are run in the background.","operationId":"searchApply","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","description":"Additional query string","required":false},"mailbox":{"type":"string","description":"ID of the Mailbox","required":false},"id":{"type":"string","description":"Message ID values, only applies when used in combination with `mailbox`. Either comma separated numbers (1,2,3) or colon separated range (3:15), or a range from UID to end (3:*)","required":false},"thread":{"type":"string","description":"Thread ID","required":false},"or":{"type":"object","description":"At least onOne of the included terms must match","properties":{"query":{"type":"string","description":"Search string, uses MongoDB fulltext index. Covers data from mesage body and also common headers like from, to, subject etc.","required":false},"from":{"type":"string","description":"Partial match for the From: header line","required":false},"to":{"type":"string","description":"Partial match for the To: and Cc: header lines","required":false},"subject":{"type":"string","description":"Partial match for the Subject: header line","required":false}},"required":[]},"query":{"type":"string","description":"Search string, uses MongoDB fulltext index. Covers data from mesage body and also common headers like from, to, subject etc.","required":false},"datestart":{"type":"string","description":"Datestring for the earliest message storing time","required":false,"format":"date-time"},"dateend":{"type":"string","description":"Datestring for the latest message storing time","required":false,"format":"date-time"},"from":{"type":"string","description":"Partial match for the From: header line","required":false},"to":{"type":"string","description":"Partial match for the To: and Cc: header lines","required":false},"subject":{"type":"string","description":"Partial match for the Subject: header line","required":false},"minSize":{"type":"number","description":"Minimal message size in bytes","required":false},"maxSize":{"type":"number","description":"Maximal message size in bytes","required":false},"attachments":{"type":"boolean","description":"If true, then matches only messages with attachments","required":false},"flagged":{"type":"boolean","description":"If true, then matches only messages with \\Flagged flags","required":false},"unseen":{"type":"boolean","description":"If true, then matches only messages without \\Seen flags","required":false},"includeHeaders":{"type":"string","description":"Comma separated list of header keys to include in the response","required":false,"example":"List-ID, MIME-Version"},"searchable":{"type":"boolean","description":"If true, then matches messages not in Junk or Trash","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false},"action":{"type":"object","description":"Define actions to take with matching messages","properties":{"moveTo":{"type":"string","description":"ID of the target Mailbox if you want to move messages","required":false},"seen":{"type":"boolean","description":"State of the \\Seen flag","required":false},"flagged":{"type":"boolean","description":"State of the \\Flagged flag","required":false}},"required":[]}},"required":["action"]}}},"required":true},"parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates if the action succeeded or not","required":true},"scheduled":{"type":"string","description":"ID of the scheduled operation","required":true},"existing":{"type":"boolean","description":"Indicates if the scheduled operation already exists","required":true}},"required":["success","scheduled","existing"]}}}}}}},"/users/:user/mailboxes/:mailbox/messages/:message":{"get":{"tags":["Messages"],"summary":"Request Message information","operationId":"message","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}},{"name":"replaceCidLinks","in":"query","description":"If true then replaces cid links","required":false,"schema":{"type":"boolean"}},{"name":"markAsSeen","in":"query","description":"If true then marks message as seen","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"number","description":"Message ID","required":true},"mailbox":{"type":"string","description":"ID of the Mailbox","required":true},"user":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"envelope":{"$ref":"#/components/schemas/Envelope"},"thread":{"type":"string","description":"ID of the Thread","required":true},"from":{"$ref":"#/components/schemas/Address"},"replyTo":{"$ref":"#/components/schemas/Address"},"to":{"$ref":"#/components/schemas/Address"},"cc":{"$ref":"#/components/schemas/Address"},"bcc":{"$ref":"#/components/schemas/Address"},"subject":{"type":"string","description":"Message subject","required":true},"messageId":{"type":"string","description":"Message-ID header","required":true},"date":{"type":"string","description":"Date string from header","required":true,"format":"date-time"},"idate":{"type":"string","description":"Date string of receive time","required":false,"format":"date-time"},"list":{"$ref":"#/components/schemas/List"},"size":{"type":"number","description":"Message size","required":true},"expires":{"type":"string","description":"Datestring, if set then indicates the time after this message is automatically deleted","required":false},"seen":{"type":"boolean","description":"Does this message have a \\Seen flag","required":true},"deleted":{"type":"boolean","description":"Does this message have a \\Deleted flag","required":true},"flagged":{"type":"boolean","description":"Does this message have a \\Flagged flag","required":true},"draft":{"type":"boolean","description":"Does this message have a \\Draft flag","required":true},"html":{"type":"array","items":{"type":"string","required":false},"description":"An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string"},"text":{"type":"string","description":"Plaintext content of the message","required":false},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Attachment ID","required":true},"hash":{"type":"string","description":"SHA-256 hash of the contents of the attachment","required":false},"filename":{"type":"string","description":"Filename of the attachment","required":true},"contentType":{"type":"string","description":"MIME type","required":true},"disposition":{"type":"string","description":"Attachment disposition","required":true},"transferEncoding":{"type":"string","description":"Which transfer encoding was used (actual content when fetching attachments is not encoded)","required":true},"related":{"type":"boolean","description":"Was this attachment found from a multipart/related node. This usually means that this is an embedded image","required":true},"sizeKb":{"type":"number","description":"Approximate size of the attachment in kilobytes","required":true}},"required":["id","filename","contentType","disposition","transferEncoding","related","sizeKb"]},"description":"Attachments for the message"},"verificationResults":{"type":"object","description":"Security verification info if message was received from MX. If this property is missing then do not automatically assume invalid TLS, SPF or DKIM.","properties":{"tls":{"$ref":"#/components/schemas/Tls"},"spf":{"type":"object","description":"Domain name (either MFROM or HELO) of verified SPF or false if no SPF match was found","properties":{},"required":[]},"dkim":{"type":"object","description":"Domain name of verified DKIM signature or false if no valid signature was found","properties":{},"required":[]}},"required":["tls","spf","dkim"]},"bimi":{"type":"object","description":"BIMI logo info. If logo validation failed in any way, then this property is not set","properties":{"certified":{"type":"boolean","description":"If true, then this logo is from a VMC file","required":false},"url":{"type":"string","description":"URL of the resource the logo was retrieved from","required":false},"image":{"type":"string","description":"Data URL for the SVG image","required":false}},"required":[]},"contentType":{"type":"object","description":"Parsed Content-Type header. Usually needed to identify encrypted messages and such","properties":{"value":{"type":"string","description":"MIME type of the message, eg. \"multipart/mixed","required":true},"params":{"type":"object","description":"An object with Content-Type params as key-value pairs","properties":{},"required":[]}},"required":["value","params"]},"metaData":{"type":"object","description":"Custom metadata object set for this message","properties":{},"required":[]},"references":{"type":"array","items":{"$ref":"#/components/schemas/ReferenceWithAttachments"},"description":"References"},"files":{"type":"object","description":"List of files added to this message as attachments. Applies to Drafts, normal messages do not have this property. Needed to prevent uploading the same attachment every time a draft is updated","properties":{},"required":[]},"outbound":{"type":"array","items":{"type":"object","properties":{},"required":[]},"description":"Outbound queue entries"},"forwardTargets":{"type":"object","description":"Forward targets","properties":{},"required":[]},"reference":{"type":"object","description":"Referenced message info","properties":{},"required":[]},"answered":{"type":"boolean","description":"\\Answered flag value","required":true},"forwarded":{"type":"boolean","description":"$Forwarded flag value","required":true},"encrypted":{"type":"boolean","description":"True if message is encrypted","required":false}},"required":["success","id","mailbox","user","envelope","thread","from","subject","messageId","date","size","seen","deleted","flagged","draft","contentType","references","answered","forwarded"]}}}}}},"put":{"tags":["Messages"],"summary":"Update message information with path param","description":"This method updates message flags and also allows to move messages to a different mailbox","operationId":"putusersusermailboxesmailboxmessagesmessage","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"moveTo":{"type":"string","description":"ID of the target Mailbox if you want to move messages","required":false},"seen":{"type":"boolean","description":"State of the \\Seen flag","required":false},"deleted":{"type":"boolean","description":"State of the \\Deleted flag","required":false},"flagged":{"type":"boolean","description":"State of the \\Flagged flag","required":false},"draft":{"type":"boolean","description":"State of the \\Draft flag","required":false},"expires":{"oneOf":[{"type":"string","required":false,"format":"date-time"},{"type":"boolean","required":false,"enum":[false]}],"description":"Either expiration date or false to turn off autoexpiration"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID. Either singular or comma separated number (1,2,3) or colon separated range (3:15), or a range from UID to end (3:*)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"array","items":{"type":"object","properties":{},"required":[]},"description":"If messages were moved then lists new ID values. Array entry is an array with first element pointing to old ID and second to new ID"},"mailbox":{"type":"string","description":"MoveTo mailbox address","required":false},"updated":{"type":"number","description":"If messages were not moved, then indicates the number of updated messages","required":false}},"required":["success"]}}}}}},"delete":{"tags":["Messages"],"summary":"Delete a Message","operationId":"deleteusersusermailboxesmailboxmessagesmessage","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/mailboxes/:mailbox/messages/:message/message.eml":{"get":{"tags":["Messages"],"summary":"Get Message source","description":"This method returns the full RFC822 formatted source of the stored message","operationId":"raw","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"message/rfc822":{"schema":{"type":"object","properties":{"success":{"type":"string","description":"Success","required":false,"format":"binary"}},"required":[]}}}}}}},"/users/:user/mailboxes/:mailbox/messages/:message/attachments/:attachment":{"get":{"tags":["Messages"],"summary":"Download Attachment","description":"This method returns attachment file contents in binary form","operationId":"attachment","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}},{"name":"attachment","in":"path","description":"ID of the Attachment","required":true,"schema":{"type":"string"}},{"name":"sendAsString","in":"query","description":"If true then sends the original attachment back in string format with correct encoding.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success","content":{"application/octet-stream":{"schema":{"type":"object","properties":{"success":{"type":"string","required":false,"format":"binary"}},"required":[]}}}}}}},"/users/:user/mailboxes/:mailbox/messages/:message/forward":{"post":{"tags":["Messages"],"summary":"Forward stored Message","description":"This method allows either to re-forward a message to an original forward target or forward it to some other address. This is useful if a user had forwarding turned on but the message was not delivered so you can try again. Forwarding does not modify the original message.","operationId":"postusersusermailboxesmailboxmessagesmessageforward","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"type":"number","description":"Number of original forwarding target","required":false},"addresses":{"type":"array","items":{"type":"string","required":false},"description":"An array of additional forward targets"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"queueId":{"type":"string","description":"Message ID in outbound queue","required":false},"forwarded":{"type":"array","items":{"$ref":"#/components/schemas/Forwarded"},"description":"Information about forwarding targets"}},"required":["success"]}}}}}}},"/users/:user/mailboxes/:mailbox/messages/:message/submit":{"post":{"tags":["Messages"],"summary":"Submit Draft for delivery","description":"This method allows to submit a draft message for delivery. Draft is moved to Sent mail folder.","operationId":"postusersusermailboxesmailboxmessagesmessagesubmit","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"deleteFiles":{"type":"boolean","description":"If true then deletes attachment files listed in metaData.files array","required":false},"sendTime":{"type":"string","description":"Datestring for delivery if message should be sent some later time","required":false,"format":"date-time"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"queueId":{"type":"string","description":"Message ID in outbound queue","required":true},"message":{"$ref":"#/components/schemas/Message"}},"required":["success","queueId"]}}}}}}},"/users/:user/outbound/:queueId":{"delete":{"tags":["Messages"],"summary":"Delete an Outbound Message","description":"You can delete outbound emails that are still in queue. Queue ID can be found from the `outbound` property of a stored email.","operationId":"deleteusersuseroutboundqueueid","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"queueId","in":"path","description":"Outbound queue ID of the message","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/archived/messages":{"get":{"tags":["Archive"],"summary":"List archived messages","description":"Archive contains all recently deleted messages besides Drafts etc.","operationId":"archived","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"order","in":"query","description":"Ordering of the records by insert date","required":false,"schema":{"type":"any","enum":["asc","desc"]}},{"name":"includeHeaders","in":"query","description":"Comma separated list of header keys to include in the response","required":false,"schema":{"type":"string","example":"List-ID, MIME-Version"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true},"total":{"type":"number","description":"How many results were found","required":true},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetMessagesResult"},"description":"Message listing"}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}}},"/users/:user/archived/restore":{"post":{"tags":["Archive"],"summary":"Restore archived messages","description":"Initiates a restore task to move archived messages of a date range back to the mailboxes the messages were deleted from. If target mailbox does not exist, then the messages are moved to INBOX.","operationId":"create_restore_task","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"type":"string","description":"Datestring","required":true,"format":"date-time"},"end":{"type":"string","description":"Datestring","required":true,"format":"date-time"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["start","end"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true},"task":{"type":"string","description":"Task ID","required":true}},"required":["success","task"]}}}}}}},"/users/:user/archived/messages/:message/restore":{"post":{"tags":["Archive"],"summary":"Restore archived messages","description":"Initiates a restore task to move archived messages of a date range back to the mailboxes the messages were deleted from. If target mailbox does not exist, then the messages are moved to INBOX.","operationId":"archived_restore","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mailbox":{"type":"string","description":"ID of the target Mailbox. If not set then original mailbox is used.","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true},"mailbox":{"type":"string","description":"Maibox ID the message was moved to","required":true},"id":{"type":"number","description":"New ID for the Message","required":true}},"required":["success","mailbox","id"]}}}}}}},"/users/:user/storage":{"post":{"tags":["Storage"],"summary":"Upload file","description":"This method allows to upload an attachment to be linked from a draft","operationId":"postusersuserstorage","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","description":"Name of the file","required":false},"contentType":{"type":"string","description":"MIME type of the file. Is detected from the file name by default","required":false},"encoding":{"type":"string","description":"Encoding of the file content. Useful if you want to upload the file in base64 encoded format. Valid options \"base64\", \"hex\", \"utf8\"","required":false,"enum":["base64"]},"content":{"type":"string","description":"File content in binary","required":true,"format":"binary"},"cid":{"type":"string","description":"content ID","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["content"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"File ID","required":true}},"required":["success","id"]}}}}}},"get":{"tags":["Storage"],"summary":"List stored files","operationId":"getusersuserstorage","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"query","in":"query","description":"partial match of a filename","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetFilesResult"},"description":"File listing"}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}}},"/users/:user/storage/:file":{"delete":{"tags":["Storage"],"summary":"Delete a File","operationId":"deleteusersuserstoragefile","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"file","in":"path","description":"ID of the File","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"get":{"tags":["Storage"],"summary":"Download File","description":"This method returns stored file contents in binary form","operationId":"storagefile","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"file","in":"path","description":"ID of the File","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/octet-stream":{"schema":{"type":"string","required":false,"format":"binary"}}}}}}},"/filters":{"get":{"tags":["Filters"],"summary":"List all Filters","operationId":"filters","parameters":[{"name":"forward","in":"query","description":"Partial match of a forward email address or URL","required":false,"schema":{"type":"string"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument.","required":true},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetAllFiltersResult"},"description":"Address listing"}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}}},"/users/:user/filters":{"get":{"tags":["Filters"],"summary":"List Filters for a User","operationId":"getusersuserfilters","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"limits":{"type":"object","description":"Filter usage limits for the user account","properties":{"allowed":{"type":"number","description":"How many filters are allowed","required":false},"used":{"type":"number","description":"How many filters have been created","required":false}},"required":[]},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetFiltersResult"},"description":"Filter description"}},"required":["success","limits","results"]}}}}}},"post":{"tags":["Filters"],"summary":"Create a new Filter","operationId":"postusersuserfilters","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the Filter","required":false},"query":{"$ref":"#/components/schemas/Query"},"action":{"$ref":"#/components/schemas/Action"},"disabled":{"type":"boolean","description":"If true then this filter is ignored","required":false},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["query","action"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID for the created filter","required":true}},"required":["success","id"]}}}}}}},"/users/:user/filters/:filter":{"get":{"tags":["Filters"],"summary":"Request Filter information","operationId":"getusersuserfiltersfilter","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"filter","in":"path","description":"Filters unique ID","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Filters unique ID","required":true},"name":{"type":"string","description":"Name for the filter","required":true},"created":{"type":"string","description":"Datestring of the time the filter was created","required":true,"format":"date-time"},"query":{"$ref":"#/components/schemas/Query"},"action":{"$ref":"#/components/schemas/Action"},"disabled":{"type":"boolean","description":"If true, then this filter is ignored","required":true},"metaData":{"type":"object","description":"Custom metadata value","properties":{},"required":[]}},"required":["success","id","name","created","query","action","disabled"]}}}}}},"delete":{"tags":["Filters"],"summary":"Delete a Filter","operationId":"deleteusersuserfiltersfilter","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"filter","in":"path","description":"Filters unique ID","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"put":{"tags":["Filters"],"summary":"Update Filter information","operationId":"putusersuserfiltersfilter","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the Filter","required":false},"query":{"$ref":"#/components/schemas/Query"},"action":{"$ref":"#/components/schemas/Action"},"disabled":{"type":"boolean","description":"If true then this filter is ignored","required":false},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"filter","in":"path","description":"Filters unique ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/domainaccess/:tag/allow":{"post":{"tags":["DomainAccess"],"summary":"Add domain to allowlist","description":"If an email is sent from a domain that is listed in the allowlist then it is never marked as spam. Lists apply for tagged users.","operationId":"postdomainaccesstagallow","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain name to allowlist for users/addresses that include this tag","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["domain"]}}},"required":true},"parameters":[{"name":"tag","in":"path","description":"Tag to look for","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID for the created record","required":true}},"required":["success","id"]}}}}}},"get":{"tags":["DomainAccess"],"summary":"List allowlisted domains","operationId":"getdomainaccesstagallow","parameters":[{"name":"tag","in":"path","description":"Tag to look for","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetAllowedDomainResult"},"description":"Domain list"}},"required":["success","results"]}}}}}}},"/domainaccess/:tag/block":{"post":{"tags":["DomainAccess"],"summary":"Add domain to blocklist","description":"If an email is sent from a domain that is listed in the blocklist then it is always marked as spam. Lists apply for tagged users.","operationId":"postdomainaccesstagblock","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain name to blocklist for users/addresses that include this tag","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["domain"]}}},"required":true},"parameters":[{"name":"tag","in":"path","description":"Tag to look for","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID for the created record","required":true}},"required":["success","id"]}}}}}},"get":{"tags":["DomainAccess"],"summary":"List blocklisted domains","operationId":"getdomainaccesstagblock","parameters":[{"name":"tag","in":"path","description":"Tag to look for","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetBlockedDomainResult"},"description":"Domain list"}},"required":["success","results"]}}}}}}},"/domainaccess/:domain":{"delete":{"tags":["DomainAccess"],"summary":"Delete a Domain from listing","operationId":"deletedomainaccessdomain","parameters":[{"name":"domain","in":"path","description":"Listed domain's unique ID","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"deleted":{"type":"string","description":"Deleted domain's unique ID","required":true}},"required":["success","deleted"]}}}}}}},"/users/:user/asps":{"get":{"tags":["ApplicationPasswords"],"summary":"List Application Passwords","operationId":"getusersuserasps","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"showAll","in":"query","description":"If not true then skips entries with a TTL set","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetASPsResult"},"description":"Event listing"}},"required":["success","results"]}}}}}},"post":{"tags":["ApplicationPasswords"],"summary":"Create new Application Password","operationId":"postusersuserasps","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","description":"Description for the Application Password entry","required":true},"scopes":{"type":"array","items":{"type":"string","required":true,"enum":["imap","pop3","smtp","*"]},"description":"List of scopes this Password applies to. Special scope \"*\" indicates that this password can be used for any scope except \"master\""},"address":{"type":"string","description":"E-mail address to be used as the account address in mobileconfig file. Must be one of the listed identity addresses of the user. Defaults to the main address of the user","required":false},"password":{"type":"string","description":"Optional pregenerated password. Must be 16 characters, latin letters only.","required":false},"generateMobileconfig":{"type":"boolean","description":"If true then result contains a mobileconfig formatted file with account config","required":false},"ttl":{"type":"number","description":"TTL in seconds for this password. Every time password is used, TTL is reset to this value","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["description"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Application Password","required":true},"password":{"type":"string","description":"Application Specific Password. Generated password is whitespace agnostic, so it could be displayed to the client as \"abcd efgh ijkl mnop\" instead of \"abcdefghijklmnop\"","required":true},"mobileconfig":{"type":"string","description":"Base64 encoded mobileconfig file. Generated profile file should be sent to the client with Content-Type value of application/x-apple-aspen-config.","required":true},"name":{"type":"string","description":"Account name","required":true},"address":{"type":"string","description":"Account address or the address specified in params of this endpoint","required":true}},"required":["success","id","password","mobileconfig","name","address"]}}}}}}},"/users/:user/asps/:asp":{"get":{"tags":["ApplicationPasswords"],"summary":"Request ASP information","operationId":"getusersuseraspsasp","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"asp","in":"path","description":"ID of the Application Password","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Application Password","required":true},"description":{"type":"string","description":"Description","required":true},"scopes":{"type":"array","items":{"type":"string","required":true,"enum":["imap","pop3","smtp","*"]},"description":"Allowed scopes for the Application Password"},"lastUse":{"$ref":"#/components/schemas/LastUse"},"created":{"type":"string","description":"Datestring","required":true,"format":"date-time"},"expires":{"type":"string","description":"Application password expires after the given date","required":true,"format":"date-time"}},"required":["success","id","description","scopes","lastUse","created","expires"]}}}}}},"delete":{"tags":["ApplicationPasswords"],"summary":"Delete an Application Password","operationId":"deleteusersuseraspsasp","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"asp","in":"path","description":"ID of the Application Password","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa/totp/setup":{"post":{"tags":["TwoFactorAuth"],"summary":"Generate TOTP seed","description":"This method generates TOTP seed and QR code for 2FA. User needs to verify the seed value using 2fa/totp/enable endpoint","operationId":"postusersuser2fatotpsetup","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","description":"Label text for QR code (defaults to username)","required":false},"issuer":{"type":"string","description":"Description text for QR code (defaults to \"WildDuck\")","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["issuer"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"seed":{"type":"string","description":"Generated TOTP seed value","required":true},"qrcode":{"type":"string","description":"Base64 encoded QR code","required":true}},"required":["success","seed","qrcode"]}}}}}}},"/users/:user/2fa/totp/enable":{"post":{"tags":["TwoFactorAuth"],"summary":"Enable TOTP seed","description":"This method enables TOTP for a user by verifying the seed value generated from 2fa/totp/setup","operationId":"postusersuser2fatotpenable","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"6-digit number that matches seed value from 2fa/totp/setup","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["token"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa/totp":{"delete":{"tags":["TwoFactorAuth"],"summary":"Disable TOTP auth","description":"This method disables TOTP for a user. Does not affect other 2FA mechanisms a user might have set up","operationId":"deleteusersuser2fatotp","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa/totp/check":{"post":{"tags":["TwoFactorAuth"],"summary":"Validate TOTP Token","description":"This method checks if a TOTP token provided by a User is valid for authentication","operationId":"postusersuser2fatotpcheck","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"6-digit number","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["token"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa":{"delete":{"tags":["TwoFactorAuth"],"summary":"Disable 2FA","description":"This method disables all 2FA mechanisms a user might have set up","operationId":"deleteusersuser2fa","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa/custom":{"put":{"tags":["TwoFactorAuth"],"summary":"Enable custom 2FA for a user","description":"This method disables account password for IMAP/POP3/SMTP","operationId":"putusersuser2facustom","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"delete":{"tags":["TwoFactorAuth"],"summary":"Disable custom 2FA for a user","description":"This method disables custom 2FA. If it was the only 2FA set up, then account password for IMAP/POP3/SMTP gets enabled again","operationId":"deleteusersuser2facustom","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa/webauthn/credentials":{"get":{"tags":["TwoFactorAuth"],"summary":"Get WebAuthN credentials for a user","description":"This method returns the list of WebAuthN credentials for a given user","operationId":"getusersuser2fawebauthncredentials","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"credentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Credential ID","required":true},"rawId":{"type":"string","description":"Raw ID string of the credential in hex","required":true},"description":{"type":"string","description":"Descriptive name for the authenticator","required":true},"authenticatorAttachment":{"type":"string","description":"Indicates whether authenticators is a part of the OS (\"platform\"), or roaming authenticators (\"cross-platform\")","required":true,"example":"platform"}},"required":["id","rawId","description","authenticatorAttachment"]},"description":"List of credentials"}},"required":["success","credentials"]}}}}}}},"/users/:user/2fa/webauthn/credentials/:credential":{"delete":{"tags":["TwoFactorAuth"],"summary":"Remove WebAuthN authenticator","description":"This method deletes the given WebAuthN authenticator for given user.","operationId":"deleteusersuser2fawebauthncredentialscredential","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"credential","in":"path","description":"Credential ID","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"deleted":{"type":"boolean","description":"Specifies whether the given credential has been deleted","required":true}},"required":["success","deleted"]}}}}}}},"/users/:user/2fa/webauthn/registration-challenge":{"post":{"tags":["TwoFactorAuth"],"summary":"Get the WebAuthN registration challenge","description":"This method initiates the WebAuthN authenticator registration challenge","operationId":"postusersuser2fawebauthnregistrationchallenge","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","description":"Descriptive name for the authenticator","required":true},"origin":{"type":"string","description":"Origin","required":true},"authenticatorAttachment":{"type":"string","description":"Indicates whether authenticators should be part of the OS (\"platform\"), or can be roaming authenticators (\"cross-platform\")","required":false,"enum":["platform","cross-platform"],"example":"cross-platform"},"rpId":{"type":"string","description":"Relaying party ID. Is domain.","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["description","origin"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"registrationOptions":{"type":"object","properties":{"challenge":{"type":"string","description":"Challenge as a hex string","required":true},"user":{"type":"object","properties":{"id":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"name":{"type":"string","description":"User address or name","required":true},"displayName":{"type":"string","description":"User display name or username","required":true}},"required":["id","name","displayName"]},"authenticatorSelection":{"type":"object","description":"Data about the authenticator","properties":{"authenticatorAttachment":{"type":"string","description":"\"platform\" or \"cross-platform\"","required":true}},"required":["authenticatorAttachment"]},"rp":{"type":"object","description":"Relaying party data","properties":{"name":{"type":"string","description":"Rp name","required":true},"id":{"type":"string","description":"Rp ID. Domain","required":true},"icon":{"type":"string","description":"Rp icon. data/image string in base64 format","required":false}},"required":["name","id"]},"excludeCredentials":{"type":"array","items":{"type":"object","properties":{"rawId":{"type":"string","description":"Raw ID of the credential as hex string","required":true},"type":{"type":"string","description":"Type of the credential","required":true},"transports":{"type":"array","items":{"type":"string","required":true},"description":"Credential transports. If authenticatorAttachment is \"platform\" then [\"internal\"] otherwise [\"usb\", \"nfc\", \"ble\"]"}},"required":["rawId","type","transports"]},"description":"List of credentials to exclude"}},"required":["challenge","authenticatorSelection","rp"]}},"required":["success"]}}}}}}},"/users/:user/2fa/webauthn/registration-attestation":{"post":{"tags":["TwoFactorAuth"],"summary":"Attestate WebAuthN authenticator","description":"Attestation is used to verify the authenticity of the authenticator and provide assurances about its features.","operationId":"postusersuser2fawebauthnregistrationattestation","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string","description":"Challenge as hex string","required":true},"rawId":{"type":"string","description":"Credential ID/RawID as hex string","required":true},"clientDataJSON":{"type":"string","description":"Clientside data JSON as hex string","required":true},"attestationObject":{"type":"string","description":"Attestation object represented as a hex string","required":true},"rpId":{"type":"string","description":"Relaying party ID. Is domain.","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["challenge","rawId","clientDataJSON","attestationObject"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Credential ID","required":true},"rawId":{"type":"string","description":"Credential RawID as a hex string","required":true},"description":{"type":"string","description":"Description for the authenticator","required":true},"authenticatorAttachment":{"type":"string","description":"Specifies whether authenticator is \"platform\" or \"cross-platform\"","required":true}},"required":["success","id","rawId","description","authenticatorAttachment"]}}}}}}},"/users/:user/2fa/webauthn/authentication-challenge":{"post":{"tags":["TwoFactorAuth"],"summary":"Begin WebAuthN authentication challenge","description":"This method retrieves the WebAuthN PublicKeyCredentialRequestOptions object to use it for authentication","operationId":"postusersuser2fawebauthnauthenticationchallenge","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string","description":"Origin domain","required":true},"authenticatorAttachment":{"type":"string","description":"Indicates whether authenticators should be part of the OS (\"platform\"), or can be roaming authenticators (\"cross-platform\")","required":false,"enum":["platform","cross-platform"],"example":"cross-platform"},"rpId":{"type":"string","description":"Relaying party ID. Domain","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["origin"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"authenticationOptions":{"type":"object","description":"PublicKeyCredentialRequestOptions object","properties":{"challenge":{"type":"string","description":"Challenge as hex string","required":true},"allowCredentials":{"type":"array","items":{"type":"object","properties":{"rawId":{"type":"string","description":"RawId of the credential as hex string","required":true},"type":{"type":"string","description":"Credential type","required":true}},"required":["rawId","type"]},"description":"Allowed credential(s) based on the request"},"rpId":{"type":"string","description":"Relaying Party ID. Domain","required":false},"rawChallenge":{"type":"string","description":"Raw challenge bytes. ArrayBuffer","required":false},"attestation":{"type":"string","description":"Attestation string. `direct`/`indirect`/`none`","required":false},"extensions":{"type":"object","description":"Any credential extensions","properties":{},"required":[]},"userVerification":{"type":"string","description":"User verification type. `required`/`preferred`/`discouraged`","required":false},"timeout":{"type":"number","description":"Timeout in milliseconds (ms)","required":false}},"required":["challenge","allowCredentials"]}},"required":["success","authenticationOptions"]}}}}}}},"/users/:user/2fa/webauthn/authentication-assertion":{"post":{"tags":["TwoFactorAuth"],"summary":"WebAuthN authentication Assertion","description":"Assert WebAuthN authentication request and actually authenticate the user","operationId":"postusersuser2fawebauthnauthenticationassertion","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string","description":"Challenge of the credential as hex string","required":true},"rawId":{"type":"string","description":"RawId of the credential","required":true},"clientDataJSON":{"type":"string","description":"Client data JSON as hex string","required":true},"authenticatorData":{"type":"string","description":"Authentication data as hex string","required":true},"signature":{"type":"string","description":"Private key encrypted signature to verify with public key on the server. Hex string","required":true},"rpId":{"type":"string","description":"Relaying party ID. Domain","required":false},"token":{"type":"boolean","description":"If true response will contain the user auth token","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["challenge","rawId","clientDataJSON","authenticatorData","signature"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"response":{"type":"object","description":"Auth data","properties":{"authenticated":{"type":"boolean","description":"Authentication status","required":true},"credential":{"type":"string","description":"WebAuthN credential ID","required":true}},"required":["authenticated","credential"]},"token":{"type":"string","description":"User auth token","required":false}},"required":["success","response"]}}}}}}},"/users/:user/updates":{"get":{"tags":["Users"],"summary":"Open change stream","description":"This api call returns an EventSource response. Listen on this stream to get notifications about changes in messages and mailboxes. Returned events are JSON encoded strings","operationId":"getusersuserupdates","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"Last-Event-ID","in":"query","description":"Last event ID header as query param","required":false,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"text/event-stream":{"schema":{"type":"string","required":false}}}}}}},"/preauth":{"post":{"tags":["Authentication"],"summary":"Pre-auth check","description":"Check if an username exists and can be used for authentication","operationId":"postpreauth","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"oneOf":[{"type":"string","required":false},{"type":"string","required":false}],"description":"Username or E-mail address"},"scope":{"type":"string","description":"Required scope. One of master, imap, smtp, pop3","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["username"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"username":{"type":"string","description":"Username of authenticated User","required":true},"scope":{"type":"string","description":"The scope this authentication is valid for","required":true},"require2fa":{"type":"array","items":{"type":"string","required":false},"description":"List of enabled 2FA mechanisms"}},"required":["success","id","username","scope","require2fa"]}}}}}}},"/authenticate":{"post":{"tags":["Authentication"],"summary":"Authenticate a User","operationId":"postauthenticate","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"oneOf":[{"type":"string","required":false},{"type":"string","required":false}],"description":"Username or E-mail address"},"password":{"type":"string","description":"Password","required":true},"protocol":{"type":"string","description":"Application identifier for security logs","required":false},"scope":{"type":"string","description":"Required scope. One of master, imap, smtp, pop3","required":false},"appId":{"type":"string","description":"Optional appId which is the URL of the app","required":false},"token":{"type":"boolean","description":"If true then generates a temporary access token that is valid for this user. Only available if scope is \"master\". When using user tokens then you can replace user ID in URLs with \"me\".","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["username","password"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"username":{"type":"string","description":"Username of authenticated User","required":true},"scope":{"type":"string","description":"The scope this authentication is valid for","required":true},"require2fa":{"type":"array","items":{"type":"string","required":false},"description":"List of enabled 2FA mechanisms"},"requirePasswordChange":{"type":"boolean","description":"Indicates if account hassword has been reset and should be replaced","required":true},"token":{"type":"string","description":"If access token was requested then this is the value to use as access token when making API requests on behalf of logged in user.","required":false}},"required":["success","id","username","scope","require2fa","requirePasswordChange"]}}}}}},"delete":{"tags":["Authentication"],"summary":"Invalidate authentication token","description":"This method invalidates currently used authentication token. If token is not provided then nothing happens","operationId":"deleteauthenticate","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/authlog":{"get":{"tags":["Authentication"],"summary":"List authentication Events","operationId":"authlog","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"action","in":"query","description":"Limit listing only to values with specific action value","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"filterip","in":"query","description":"Limit listing only to values with specific IP address","required":false,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"action":{"type":"string","description":"Limit listing only to values with specific action value","required":true},"total":{"type":"number","description":"How many results were found","required":true},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true},"previousCursor":{"type":"string","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"},"nextCursor":{"type":"string","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetAuthlogResult"}}},"required":["success","action","total","page","results"]}}}}}}},"/users/:user/authlog/:event":{"get":{"tags":["Authentication"],"summary":"Request Event information","operationId":"getusersuserauthlogevent","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"event","in":"path","description":"ID of the Event","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID of the event","required":true},"action":{"type":"string","description":"Action identifier","required":true},"result":{"type":"string","description":"Did the action succeed","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false},"created":{"type":"string","description":"Datestring of the Event time","required":true,"format":"date-time"},"protocol":{"type":"string","description":"Protocol that the authentication was made from","required":false},"requiredScope":{"type":"string","description":"Scope of the auth","required":false},"last":{"type":"string","description":"Date of the last update of Event","required":true,"format":"date-time"},"events":{"type":"number","description":"Number of times same auth Event has accured","required":true},"source":{"type":"string","description":"Source of auth. Example: `master` if password auth was used","required":false},"expires":{"type":"string","description":"After this date the given auth Event will not be updated and instead a new one will be created","required":true,"format":"date-time"}},"required":["id","action","result","created","last","events","expires"]}}}}}}},"/users/:user/autoreply":{"put":{"tags":["Autoreplies"],"summary":"Update Autoreply information","operationId":"putusersuserautoreply","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Is the autoreply enabled (true) or not (false)","required":false},"name":{"type":"string","description":"Name that is used for the From: header in autoreply message","required":false,"enum":[""]},"subject":{"type":"string","description":"Subject line for the autoreply. If empty then uses subject of the original message","required":false,"enum":[""]},"text":{"type":"string","description":"Plaintext formatted content of the autoreply message","required":false,"enum":[""]},"html":{"type":"string","description":"HTML formatted content of the autoreply message","required":false,"enum":[""]},"start":{"type":"string","description":"Datestring of the start of the autoreply or boolean false to disable start checks","required":false,"format":"date-time","enum":[false]},"end":{"type":"string","description":"Datestring of the end of the autoreply or boolean false to disable end checks","required":false,"format":"date-time","enum":[false]},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Autoreply ID","required":true}},"required":["success","id"]}}}}}},"get":{"tags":["Autoreplies"],"summary":"Request Autoreply information","operationId":"getusersuserautoreply","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"status":{"type":"boolean","description":"Is the autoreply enabled (true) or not (false)","required":false},"name":{"type":"string","description":"Name that is used for the From: header in autoreply message","required":false,"enum":[""]},"subject":{"type":"string","description":"Subject line for the autoreply. If empty then uses subject of the original message","required":false,"enum":[""]},"text":{"type":"string","description":"Plaintext formatted content of the autoreply message","required":false,"enum":[""]},"html":{"type":"string","description":"HTML formatted content of the autoreply message","required":false,"enum":[""]},"start":{"type":"string","description":"Datestring of the start of the autoreply or boolean false to disable start checks","required":false,"format":"date-time","enum":[false]},"end":{"type":"string","description":"Datestring of the end of the autoreply or boolean false to disable end checks","required":false,"format":"date-time","enum":[false]},"created":{"type":"string","description":"Datestring of when the Autoreply was created","required":true,"format":"date-time"}},"required":["success","created"]}}}}}},"delete":{"tags":["Autoreplies"],"summary":"Delete Autoreply information","operationId":"deleteusersuserautoreply","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/submit":{"post":{"tags":["Submission"],"summary":"Submit a Message for Delivery","description":"Use this method to send emails from a user account","operationId":"send","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mailbox":{"type":"string","description":"ID of the Mailbox","required":false},"from":{"$ref":"#/components/schemas/AddressOptionalName"},"replyTo":{"$ref":"#/components/schemas/AddressOptionalName"},"to":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the To: header"},"cc":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the Cc: header"},"bcc":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the Bcc: header"},"headers":{"type":"array","items":{"$ref":"#/components/schemas/Header"},"description":"Custom headers for the message. If reference message is set then In-Reply-To and References headers are set automatically"},"subject":{"type":"string","description":"Message subject. If not then resolved from Reference message","required":false},"text":{"type":"string","description":"Plaintext message","required":false},"html":{"type":"string","description":"HTML formatted message","required":false},"attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","description":"Attachment filename","required":false},"contentType":{"type":"string","description":"MIME type for the attachment file","required":false},"encoding":{"type":"string","description":"Encoding to use to store the attachments","required":false},"contentTransferEncoding":{"type":"string","description":"Transfer encoding","required":false},"contentDisposition":{"type":"string","description":"Content Disposition","required":false,"enum":["inline","attachment"]},"content":{"type":"string","description":"Base64 encoded attachment content","required":true},"cid":{"type":"string","description":"Content-ID value if you want to reference to this attachment from HTML formatted message","required":false}},"required":["content"]},"description":"Attachments for the message"},"meta":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false},"reference":{"$ref":"#/components/schemas/Reference"},"isDraft":{"type":"boolean","description":"Is the message a draft or not","required":false},"draft":{"type":"object","description":"Draft message to base this one on","properties":{"mailbox":{"type":"string","description":"ID of the Mailbox","required":true},"id":{"type":"number","description":"Message ID","required":true}},"required":["mailbox","id"]},"sendTime":{"type":"string","description":"Send time","required":false,"format":"date-time"},"uploadOnly":{"type":"boolean","description":"If true only uploads the message but does not send it","required":false},"envelope":{"type":"object","description":"Optional envelope","properties":{"from":{"$ref":"#/components/schemas/AddressOptionalName"},"to":{"type":"array","items":{"type":"object","description":"Addresses for the To: header","properties":{"name":{"type":"string","description":"Name of the sender","required":false},"address":{"type":"string","description":"Address of the sender","required":true}},"required":["address"]}}},"required":[]}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"message":{"$ref":"#/components/schemas/MessageWithQueueId"}},"required":["success","message"]}}}}}}},"/audit":{"post":{"tags":["Audit"],"summary":"Create new audit","description":"Initiates a message audit","operationId":"postaudit","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"start":{"type":"string","description":"Start time as ISO date","required":false,"format":"date-time","enum":[false]},"end":{"type":"string","description":"End time as ISO date","required":false,"format":"date-time","enum":[false]},"expires":{"type":"string","description":"Expiration date. Audit data is deleted after this date","required":true,"format":"date-time"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["user","expires"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID for the created Audit","required":true}},"required":["success","id"]}}}}}}},"/audit/:audit":{"get":{"tags":["Audit"],"summary":"Request Audit Info","description":"This method returns information about stored audit","operationId":"getauditaudit","parameters":[{"name":"audit","in":"path","description":"ID of the Audit","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Audit","required":true},"user":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"start":{"type":"string","description":"Start time as ISO date","required":false,"format":"date-time","enum":[false]},"end":{"type":"string","description":"End time as ISO date","required":false,"format":"date-time","enum":[false]},"expires":{"type":"string","description":"Expiration date. Audit data is deleted after this date","required":true,"format":"date-time"},"import":{"type":"object","description":"Audit import data","properties":{"status":{"type":"string","description":"Status of the audit","required":true},"failed":{"type":"number","description":"How many messages failed","required":true},"copied":{"type":"number","description":"How many messages copied","required":true}},"required":["status","failed","copied"]}},"required":["success","id","user","expires","import"]}}}}}}},"/audit/:audit/export.mbox":{"get":{"tags":["Audit"],"summary":"Export Audited Emails","description":"This method returns a mailbox file that contains all audited emails","operationId":"getauditauditexportmbox","parameters":[{"name":"audit","in":"path","description":"ID of the Audit","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/octet-stream":{"schema":{"type":"string","required":false,"format":"binary"}}}}}}},"/domainaliases":{"get":{"tags":["DomainAliases"],"summary":"List registered Domain Aliases","operationId":"domainaliases","parameters":[{"name":"query","in":"query","description":"Partial match of a Domain Alias or Domain name","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetDomainAliasesResult"},"description":"Aliases listing"}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}},"post":{"tags":["DomainAliases"],"summary":"Create new Domain Alias","description":"Add a new Alias for a Domain. This allows to accept mail on username@domain and username@alias","operationId":"postdomainaliases","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"alias":{"type":"string","description":"Domain Alias","required":true},"domain":{"type":"string","description":"Domain name this Alias applies to","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["alias","domain"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Domain Alias","required":true}},"required":["success","id"]}}}}}}},"/domainaliases/resolve/:alias":{"get":{"tags":["DomainAliases"],"summary":"Resolve ID for a domain alias","operationId":"getdomainaliasesresolvealias","parameters":[{"name":"alias","in":"path","description":"Alias domain","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Unique ID (24 byte hex)","required":true}},"required":["success","id"]}}}}}}},"/domainaliases/:alias":{"get":{"tags":["DomainAliases"],"summary":"Request Alias information","operationId":"getdomainaliasesalias","parameters":[{"name":"alias","in":"path","description":"ID of the Alias","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Alias","required":true},"alias":{"type":"string","description":"Alias domain","required":true},"domain":{"type":"string","description":"Alias target","required":true},"created":{"type":"string","description":"Datestring of the time the alias was created","required":true,"format":"date-time"}},"required":["success","id","alias","domain","created"]}}}}}},"delete":{"tags":["DomainAliases"],"summary":"Delete an Alias","operationId":"deletedomainaliasesalias","parameters":[{"name":"alias","in":"path","description":"ID of the Alias","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/dkim":{"get":{"tags":["DKIM"],"summary":"List registered DKIM keys","operationId":"dkim","parameters":[{"name":"query","in":"query","description":"Partial match of a Domain name","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"query":{"type":"string","description":"Query string. Partial match of a Domain name","required":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetDkimKeysResult"},"description":"DKIM listing"}},"required":["success","total","page","previousCursor","nextCursor","query","results"]}}}}}},"post":{"tags":["DKIM"],"summary":"Create or update DKIM key for domain","description":"Add a new DKIM key for a Domain or update existing one. There can be single DKIM key registered for each domain name.","operationId":"postdkim","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain name this DKIM key applies to. Use \"*\" as a special value that will be used for domains that do not have their own DKIM key set","required":true},"selector":{"type":"string","description":"Selector for the key","required":true},"privateKey":{"oneOf":[{"type":"string","description":"PEM format RSA or ED25519 string","required":false},{"type":"string","description":"Raw ED25519 key 44 bytes long if using base64","required":false}],"description":"Pem formatted DKIM private key, raw ED25519 is also allowed. If not set then a new 2048 bit RSA key is generated, beware though that it can take several seconds to complete."},"description":{"type":"string","description":"Key description","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["domain","selector"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the DKIM","required":true},"domain":{"type":"string","description":"The domain this DKIM key applies to","required":true},"selector":{"type":"string","description":"DKIM selector","required":true},"description":{"type":"string","description":"Key description","required":true},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true},"publicKey":{"type":"string","description":"Public key in DNS format (no prefix/suffix, single line)","required":true},"dnsTxt":{"$ref":"#/components/schemas/DnsTxt"}},"required":["success","id","domain","selector","description","fingerprint","publicKey","dnsTxt"]}}}}}}},"/dkim/resolve/:domain":{"get":{"tags":["DKIM"],"summary":"Resolve ID for a DKIM domain","operationId":"getdkimresolvedomain","parameters":[{"name":"domain","in":"path","description":"DKIM domain","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"DKIM unique ID (24 byte hex)","required":true,"example":"609d201236d1d936948f23b1"}},"required":["success","id"]}}}}}}},"/dkim/:dkim":{"get":{"tags":["DKIM"],"summary":"Request DKIM information","operationId":"getdkimdkim","parameters":[{"name":"dkim","in":"path","description":"ID of the DKIM","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the DKIM","required":true},"domain":{"type":"string","description":"The domain this DKIM key applies to","required":true},"selector":{"type":"string","description":"DKIM selector","required":true},"description":{"type":"string","description":"Key description","required":true},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true},"publicKey":{"type":"string","description":"Public key in DNS format (no prefix/suffix, single line)","required":true},"dnsTxt":{"$ref":"#/components/schemas/DnsTxt"},"created":{"type":"string","description":"DKIM created datestring","required":true,"format":"date-time"}},"required":["success","id","domain","selector","description","fingerprint","publicKey","dnsTxt","created"]}}}}}},"delete":{"tags":["DKIM"],"summary":"Delete a DKIM key","operationId":"deletedkimdkim","parameters":[{"name":"dkim","in":"path","description":"ID of the DKIM","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/certs":{"get":{"tags":["Certs"],"summary":"List registered TLS certificates","operationId":"cert","parameters":[{"name":"query","in":"query","description":"Partial match of a server name","required":false,"schema":{"type":"string","example":"example.com"}},{"name":"altNames","in":"query","description":"Match `query` value against SAN as well (including wildcard names)","required":false,"schema":{"type":"boolean","example":"true"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"query":{"type":"string","description":"Initial query","required":false},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetTLSCertResult"}}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}},"post":{"tags":["Certs"],"summary":"Create or update TLS certificate for server name","description":"Add a new TLS certificate for a server name or update existing one. You can add a single certificate for each server name but SAN names are supported as well. For example you can add a sertificate for \"mydomain.com\" that includes \"*.mydomain.com\" in SAN and the same certificate would be used for requests that do not have it's own server name registered but match the SAN value.\n> NB! you must ensure yourself that the `servername` value is actually listed in certificate's common name or SAN as WildDuck is going to use this certificate regardless.","operationId":"postcerts","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"servername":{"type":"string","description":"Server name this TLS certificate applies to","required":true},"privateKey":{"type":"string","description":"PEM formatted TLS private key. Optional if certificate is managed by ACME","required":false},"cert":{"type":"string","description":"PEM formatted TLS certificate or a certificate bundle with concatenated certificate and CA chain. Optional if certificate is managed by ACME","required":false},"ca":{"type":"array","items":{"type":"string","required":false},"description":"CA chain certificates. Not needed if `cert` value is a bundle"},"description":{"type":"string","description":"Certificate description","required":false},"acme":{"type":"boolean","description":"If true then private key and certificate are managed automatically by ACME","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["servername"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the certificate","required":true,"example":"609d201236d1d936948f23b1"},"servername":{"type":"string","description":"The server name this certificate applies to","required":true,"example":"imap.example.com"},"description":{"type":"string","description":"Key description","required":true,"example":"Some notes about this certificate"},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true,"example":"59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3"},"expires":{"type":"string","description":"Certificate expiration time","required":true,"format":"date-time","example":"2024-06-26T21:55:55.000Z"},"altNames":{"type":"array","items":{"type":"string","required":true},"description":"SAN servernames listed in the certificate"},"acme":{"type":"boolean","description":"If true then private key and certificate are managed automatically by ACME","required":true}},"required":["success","id","servername","description","fingerprint","expires","altNames","acme"]}}}}}}},"/certs/resolve/:servername":{"get":{"tags":["Certs"],"summary":"Resolve ID for a server name","operationId":"getcertsresolveservername","parameters":[{"name":"servername","in":"path","description":"Server name","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Unique ID of the cert (24 byte hex)","required":true,"example":"609d201236d1d936948f23b1"}},"required":["success","id"]}}}}}}},"/certs/:cert":{"get":{"tags":["Certs"],"summary":"Request TLS certificate information","operationId":"getcertscert","parameters":[{"name":"cert","in":"path","description":"ID of the TLS certificate","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the certificate","required":true,"example":"609d201236d1d936948f23b1"},"servername":{"type":"string","description":"The server name this certificate applies to","required":true,"example":"imap.example.com"},"description":{"type":"string","description":"Key description","required":true,"example":"Some notes about this certificate"},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true,"example":"59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3"},"expires":{"type":"string","description":"Certificate expiration time","required":true,"format":"date-time","example":"2024-06-26T21:55:55.000Z"},"created":{"type":"string","description":"Created datestring","required":true,"format":"date-time","example":"2024-05-13T20:06:46.179Z"},"autogenerated":{"type":"boolean","description":"Was the certificate automatically generated on SNI request","required":false},"altNames":{"type":"array","items":{"type":"string","required":true},"description":"SAN servernames listed in the certificate"},"acme":{"type":"boolean","description":"If true then private key and certificate are managed automatically by ACME","required":true},"hasCert":{"type":"boolean","description":"True if certificate actually has the certificate or private key","required":true}},"required":["success","id","servername","description","fingerprint","expires","created","altNames","acme","hasCert"]}}}}}},"delete":{"tags":["Certs"],"summary":"Delete a TLS certificate","operationId":"deletecertscert","parameters":[{"name":"cert","in":"path","description":"ID of the TLS certificate","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List registered Webhooks","operationId":"webhooks","parameters":[{"name":"type","in":"query","description":"Prefix or exact match. Prefix match must end with \".*\", eg \"channel.*\". Use \"*\" for all types","required":false,"schema":{"type":"string"}},{"name":"user","in":"query","description":"User ID","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetWebhooksResult"},"description":"Webhook listing"}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}},"post":{"tags":["Webhooks"],"summary":"Create new Webhook","operationId":"postwebhooks","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"array","items":{"type":"string","required":false},"description":"An array of event types to match. For prefix match use \".*\" at the end (eg. \"user.*\") or \"*\" for all types"},"user":{"type":"string","description":"User ID to match (only makes sense for user specific resources)","required":false},"url":{"type":"string","description":"URL to POST data to","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["type","url"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Webhook","required":true}},"required":["success","id"]}}}}}}},"/webhooks/:webhook":{"delete":{"tags":["Webhooks"],"summary":"Delete a webhook","operationId":"deletewebhookswebhook","parameters":[{"name":"webhook","in":"path","description":"ID of the Webhook","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/settings":{"get":{"tags":["Settings"],"summary":"List registered Settings","operationId":"settings","parameters":[{"name":"filter","in":"query","description":"Optional partial match of the Setting key","required":false,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"filter":{"type":"string","description":"Partial match if requested","required":false},"settings":{"type":"array","items":{"$ref":"#/components/schemas/GetSettingsResult"},"description":"Setting listing"}},"required":["success","settings"]}}}}}}},"/settings/:key":{"post":{"tags":["Settings"],"summary":"Create or Update Setting","description":"Create a new or update an existing setting","operationId":"postsettingskey","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"object","description":"Setting value","required":true,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["value"]}}},"required":true},"parameters":[{"name":"key","in":"path","description":"Key of the Setting","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"key":{"type":"string","description":"Key of the Setting","required":true}},"required":["success","key"]}}}}}},"get":{"tags":["Settings"],"summary":"Get Setting value","operationId":"getsettingskey","parameters":[{"name":"key","in":"path","description":"Key of the Setting","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"key":{"type":"string","description":"Key of the Setting","required":true},"value":{"oneOf":[{"type":"string","description":"Setting value","required":false},{"type":"number","description":"Setting value","required":false}],"description":"Setting value"},"error":{"type":"string","description":"Error if present","required":false,"example":"Key was not found"}},"required":["success","key"]}}}}}}},"/health":{"get":{"tags":["Health"],"summary":"Check the health of the API","description":"Check the status of the WildDuck API service, that is if db is connected and readable/writable, same for redis.","operationId":"gethealth","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}},"500":{"description":"Failed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"message":{"type":"string","description":"Error message specifying what went wrong","required":true}},"required":["success","message"]}}}}}}}},"components":{"schemas":{"Quota":{"type":"object","description":"Quota usage limits","properties":{"allowed":{"type":"number","description":"Allowed quota of the user in bytes","required":true},"used":{"type":"number","description":"Space used in bytes","required":true}},"required":["allowed","used"]},"GetUsersResult":{"type":"object","properties":{"id":{"type":"string","description":"Users unique ID (24byte hex)","required":true},"username":{"type":"string","description":"Username of the User","required":true},"name":{"type":"string","description":"Name of the User","required":true},"address":{"type":"string","description":"Main email address of the User","required":true},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the User"},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets"},"enabled2fa":{"type":"array","items":{"type":"string","required":false},"description":"List of enabled 2FA methods"},"autoreply":{"type":"boolean","description":"Is autoreply enabled or not (start time may still be in the future or end time in the past)","required":true},"encryptMessages":{"type":"boolean","description":"If true then received messages are encrypted","required":true},"encryptForwarded":{"type":"boolean","description":"If true then forwarded messages are encrypted","required":true},"quota":{"$ref":"#/components/schemas/Quota"},"metaData":{"type":"object","description":"Custom metadata value. Included if metaData query argument was true","properties":{},"required":[]},"internalData":{"type":"object","description":"Custom metadata value for internal use. Included if internalData query argument was true and request was not made using user-role token","properties":{},"required":[]},"hasPasswordSet":{"type":"boolean","description":"If true then the User has a password set and can authenticate","required":true},"activated":{"type":"boolean","description":"Is the account activated","required":true},"disabled":{"type":"boolean","description":"If true then user can not authenticate or receive any new mail","required":true},"suspended":{"type":"boolean","description":"If true then user can not authenticate","required":true}},"required":["id","username","name","address","tags","targets","enabled2fa","autoreply","encryptMessages","encryptForwarded","hasPasswordSet","activated","disabled","suspended"]},"Mailboxes":{"type":"object","description":"Optional names for special mailboxes","properties":{"sent":{"type":"string","required":false},"trash":{"type":"string","required":false},"junk":{"type":"string","required":false},"drafts":{"type":"string","required":false}},"required":[]},"KeyInfo":{"type":"object","description":"Information about public key or false if key is not available","properties":{"name":{"type":"string","description":"Name listed in public key","required":true},"address":{"type":"string","description":"E-mail address listed in public key","required":true},"fingerprint":{"type":"string","description":"Fingerprint of the public key","required":true}},"required":["name","address","fingerprint"]},"Recipients":{"type":"object","description":"Sending quota","properties":{"allowed":{"type":"number","description":"How many messages per 24 hours can be send","required":true},"used":{"type":"number","description":"How many messages are sent during current 24 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 24 hour period","required":true}},"required":["allowed","used","ttl"]},"Filters":{"type":"object","description":"Sending quota","properties":{"allowed":{"type":"number","description":"How many filters are allowed","required":true},"used":{"type":"number","description":"How many filters have been created","required":true}},"required":["allowed","used"]},"Forwards":{"type":"object","description":"Forwarding quota","properties":{"allowed":{"type":"number","description":"How many messages per 24 hours can be forwarded","required":true},"used":{"type":"number","description":"How many messages are forwarded during current 24 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 24 hour period","required":true}},"required":["allowed","used","ttl"]},"Received":{"type":"object","description":"Receiving quota","properties":{"allowed":{"type":"number","description":"How many messages per 1 hour can be received","required":true},"used":{"type":"number","description":"How many messages are received during current 1 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 1 hour period","required":true}},"required":["allowed","used","ttl"]},"ImapUpload":{"type":"object","description":"IMAP upload quota","properties":{"allowed":{"type":"number","description":"How many bytes per 24 hours can be uploaded via IMAP. Only message contents are counted, not protocol overhead.","required":true},"used":{"type":"number","description":"How many bytes are uploaded during current 24 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 24 hour period","required":true}},"required":["allowed","used","ttl"]},"ImapDownload":{"type":"object","description":"IMAP download quota","properties":{"allowed":{"type":"number","description":"How many bytes per 24 hours can be downloaded via IMAP. Only message contents are counted, not protocol overhead.","required":true},"used":{"type":"number","description":"How many bytes are downloaded during current 24 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 24 hour period","required":true}},"required":["allowed","used","ttl"]},"Pop3Download":{"type":"object","description":"POP3 download quota","properties":{"allowed":{"type":"number","description":"How many bytes per 24 hours can be downloaded via POP3. Only message contents are counted, not protocol overhead.","required":true},"used":{"type":"number","description":"How many bytes are downloaded during current 24 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 24 hour period","required":true}},"required":["allowed","used","ttl"]},"ImapMaxConnections":{"type":"object","description":"a","properties":{"allowed":{"type":"number","description":"How many parallel IMAP connections are permitted","required":true},"used":{"type":"number","description":"How many parallel IMAP connections are currenlty in use","required":true}},"required":["allowed","used"]},"UserLimits":{"type":"object","description":"Account limits and usage","properties":{"quota":{"$ref":"#/components/schemas/Quota"},"recipients":{"$ref":"#/components/schemas/Recipients"},"filters":{"$ref":"#/components/schemas/Filters"},"forwards":{"$ref":"#/components/schemas/Forwards"},"received":{"$ref":"#/components/schemas/Received"},"imapUpload":{"$ref":"#/components/schemas/ImapUpload"},"imapDownload":{"$ref":"#/components/schemas/ImapDownload"},"pop3Download":{"$ref":"#/components/schemas/Pop3Download"},"imapMaxConnections":{"$ref":"#/components/schemas/ImapMaxConnections"}},"required":["recipients","filters","forwards","received","imapUpload","imapDownload","pop3Download"]},"GetAddressesResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Address","required":true},"name":{"type":"string","description":"Identity name","required":true},"address":{"type":"string","description":"E-mail address string","required":true},"user":{"type":"string","description":"User ID this address belongs to if this is a User address","required":true},"forwarded":{"type":"boolean","description":"If true then it is a forwarded address","required":true},"forwardedDisabled":{"type":"boolean","description":"If true then the forwarded address is disabled","required":true},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the Address"},"metaData":{"type":"object","description":"Metadata object (if available)","properties":{},"required":[]},"internalData":{"type":"object","description":"Internal metadata object (if available), not included for user-role requests","properties":{},"required":[]}},"required":["id","name","address","user","forwarded","forwardedDisabled","tags"]},"GetUserAddressesResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Address","required":true},"name":{"type":"string","description":"Identity name","required":true},"address":{"type":"string","description":"E-mail Address","required":true},"main":{"type":"boolean","description":"Indicates if this is the default address for the User","required":true},"created":{"type":"string","description":"Datestring of the time the address was created","required":true,"format":"date-time"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the Address"},"metaData":{"type":"object","description":"Metadata object (if available)","properties":{},"required":[]},"internalData":{"type":"object","description":"Internal metadata object (if available), not included for user-role requests","properties":{},"required":[]}},"required":["id","name","address","main","created","tags"]},"GetUserAddressesregisterResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Address","required":true},"name":{"type":"string","description":"Name from address header","required":false},"address":{"type":"string","description":"E-mail Address","required":true}},"required":["id","address"]},"Autoreply":{"type":"object","description":"Autoreply information","properties":{"status":{"type":"boolean","description":"If true, then autoreply is enabled for this address","required":false},"start":{"type":"string","description":"Either a date string or boolean false to disable start time checks","required":false,"format":"date-time","enum":[false]},"end":{"type":"string","description":"Either a date string or boolean false to disable end time checks","required":false,"format":"date-time","enum":[false]},"name":{"type":"string","description":"Name that is used for the From: header in autoreply message","required":false},"subject":{"type":"string","description":"Autoreply subject line","required":false},"text":{"type":"string","description":"Autoreply plaintext content","required":false},"html":{"type":"string","description":"Autoreply HTML content","required":false}},"required":[]},"AddressLimits":{"type":"object","description":"Account limits and usage","properties":{"forwards":{"$ref":"#/components/schemas/Forwards"}},"required":["forwards"]},"AutoreplyInfo":{"type":"object","description":"Autoreply information","properties":{"status":{"type":"boolean","description":"If true, then autoreply is enabled for this address","required":true},"name":{"type":"string","description":"Name that is used for the From: header in autoreply message","required":true},"subject":{"type":"string","description":"Autoreply subject line","required":true},"text":{"type":"string","description":"Autoreply plaintext content","required":true},"html":{"type":"string","description":"Autoreply HTML content","required":true}},"required":["status","name","subject","text","html"]},"Address":{"type":"object","properties":{"name":{"type":"string","description":"Name of the sender/recipient","required":true},"address":{"type":"string","description":"Address of the sender/recipient","required":true}},"required":["name","address"]},"ReferenceWithAttachments":{"type":"object","properties":{"mailbox":{"type":"string","description":"ID of the Mailbox","required":true},"id":{"type":"number","description":"Message ID","required":true},"action":{"type":"string","description":"Either reply, replyAll or forward","required":true,"enum":["reply","replyAll","forward"]},"attachments":{"oneOf":[{"type":"boolean","required":false},{"type":"array","items":{"type":"string","required":false}}],"description":"If true, then includes all attachments from the original message. If it is an array of attachment ID's includes attachments from the list"}},"required":["mailbox","id","action"]},"Bimi":{"type":"object","description":"Marks BIMI verification as passed for a domain. NB! BIMI record and logo files for the domain must be valid.","properties":{"domain":{"type":"string","description":"Domain name for the BIMI record. It does not have to be the same as the From address.","required":true},"selector":{"type":"string","description":"Optional BIMI selector","required":false}},"required":["domain"]},"ContentType":{"type":"object","description":"Parsed Content-Type header. Usually needed to identify encrypted messages and such","properties":{"value":{"type":"string","description":"MIME type of the message, eg. \"multipart/mixed\"","required":true},"params":{"type":"object","description":"An object with Content-Type params as key-value pairs","properties":{},"required":[]}},"required":["value","params"]},"GetMessagesResult":{"type":"object","properties":{"id":{"type":"number","description":"ID of the Message","required":true},"mailbox":{"type":"string","description":"ID of the Mailbox","required":true},"thread":{"type":"string","description":"ID of the Thread","required":true},"threadMessageCount":{"type":"number","description":"Amount of messages in the Thread. Included if threadCounters query argument was true","required":false},"from":{"$ref":"#/components/schemas/Address"},"to":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"Recipients in To: field"},"cc":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"Recipients in Cc: field"},"bcc":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"Recipients in Bcc: field. Usually only available for drafts"},"messageId":{"type":"string","description":"Message ID","required":true},"subject":{"type":"string","description":"Message subject","required":true},"date":{"type":"string","description":"Date string from header","required":true,"format":"date-time"},"idate":{"type":"string","description":"Date string of receive time","required":false,"format":"date-time"},"intro":{"type":"string","description":"First 128 bytes of the message","required":true},"attachments":{"type":"boolean","description":"Does the message have attachments","required":true},"size":{"type":"number","description":"Message size in bytes","required":true},"seen":{"type":"boolean","description":"Is this message alread seen or not","required":true},"deleted":{"type":"boolean","description":"Does this message have a Deleted flag (should not have as messages are automatically deleted once this flag is set)","required":true},"flagged":{"type":"boolean","description":"Does this message have a Flagged flag","required":true},"draft":{"type":"boolean","description":"is this message a draft","required":true},"answered":{"type":"boolean","description":"Does this message have a Answered flag","required":true},"forwarded":{"type":"boolean","description":"Does this message have a $Forwarded flag","required":true},"references":{"type":"array","items":{"$ref":"#/components/schemas/ReferenceWithAttachments"},"description":"References"},"bimi":{"$ref":"#/components/schemas/Bimi"},"contentType":{"$ref":"#/components/schemas/ContentType"},"encrypted":{"type":"boolean","description":"Specifies whether the message is encrypted","required":false},"metaData":{"type":"object","description":"Custom metadata value. Included if metaData query argument was true","properties":{},"required":[]},"headers":{"type":"object","description":"Header object keys requested with the includeHeaders argument","properties":{},"required":[]}},"required":["id","mailbox","thread","to","cc","bcc","messageId","subject","date","intro","attachments","size","seen","deleted","flagged","draft","answered","forwarded","references","bimi","contentType"]},"AddressOptionalName":{"type":"object","description":"Addres for the From: header","properties":{"name":{"type":"string","description":"Name of the sender","required":false},"address":{"type":"string","description":"Address of the sender","required":true}},"required":["address"]},"Header":{"type":"object","properties":{"key":{"type":"string","description":"Header key ('X-Mailer')","required":false},"value":{"type":"string","description":"Header value ('My Awesome Mailing Service')","required":false}},"required":[]},"Attachment":{"type":"object","properties":{"filename":{"type":"string","description":"Attachment filename","required":false},"contentType":{"type":"string","description":"MIME type for the attachment file","required":false},"encoding":{"type":"string","description":"Encoding to use to store the attachments","required":false},"contentTransferEncoding":{"type":"string","description":"Transfer encoding","required":false},"content":{"type":"string","description":"Base64 encoded attachment content","required":true},"cid":{"type":"string","description":"Content-ID value if you want to reference to this attachment from HTML formatted message","required":false},"contentDisposition":{"type":"string","description":"Content Disposition","required":false,"enum":["inline","attachment"]}},"required":["content"]},"Rcpt":{"type":"object","properties":{"value":{"type":"string","description":"RCPT TO address as provided by SMTP client","required":true},"formatted":{"type":"string","description":"Normalized RCPT address","required":true}},"required":["value","formatted"]},"Envelope":{"type":"object","description":"SMTP envelope (if available)","properties":{"from":{"type":"string","description":"Address from MAIL FROM","required":true},"rcpt":{"type":"array","items":{"$ref":"#/components/schemas/Rcpt"},"description":"Array of addresses from RCPT TO (should have just one normally)"}},"required":["from"]},"List":{"type":"object","description":"If set then this message is from a mailing list","properties":{"id":{"type":"string","description":"Value from List-ID header","required":true},"unsubscribe":{"type":"string","description":"Value from List-Unsubscribe header","required":true}},"required":["id","unsubscribe"]},"Tls":{"type":"object","description":"TLS information. Value is false if TLS was not used","properties":{"name":{"type":"object","description":"Cipher name, eg \"ECDHE-RSA-AES128-GCM-SHA256\"","properties":{},"required":[]},"version":{"type":"object","description":"TLS version, eg \"TLSv1/SSLv3\"","properties":{},"required":[]}},"required":["name","version"]},"Forwarded":{"type":"object","properties":{"seq":{"type":"string","description":"Sequence ID","required":true},"type":{"type":"string","description":"Target type","required":true},"value":{"type":"string","description":"Target address","required":true}},"required":["seq","type","value"]},"Message":{"type":"object","description":"Message information","properties":{"id":{"type":"number","description":"Message ID in mailbox","required":true},"mailbox":{"type":"string","description":"Mailbox ID the message was stored into","required":true},"size":{"type":"number","description":"Size of the RFC822 formatted email","required":true}},"required":["id","mailbox","size"]},"GetFilesResult":{"type":"object","properties":{"id":{"type":"string","description":"File ID","required":true},"filename":{"oneOf":[{"type":"string","required":true},{"type":"boolean","required":true}],"description":"Filename. False if none"},"contentType":{"oneOf":[{"type":"string","required":true},{"type":"boolean","required":true}],"description":"Content-Type of the file. False if none"},"cid":{"type":"string","description":"Content ID","required":false},"size":{"type":"number","description":"File size","required":true},"created":{"type":"string","description":"Created datestring","required":true,"format":"date-time"},"md5":{"type":"string","description":"md5 hash","required":true}},"required":["id","filename","contentType","size","created","md5"]},"GetAllFiltersResult":{"type":"object","properties":{"id":{"type":"string","description":"Filter ID","required":true},"user":{"type":"string","description":"User ID","required":true},"name":{"type":"string","description":"Name for the filter","required":true},"created":{"type":"string","description":"Datestring of the time the filter was created","required":true,"format":"date-time"},"query":{"type":"array","items":{"type":"array","items":{"type":"string","required":false}},"description":"Filter query strings"},"action":{"type":"array","items":{"type":"array","items":{"type":"string","required":false}},"description":"Filter action strings"},"disabled":{"type":"boolean","description":"If true, then this filter is ignored","required":true},"metaData":{"type":"object","description":"Custom metadata value. Included if metaData query argument was true","properties":{},"required":[]},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets"}},"required":["id","user","name","created","query","action","disabled"]},"GetFiltersResult":{"type":"object","properties":{"id":{"type":"string","description":"Filter ID","required":true},"name":{"type":"string","description":"Name for the filter","required":true},"created":{"type":"string","description":"Datestring of the time the filter was created","required":true,"format":"date-time"},"query":{"type":"array","items":{"type":"array","items":{"type":"string","required":false}},"description":"Filter query strings"},"action":{"type":"array","items":{"type":"array","items":{"type":"string","required":false}},"description":"Filter action strings"},"disabled":{"type":"boolean","description":"If true, then this filter is ignored","required":true},"metaData":{"type":"object","description":"Custom metadata value. Included if metaData query argument was true","properties":{},"required":[]}},"required":["id","name","created","query","action","disabled"]},"Query":{"type":"object","description":"Rules that a message must match","properties":{"from":{"type":"string","description":"Partial match for the From: header (case insensitive)","required":false},"to":{"type":"string","description":"Partial match for the To:/Cc: headers (case insensitive)","required":false},"subject":{"type":"string","description":"Partial match for the Subject: header (case insensitive)","required":false},"listId":{"type":"string","description":"Partial match for the List-ID: header (case insensitive)","required":false},"text":{"type":"string","description":"Fulltext search against message text","required":false},"ha":{"type":"boolean","description":"Does a message have to have an attachment or not","required":false},"size":{"type":"number","description":"Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value","required":false}},"required":[]},"Action":{"type":"object","description":"Action to take with a matching message","properties":{"seen":{"type":"boolean","description":"If true then mark matching messages as Seen","required":false},"flag":{"type":"boolean","description":"If true then mark matching messages as Flagged","required":false},"delete":{"type":"boolean","description":"If true then do not store matching messages","required":false},"spam":{"type":"boolean","description":"If true then store matching messags to Junk Mail folder","required":false},"mailbox":{"type":"string","description":"Mailbox ID to store matching messages to","required":false},"targets":{"type":"array","items":{"type":"string","required":false},"description":"An array of forwarding targets. The value could either be an email address or a relay url to next MX server (\"smtp://mx2.zone.eu:25\") or an URL where mail contents are POSTed to"}},"required":[]},"GetAllowedDomainResult":{"type":"object","properties":{"id":{"type":"string","description":"Entry ID","required":true},"domain":{"type":"string","description":"Allowlisted domain name","required":true},"action":{"type":"string","description":"Action: `allow`","required":true,"example":"allow"}},"required":["id","domain","action"]},"GetBlockedDomainResult":{"type":"object","properties":{"id":{"type":"string","description":"Entry ID","required":true},"domain":{"type":"string","description":"Blocklisted domain name","required":true},"action":{"type":"string","description":"Action: `block`","required":true,"example":"block"}},"required":["id","domain","action"]},"LastUse":{"type":"object","description":"Information about last use","properties":{"time":{"type":"string","description":"Datestring of last use or false if password has not been used","required":true,"format":"date-time"},"event":{"type":"string","description":"Event ID of the security log for the last authentication","required":true}},"required":["time","event"]},"GetASPsResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Application Password","required":true},"description":{"type":"string","description":"Description","required":true},"scopes":{"type":"array","items":{"type":"string","required":true,"enum":["imap","pop3","smtp","*"]},"description":"Allowed scopes for the Application Password"},"lastUse":{"$ref":"#/components/schemas/LastUse"},"created":{"type":"string","description":"Datestring","required":true,"format":"date-time"},"expires":{"type":"string","description":"Application password expires after the given date","required":true,"format":"date-time"}},"required":["id","description","scopes","lastUse","created","expires"]},"GetAuthlogResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the event","required":true},"action":{"type":"string","description":"Action identifier","required":true},"result":{"type":"string","description":"Did the action succeed","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false},"created":{"type":"string","description":"Datestring of the Event time","required":true,"format":"date-time"},"protocol":{"type":"string","description":"Protocol that the authentication was made from","required":false},"requiredScope":{"type":"string","description":"Scope of the auth","required":false},"last":{"type":"string","description":"Date of the last update of data","required":true,"format":"date-time"},"events":{"type":"number","description":"Number of times same auth log has accured","required":true},"source":{"type":"string","description":"Source of auth. Example: `master` if password auth was used","required":false},"expires":{"type":"string","description":"After this date the given auth log document will not be updated and instead a new one will be created","required":true,"format":"date-time"}},"required":["id","action","result","created","last","events","expires"]},"Reference":{"type":"object","description":"Optional referenced email. If uploaded message is a reply draft and relevant fields are not provided then these are resolved from the message to be replied to","properties":{"mailbox":{"type":"string","description":"ID of the Mailbox","required":true},"id":{"type":"number","description":"Message ID","required":true},"action":{"type":"string","description":"Either reply, replyAll or forward","required":true,"enum":["reply","replyAll","forward"]}},"required":["mailbox","id","action"]},"MessageWithQueueId":{"type":"object","description":"Information about submitted Message","properties":{"mailbox":{"type":"string","description":"Mailbox ID the message was stored to","required":true},"id":{"type":"number","description":"Message ID in the Mailbox","required":true},"queueId":{"type":"string","description":"Queue ID in MTA","required":true}},"required":["mailbox","id","queueId"]},"GetDomainAliasesResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Domain Alias","required":true},"alias":{"type":"string","description":"Domain Alias","required":true},"domain":{"type":"string","description":"The domain this alias applies to","required":true}},"required":["id","alias","domain"]},"GetDkimKeysResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the DKIM","required":true},"domain":{"type":"string","description":"The domain this DKIM key applies to","required":true},"selector":{"type":"string","description":"DKIM selector","required":true},"description":{"type":"string","description":"Key description","required":true},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true},"created":{"type":"string","description":"DKIM created datestring","required":true,"format":"date-time"}},"required":["id","domain","selector","description","fingerprint","created"]},"DnsTxt":{"type":"object","description":"Value for DNS TXT entry","properties":{"name":{"type":"string","description":"Is the domain name of TXT","required":true},"value":{"type":"string","description":"Is the value of TXT","required":true}},"required":["name","value"]},"GetTLSCertResult":{"type":"object","description":"Certificate listing","properties":{"id":{"type":"string","description":"ID of the certificate","required":true,"example":"609d201236d1d936948f23b1"},"servername":{"type":"string","description":"The server name this certificate applies to","required":true,"example":"imap.example.com"},"acme":{"type":"boolean","description":"If true then private key and certificate are managed automatically by ACME","required":true},"description":{"type":"string","description":"Key description","required":true,"example":"Some notes about this certificate"},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true,"example":"59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3"},"created":{"type":"string","description":"Datestring","required":true,"format":"date-time","example":"2024-03-13T20:06:46.179Z"},"expires":{"type":"string","description":"Certificate expiration time","required":true,"format":"date-time","example":"2024-04-26T21:55:55.000Z"},"autogenerated":{"type":"boolean","description":"Was the certificate automatically generated on SNI request","required":false},"altNames":{"type":"array","items":{"type":"string","required":true},"description":"SAN servernames listed in the certificate"}},"required":["id","servername","acme","description","fingerprint","created","expires","altNames"]},"GetWebhooksResult":{"type":"object","properties":{"id":{"type":"string","description":"Webhooks unique ID (24 byte hex)","required":true},"type":{"type":"array","items":{"type":"string","required":false},"description":"An array of event types this webhook matches"},"user":{"type":"string","description":"User ID or null","required":true},"url":{"type":"string","description":"Webhook URL","required":true}},"required":["id","type","user","url"]},"GetSettingsResult":{"type":"object","properties":{"key":{"type":"string","description":"Setting key","required":true},"value":{"oneOf":[{"type":"string","description":"Setting value","required":false},{"type":"number","description":"Setting value","required":false}],"description":"Setting value"},"name":{"type":"string","description":"Setting name","required":true},"description":{"type":"string","description":"Setting description","required":true},"type":{"type":"string","description":"Value subtype","required":true},"custom":{"type":"boolean","description":"If true then the value is set","required":true}},"required":["key","value","name","description","type","custom"]}},"securitySchemes":{"AccessTokenAuth":{"name":"X-Access-Token","type":"apiKey","in":"header","description":"If authentication is enabled in the WildDuck configuration, you will need to supply an access token in the `X-Access-Token` header.\n```json\n{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}\n```\n"}}},"security":[{"AccessTokenAuth":[]}]} \ No newline at end of file +{"openapi":"3.0.0","info":{"title":"WildDuck API","description":"WildDuck API docs","contact":{"url":"https://github.com/nodemailer/wildduck"},"version":"1.45.0"},"servers":[{"url":"https://api.wildduck.email"}],"tags":[{"name":"Addresses"},{"name":"ApplicationPasswords"},{"name":"Archive","description":"Archive includes all deleted messages. Once messages are old enough then these are permanenetly deleted from the archive as well. Until then you can restore the deleted messages."},{"name":"Audit","description":"Auditing allows to monitor an email account. All existing, deleted and new emails are copied to the auditing system. See also https://github.com/nodemailer/wildduck-audit-manager"},{"name":"Authentication"},{"name":"Autoreplies"},{"name":"Certs","description":"WildDuck allows to register TLS certificates to be used with SNI connections. These certificates are used by IMAP, POP3, API and SMTP servers when a SNI capable client establishes a TLS connection. This does not apply for MX servers."},{"name":"DKIM","description":"Whenever an email is sent WildDuck checks if there is a DKIM key registered for the domain name of the sender address and uses it to sign the message."},{"name":"DomainAccess","description":"Add sender domain names to allowlist (messages are all accepted) or blocklist (messages are sent to Spam folder)"},{"name":"DomainAliases"},{"name":"Filters"},{"name":"Mailboxes"},{"name":"Messages"},{"name":"Settings"},{"name":"Storage","description":"Storage allows easier attachment handling when composing Draft messages. Instead of uploading the attachmnent with every draft update, you store the attachment to the Storage and then link stored file for the Draft."},{"name":"Submission"},{"name":"TwoFactorAuth"},{"name":"Users"},{"name":"Webhooks"}],"paths":{"/users":{"get":{"tags":["Users"],"summary":"List registered Users","operationId":"users","parameters":[{"name":"query","in":"query","description":"Partial match of username or default email address","required":false,"schema":{"type":"string"}},{"name":"forward","in":"query","description":"Partial match of a forward email address or URL","required":false,"schema":{"type":"string"}},{"name":"tags","in":"query","description":"Comma separated list of tags. The User must have at least one to be set","required":false,"schema":{"type":"string"}},{"name":"requiredTags","in":"query","description":"Comma separated list of tags. The User must have all listed tags to be set","required":false,"schema":{"type":"string"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"internalData","in":"query","description":"If true, then includes internalData in the response. Not shown for user-role tokens.","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"query":{"type":"string","description":"Partial match of username or default email address","required":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetUsersResult"},"description":"User listing"}},"required":["success","total","page","previousCursor","nextCursor","query","results"]}}}}}},"post":{"tags":["Users"],"summary":"Create new user","operationId":"postusers","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"Username of the User. Dots are allowed but informational only (\"user.name\" is the same as \"username\").","required":true},"password":{"type":"string","description":"Password for the account. Set to boolean false to disable password usage for the master scope, Application Specific Passwords would still be allowed","required":true,"enum":[false,""]},"hashedPassword":{"type":"boolean","description":"If true then password is already hashed, so store as is. Supported hashes: pbkdf2, bcrypt ($2a, $2y, $2b), md5 ($1), sha512 ($6), sha256 ($5), argon2 ($argon2d, $argon2i, $argon2id). Stored hashes are rehashed to pbkdf2 on first successful password check.","required":false},"allowUnsafe":{"type":"boolean","description":"If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.","required":false},"address":{"type":"string","description":"Default email address for the User (autogenerated if not set)","required":false},"emptyAddress":{"type":"boolean","description":"If true then do not autogenerate missing email address for the User. Only needed if you want to create a user account that does not have any email address associated","required":false},"language":{"type":"string","description":"Language code for the User","required":false},"retention":{"type":"number","description":"Default retention time (in ms). Set to 0 to disable","required":false},"name":{"type":"string","description":"Name of the User","required":false},"targets":{"type":"array","items":{"type":"string","required":false},"description":"An array of forwarding targets. The value could either be an email address or a relay url to next MX server (\"smtp://mx2.zone.eu:25\") or an URL where mail contents are POSTed to"},"spamLevel":{"type":"number","description":"Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam","required":false},"quota":{"type":"number","description":"Allowed quota of the user in bytes","required":false},"recipients":{"type":"number","description":"How many messages per 24 hour can be sent","required":false},"forwards":{"type":"number","description":"How many messages per 24 hour can be forwarded","required":false},"filters":{"type":"number","description":"How many filters are allowed for this account","required":false},"requirePasswordChange":{"type":"boolean","description":"If true then requires the user to change password, useful if password for the account was autogenerated","required":false},"imapMaxUpload":{"type":"number","description":"How many bytes can be uploaded via IMAP during 24 hour","required":false},"imapMaxDownload":{"type":"number","description":"How many bytes can be downloaded via IMAP during 24 hour","required":false},"pop3MaxDownload":{"type":"number","description":"How many bytes can be downloaded via POP3 during 24 hour","required":false},"pop3MaxMessages":{"type":"number","description":"How many latest messages to list in POP3 session","required":false},"imapMaxConnections":{"type":"number","description":"How many parallel IMAP connections are allowed","required":false},"receivedMax":{"type":"number","description":"How many messages can be received from MX during 60 seconds","required":false},"fromWhitelist":{"type":"array","items":{"type":"string","required":false},"description":"A list of additional email addresses this user can send mail from. Wildcard is allowed."},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this user"},"addTagsToAddress":{"type":"boolean","description":"If true then autogenerated address gets the same tags as the user","required":false},"uploadSentMessages":{"type":"boolean","description":"If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.","required":false},"mailboxes":{"$ref":"#/components/schemas/Mailboxes"},"disabledScopes":{"type":"array","items":{"type":"string","required":false,"enum":["imap","pop3","smtp"]},"description":"List of scopes that are disabled for this user (\"imap\", \"pop3\", \"smtp\")"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional metadata for internal use, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"pubKey":{"type":"string","description":"Public PGP key for the User that is used for encryption. Use empty string to remove the key","required":false},"encryptMessages":{"type":"boolean","description":"If true then received messages are encrypted","required":false},"encryptForwarded":{"type":"boolean","description":"If true then forwarded messages are encrypted","required":false},"featureFlags":{"type":"object","description":"Feature flags to specify","properties":{"indexing":{"type":"boolean","required":false}},"required":[]},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["username","password"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true}},"required":["success","id"]}}}}}}},"/users/resolve/:username":{"get":{"tags":["Users"],"summary":"Resolve ID for a username","operationId":"getusersresolveusername","parameters":[{"name":"username","in":"path","description":"Username of the User. Alphanumeric value. Must start with a letter, dots are allowed but informational only (\"user.name\" is the same as \"username\")","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Unique ID (24 byte hex)","required":true,"example":"609d201236d1d936948f23b1"}},"required":["success","id"]}}}}}}},"/users/:user":{"get":{"tags":["Users"],"summary":"Request User information","operationId":"getusersuser","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Users unique ID (24 byte hex)","required":true},"username":{"type":"string","description":"Username of the User","required":true},"name":{"type":"string","description":"Name of the User","required":true},"address":{"type":"string","description":"Main email address of the User","required":true},"retention":{"type":"number","description":"Default retention time (in ms). false if not enabled","required":true},"enabled2fa":{"type":"array","items":{"type":"string","required":false},"description":"List of enabled 2FA methods"},"autoreply":{"type":"boolean","description":"Is autoreply enabled or not (start time may still be in the future or end time in the past)","required":true},"encryptMessages":{"type":"boolean","description":"If true then received messages are encrypted","required":true},"encryptForwarded":{"type":"boolean","description":"If true then forwarded messages are encrypted","required":true},"pubKey":{"type":"string","description":"Public PGP key for the User that is used for encryption","required":true},"keyInfo":{"$ref":"#/components/schemas/KeyInfo"},"metaData":{"type":"object","description":"Custom metadata object set for this user","required":true,"format":"any"},"internalData":{"type":"object","description":"Custom internal metadata object set for this user. Not available for user-role tokens","properties":{},"required":[]},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets"},"spamLevel":{"type":"number","description":"Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam","required":true},"limits":{"$ref":"#/components/schemas/UserLimits"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the User"},"fromWhitelist":{"type":"array","items":{"type":"string","required":false},"description":"A list of additional email addresses this user can send mail from. Wildcard is allowed."},"disabledScopes":{"type":"array","items":{"type":"string","required":false,"enum":["imap","pop3","smtp"]},"description":"Disabled scopes for this user"},"hasPasswordSet":{"type":"boolean","description":"If true then the User has a password set and can authenticate","required":true},"activated":{"type":"boolean","description":"Is the account activated","required":true},"disabled":{"type":"boolean","description":"If true then the user can not authenticate or receive any new mail","required":true},"suspended":{"type":"boolean","description":"If true then the user can not authenticate","required":true}},"required":["success","id","username","name","address","retention","enabled2fa","autoreply","encryptMessages","encryptForwarded","pubKey","keyInfo","metaData","internalData","targets","spamLevel","limits","tags","disabledScopes","hasPasswordSet","activated","disabled","suspended"]}}}}}},"put":{"tags":["Users"],"summary":"Update User information","operationId":"putusersuser","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"existingPassword":{"type":"string","description":"If provided then validates against account password before applying any changes","required":false},"password":{"type":"string","description":"New password for the account. Set to boolean false to disable password usage for the master scope, Application Specific Passwords would still be allowed","required":false,"enum":[false,""]},"hashedPassword":{"type":"boolean","description":"If true then password is already hashed, so store as is. Supported hashes: pbkdf2, bcrypt ($2a, $2y, $2b), md5 ($1), sha512 ($6), sha256 ($5), argon2 ($argon2d, $argon2i, $argon2id). Stored hashes are rehashed to pbkdf2 on first successful password check.","required":false},"allowUnsafe":{"type":"boolean","description":"If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.","required":false},"language":{"type":"string","description":"Language code for the User","required":false},"name":{"type":"string","description":"Name of the User","required":false},"targets":{"type":"array","items":{"type":"string","required":false},"description":"An array of forwarding targets. The value could either be an email address or a relay url to next MX server (\"smtp://mx2.zone.eu:25\") or an URL where mail contents are POSTed to"},"spamLevel":{"type":"number","description":"Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam","required":false},"uploadSentMessages":{"type":"boolean","description":"If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.","required":false},"fromWhitelist":{"type":"array","items":{"type":"string","required":false},"description":"A list of additional email addresses this user can send mail from. Wildcard is allowed."},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional internal metadata, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"pubKey":{"type":"string","description":"Public PGP key for the User that is used for encryption. Use empty string to remove the key","required":false},"encryptMessages":{"type":"boolean","description":"If true then received messages are encrypted","required":false},"encryptForwarded":{"type":"boolean","description":"If true then forwarded messages are encrypted","required":false},"retention":{"type":"number","description":"Default retention time (in ms). Set to 0 to disable","required":false},"quota":{"type":"number","description":"Allowed quota of the user in bytes","required":false},"recipients":{"type":"number","description":"How many messages per 24 hour can be sent","required":false},"forwards":{"type":"number","description":"How many messages per 24 hour can be forwarded","required":false},"filters":{"type":"number","description":"How many filters are allowed for this account","required":false},"imapMaxUpload":{"type":"number","description":"How many bytes can be uploaded via IMAP during 24 hour","required":false},"imapMaxDownload":{"type":"number","description":"How many bytes can be downloaded via IMAP during 24 hour","required":false},"pop3MaxDownload":{"type":"number","description":"How many bytes can be downloaded via POP3 during 24 hour","required":false},"pop3MaxMessages":{"type":"number","description":"How many latest messages to list in POP3 session","required":false},"imapMaxConnections":{"type":"number","description":"How many parallel IMAP connections are allowed","required":false},"receivedMax":{"type":"number","description":"How many messages can be received from MX during 60 seconds","required":false},"disable2fa":{"type":"boolean","description":"If true, then disables 2FA for this user","required":false},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this user"},"disabledScopes":{"type":"array","items":{"type":"string","required":false,"enum":["imap","pop3","smtp"]},"description":"List of scopes that are disabled for this user (\"imap\", \"pop3\", \"smtp\")"},"disabled":{"type":"boolean","description":"If true then disables user account (can not login, can not receive messages)","required":false},"featureFlags":{"type":"object","description":"Enabled feature flags","properties":{"indexing":{"type":"boolean","required":false}},"required":[]},"suspended":{"type":"boolean","description":"If true then disables authentication","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"delete":{"tags":["Users"],"summary":"Delete a User","description":"This method deletes user and address entries from DB and schedules a background task to delete messages. You can call this method several times even if the user has already been deleted, in case there are still some pending messages.","operationId":"deleteusersuser","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"deleteAfter","in":"query","description":"Delete user entry from registry but keep all user data until provided date. User account is fully recoverable up to that date.","required":false,"schema":{"type":"date","enum":[false]}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"code":{"type":"string","description":"Task code. Should be TaskScheduled","required":false,"example":"TaskScheduled"},"user":{"type":"string","description":"User ID","required":false},"addresses":{"type":"object","properties":{"deleted":{"type":"number","description":"Number of deleted addresses","required":false}},"required":[]},"deleteAfter":{"type":"string","description":"Delete after date","required":false,"format":"date-time"},"task":{"type":"string","description":"Task ID","required":false}},"required":["success"]}}}}}}},"/users/:user/logout":{"put":{"tags":["Users"],"summary":"Log out User","operationId":"putusersuserlogout","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","description":"Message to be shown to connected IMAP client","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/quota/reset":{"post":{"tags":["Users"],"summary":"Recalculate User quota","description":"This method recalculates quota usage for a User. Normally not needed, only use it if quota numbers are way off. This method is not transactional, so if the user is currently receiving new messages then the resulting value is not exact.","operationId":"postusersuserquotareset","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"storageUsed":{"type":"number","description":"Calculated quota usage for the user","required":true},"previousStorageUsed":{"type":"number","description":"Previous storage used","required":true}},"required":["success","storageUsed","previousStorageUsed"]}}}}}}},"/quota/reset":{"post":{"tags":["Users"],"summary":"Recalculate Quota for all Users","description":"This method recalculates quota usage for all Users. Normally not needed, only use it if quota numbers are way off. This method is not transactional, so if the user is currently receiving new messages then the resulting value is not exact.","operationId":"postquotareset","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"task":{"type":"string","description":"Task ID","required":true}},"required":["success","task"]}}}}}}},"/data/export":{"post":{"tags":["Export"],"summary":"Export data","description":"Export data for matching users. Export dump does not include emails, only account structure (user data, password hashes, mailboxes, filters, etc.). A special \"export\"-role access token is required for exporting and importing.","operationId":"postdataexport","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"string","required":true},"description":"An array of User ID values to export"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"An array of user tags to export. If set then at least one tag must exist on an user."},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/octet-stream":{"schema":{"type":"string","required":false,"format":"binary"}}}}}}},"/data/import":{"post":{"tags":["Export"],"summary":"Import user data","description":"Import data from an export dump. If a database entry already exists, it is not modified. A special \"export\"-role access token is required for exporting and importing.","operationId":"postdataimport","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"number","description":"How many database entries were found from the export file","required":false},"imported":{"type":"number","description":"How many database entries were imported from the export file","required":false},"failed":{"type":"number","description":"How many database entries were not imported due to some error","required":false},"existing":{"type":"number","description":"How many database existing entries were not imported","required":false}},"required":[]}}}}}}},"/users/:user/password/reset":{"post":{"tags":["Users"],"summary":"Reset password for a User","description":"This method generates a new temporary password for a User. Additionally it removes all two-factor authentication settings","operationId":"postusersuserpasswordreset","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"validAfter":{"type":"string","description":"Allow using the generated password not earlier than provided time","required":false,"format":"date-time","enum":[false]},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"password":{"type":"string","description":"Temporary password","required":true},"validAfter":{"type":"string","description":"The date password is valid after","required":false,"format":"date-time"}},"required":["success","password"]}}}}}}},"/users/:user/restore":{"get":{"tags":["Users"],"summary":"Return recovery info for a deleted user","operationId":"getusersuserrestore","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"user":{"type":"string","description":"ID of the deleted User","required":true},"username":{"type":"string","description":"Username of the User","required":true},"storageUsed":{"type":"number","description":"Calculated quota usage for the user","required":true},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the User"},"deleted":{"type":"string","description":"Datestring of the time the user was deleted","required":true,"format":"date-time"},"recoverableAddresses":{"type":"array","items":{"type":"string","required":false},"description":"List of email addresses that can be restored"}},"required":["success","user","username","storageUsed","tags","deleted","recoverableAddresses"]}}}}}},"post":{"tags":["Users"],"summary":"Cancel user deletion task","description":"Use this endpoint to cancel a timed deletion task scheduled by DELETE /user/{id}. If user data is not yet deleted then the account is fully recovered, except any email addresses that might have been already recycled","operationId":"postusersuserrestore","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"code":{"type":"string","description":"Task status code","required":true},"user":{"type":"string","description":"User ID","required":false},"task":{"type":"string","description":"Existing task id","required":false},"addresses":{"type":"object","properties":{"recovered":{"type":"number","description":"Number of recovered addresses","required":false},"main":{"type":"string","description":"Main address","required":false}},"required":[]}},"required":["success","code"]}}}}}}},"/addresses":{"get":{"tags":["Addresses"],"summary":"List registered Addresses","operationId":"addresses","parameters":[{"name":"query","in":"query","description":"Partial match of an address","required":false,"schema":{"type":"string"}},{"name":"forward","in":"query","description":"Partial match of a forward email address or URL","required":false,"schema":{"type":"string"}},{"name":"tags","in":"query","description":"Comma separated list of tags. The Address must have at least one to be set","required":false,"schema":{"type":"string"}},{"name":"requiredTags","in":"query","description":"Comma separated list of tags. The Address must have all listed tags to be set","required":false,"schema":{"type":"string"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"internalData","in":"query","description":"If true, then includes internalData in the response. Not shown for user-role tokens.","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"query":{"type":"string","description":"Partial match of an address","required":true},"total":{"type":"number","description":"How many results were found","required":true},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetAddressesResult"},"description":"Address listing"}},"required":["success","query","total","page","previousCursor","nextCursor","results"]}}}}}}},"/users/:user/addresses":{"post":{"tags":["Addresses"],"summary":"Create new Address","description":"Add a new email address for a User. Addresses can contain unicode characters. Dots in usernames are normalized so no need to create both \"firstlast@example.com\" and \"first.last@example.com\" Special addresses `*@example.com`, `*suffix@example.com` and `username@*` catches all emails to these domains or users without a registered destination (requires allowWildcard argument)","operationId":"postusersuseraddresses","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"oneOf":[{"type":"string","description":"E-mail Address","required":true},{"type":"string","required":false}],"description":"E-mail Address"},"name":{"type":"string","description":"Identity name","required":false},"main":{"type":"boolean","description":"Indicates if this is the default address for the User","required":false},"allowWildcard":{"type":"boolean","description":"If true then address value can be in the form of `*@example.com`, `*suffix@example.com` and `username@*`, otherwise using * is not allowed. Static suffix can be up to 32 characters long.","required":false},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this address"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional metadata for internal use, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the address","required":true}},"required":["success","id"]}}}}}},"get":{"tags":["Addresses"],"summary":"List registered Addresses for a User","operationId":"getusersuseraddresses","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"internalData","in":"query","description":"If true, then includes internalData in the response. Not shown for user-role tokens.","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetUserAddressesResult"},"description":"Address listing"}},"required":["success","results"]}}}}}}},"/users/:user/addresses/:address":{"get":{"tags":["Addresses"],"summary":"Request Addresses information","operationId":"getusersuseraddressesaddress","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"address","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Address","required":true},"name":{"type":"string","description":"Identity name","required":true},"address":{"type":"string","description":"E-mail Address","required":true},"main":{"type":"boolean","description":"Indicates if this is the default address for the User","required":true},"created":{"type":"string","description":"Datestring of the time the address was created","required":true,"format":"date-time"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the Address"},"metaData":{"type":"object","description":"Metadata object (if available)","properties":{},"required":[]},"internalData":{"type":"object","description":"Internal metadata object (if available), not included for user-role requests","properties":{},"required":[]}},"required":["success","id","name","address","main","created","tags"]}}}}}},"delete":{"tags":["Addresses"],"summary":"Delete an Address","operationId":"deleteusersuseraddressesaddress","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"address","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/addresses/:id":{"put":{"tags":["Addresses"],"summary":"Update Address information","operationId":"putusersuseraddressesid","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Identity name","required":false},"address":{"type":"string","description":"New address if you want to rename existing address. Only affects normal addresses, special addresses that include * can not be changed","required":false},"main":{"type":"boolean","description":"Indicates if this is the default address for the User","required":false},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this address"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional metadata for internal use, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/addressregister":{"get":{"tags":["Addresses"],"summary":"List addresses from communication register","operationId":"getusersuseraddressregister","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"query","in":"query","description":"Prefix of an address or a name","required":true,"schema":{"type":"string","example":"`query=john`"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number","example":"`limit=25`"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetUserAddressesregisterResult"},"description":"Address listing"}},"required":["success","results"]}}}}}}},"/addresses/forwarded":{"post":{"tags":["Addresses"],"summary":"Create new forwarded Address","description":"Add a new forwarded email address. Addresses can contain unicode characters. Dots in usernames are normalized so no need to create both \"firstlast@example.com\" and \"first.last@example.com\" Special addresses `*@example.com` and `username@*` catches all emails to these domains or users without a registered destination (requires allowWildcard argument)","operationId":"postaddressesforwarded","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"oneOf":[{"type":"string","description":"E-mail Address","required":true},{"type":"string","required":false}],"description":"E-mail Address"},"name":{"type":"string","description":"Identity name","required":false},"targets":{"type":"array","items":{"type":"string","required":false},"description":"An array of forwarding targets. The value could either be an email address or a relay url to next MX server (\"smtp://mx2.zone.eu:25\") or an URL where mail contents are POSTed to"},"forwards":{"type":"number","description":"Daily allowed forwarding count for this address","required":false},"allowWildcard":{"type":"boolean","description":"If true then address value can be in the form of `*@example.com`, otherwise using * is not allowed","required":false},"autoreply":{"$ref":"#/components/schemas/Autoreply"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this address"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional metadata for internal use, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["address"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Address","required":true}},"required":["success","id"]}}}}}}},"/addresses/forwarded/:id":{"put":{"tags":["Addresses"],"summary":"Update forwarded Address information","operationId":"putaddressesforwardedid","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","description":"New address. Only affects normal addresses, special addresses that include * can not be changed","required":false},"name":{"type":"string","description":"Identity name","required":false},"targets":{"type":"array","items":{"type":"string","required":false},"description":"An array of forwarding targets. The value could either be an email address or a relay url to next MX server (\"smtp://mx2.zone.eu:25\") or an URL where mail contents are POSTed to. If set then overwrites previous targets array"},"forwards":{"type":"number","description":"Daily allowed forwarding count for this address","required":false},"autoreply":{"$ref":"#/components/schemas/Autoreply"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"A list of tags associated with this address"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"internalData":{"type":"object","description":"Optional metadata for internal use, must be an object or JSON formatted string of an object. Not available for user-role tokens","required":false,"format":"any"},"forwardedDisabled":{"type":"boolean","description":"If true then disables forwarded address (stops forwarding messages)","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"id","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/addresses/forwarded/:address":{"delete":{"tags":["Addresses"],"summary":"Delete a forwarded Address","operationId":"deleteaddressesforwardedaddress","parameters":[{"name":"address","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"get":{"tags":["Addresses"],"summary":"Request forwarded Addresses information","operationId":"getaddressesforwardedaddress","parameters":[{"name":"address","in":"path","description":"ID of the Address","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Address","required":true},"address":{"type":"string","description":"E-mail Address","required":true},"name":{"type":"string","description":"Identity name","required":true},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets"},"limits":{"$ref":"#/components/schemas/AddressLimits"},"autoreply":{"$ref":"#/components/schemas/AutoreplyInfo"},"created":{"type":"string","description":"Datestring of the time the address was created","required":true,"format":"date-time"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the Address"},"metaData":{"type":"object","description":"Metadata object (if available)","properties":{},"required":[]},"internalData":{"type":"object","description":"Internal metadata object (if available), not included for user-role requests","properties":{},"required":[]},"forwardedDisabled":{"type":"boolean","description":"Specifies whether forwarding is disabled","required":false}},"required":["success","id","address","name","limits","autoreply","created","tags"]}}}}}}},"/addresses/resolve/:address":{"get":{"tags":["Addresses"],"summary":"Get Address info","operationId":"getaddressesresolveaddress","parameters":[{"name":"address","in":"path","description":"ID of the Address or e-mail address string","required":true,"schema":{"type":"alternatives"}},{"name":"allowWildcard","in":"query","description":"If true then resolves also wildcard addresses","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Address","required":true},"address":{"type":"string","description":"E-mail Address","required":true},"name":{"type":"string","description":"Identity name","required":true},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets if this is a Forwarded address"},"limits":{"$ref":"#/components/schemas/AddressLimits"},"autoreply":{"$ref":"#/components/schemas/AutoreplyInfo"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the Address"},"created":{"type":"string","description":"Datestring of the time the address was created","required":true,"format":"date-time"},"metaData":{"type":"object","description":"Metadata object (if available)","properties":{},"required":[]},"internalData":{"type":"object","description":"Internal metadata object (if available), not included for user-role requests","properties":{},"required":[]}},"required":["success","id","address","name","limits","autoreply","tags","created"]}}}}}}},"/addresses/renameDomain":{"put":{"tags":["Addresses"],"summary":"Rename domain in addresses","description":"Renames domain names for addresses, DKIM keys and Domain Aliases","operationId":"putaddressesrenamedomain","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"oldDomain":{"type":"string","description":"Old Domain Name","required":true},"newDomain":{"type":"string","description":"New Domain Name","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["oldDomain","newDomain"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"modifiedAddresses":{"type":"number","description":"Number of modified addresses","required":true},"modifiedUsers":{"type":"number","description":"Number of modified users","required":true},"modifiedDkim":{"type":"number","description":"Number of modified DKIM keys","required":true},"modifiedAliases":{"type":"number","description":"Number of modified Domain Aliases","required":true}},"required":["success","modifiedAddresses","modifiedUsers","modifiedDkim","modifiedAliases"]}}}}}}},"/users/:user/mailboxes":{"get":{"tags":["Mailboxes"],"summary":"List Mailboxes for a User","operationId":"getusersusermailboxes","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"specialUse","in":"query","description":"Should the response include only folders with specialUse flag set.","required":false,"schema":{"type":"boolean"}},{"name":"showHidden","in":"query","description":"Hidden folders are not included in the listing by default.","required":false,"schema":{"type":"boolean"}},{"name":"counters","in":"query","description":"Should the response include counters (total + unseen). Counters come with some overhead.","required":false,"schema":{"type":"boolean"}},{"name":"sizes","in":"query","description":"Should the response include mailbox size in bytes. Size numbers come with a lot of overhead as an aggregated query is ran.","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Mailbox","required":true},"name":{"type":"string","description":"Name for the mailbox (unicode string)","required":true},"path":{"type":"string","description":"Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)","required":true},"specialUse":{"type":"string","description":"Either special use identifier or null. One of Drafts, Junk, Sent or Trash","required":true},"modifyIndex":{"type":"number","description":"Modification sequence number. Incremented on every change in the mailbox.","required":true},"subscribed":{"type":"boolean","description":"Mailbox subscription status. IMAP clients may unsubscribe from a folder.","required":true},"retention":{"type":"number","description":"Default retention policy for this mailbox (in ms). If set then messages added to this mailbox will be automatically deleted after retention time.","required":false},"hidden":{"type":"boolean","description":"Is the folder hidden or not","required":true},"total":{"type":"number","description":"How many messages are stored in this mailbox","required":true},"unseen":{"type":"number","description":"How many unseen messages are stored in this mailbox","required":true},"size":{"type":"number","description":"Total size of mailbox in bytes.","required":false}},"required":["id","name","path","specialUse","modifyIndex","subscribed","hidden","total","unseen"]},"description":"List of user mailboxes"}},"required":["success","results"]}}}}}},"post":{"tags":["Mailboxes"],"summary":"Create new Mailbox","operationId":"postusersusermailboxes","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)","required":true},"hidden":{"type":"boolean","description":"Is the folder hidden or not. Hidden folders can not be opened in IMAP.","required":false},"retention":{"type":"number","description":"Retention policy for the created Mailbox. Milliseconds after a message added to mailbox expires. Set to 0 to disable.","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["path"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Mailbox","required":true}},"required":["success","id"]}}}}}}},"/users/:user/mailboxes/:mailbox":{"get":{"tags":["Mailboxes"],"summary":"Request Mailbox information","operationId":"getusersusermailboxesmailbox","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","description":"If mailbox is specified as `resolve` in the path then use this param as mailbox path instead of the given mailbox id.","required":false,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Mailbox","required":true},"name":{"type":"string","description":"Name for the mailbox (unicode string)","required":true},"path":{"type":"string","description":"Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)","required":true},"specialUse":{"type":"string","description":"Either special use identifier or null. One of Drafts, Junk, Sent or Trash","required":true,"example":"\\Draft"},"modifyIndex":{"type":"number","description":"Modification sequence number. Incremented on every change in the mailbox.","required":true},"subscribed":{"type":"boolean","description":"Mailbox subscription status. IMAP clients may unsubscribe from a folder.","required":true},"hidden":{"type":"boolean","description":"Is the folder hidden or not","required":true},"total":{"type":"number","description":"How many messages are stored in this mailbox","required":true},"unseen":{"type":"number","description":"How many unseen messages are stored in this mailbox","required":true}},"required":["success","id","name","path","specialUse","modifyIndex","subscribed","hidden","total","unseen"]}}}}}},"put":{"tags":["Mailboxes"],"summary":"Update Mailbox information","operationId":"putusersusermailboxesmailbox","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Full path of the mailbox, use this to rename an existing Mailbox","required":false},"retention":{"type":"number","description":"Retention policy for the Mailbox (in ms). Changing retention value only affects messages added to this folder after the change","required":false},"subscribed":{"type":"boolean","description":"Change Mailbox subscription state","required":false},"hidden":{"type":"boolean","description":"Is the folder hidden or not. Hidden folders can not be opened in IMAP.","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"delete":{"tags":["Mailboxes"],"summary":"Delete a Mailbox","operationId":"deleteusersusermailboxesmailbox","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/mailboxes/:mailbox/messages":{"get":{"tags":["Messages"],"summary":"List messages in a Mailbox","description":"Lists all messages in a mailbox","operationId":"messages","parameters":[{"name":"user","in":"path","description":"ID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"unseen","in":"query","description":"If true, then returns only unseen messages","required":false,"schema":{"type":"boolean"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"threadCounters","in":"query","description":"If true, then includes threadMessageCount in the response. Counters come with some overhead","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"order","in":"query","description":"Ordering of the records by insert date","required":false,"schema":{"type":"any","enum":["asc","desc"]}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}},{"name":"includeHeaders","in":"query","description":"Comma separated list of header keys to include in the response","required":false,"schema":{"type":"alternatives"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true},"total":{"type":"number","description":"How many results were found","required":true},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"specialUse":{"type":"string","description":"Special use. If available","required":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetMessagesResult"},"description":"Message listing"}},"required":["success","total","page","previousCursor","nextCursor","specialUse","results"]}}}}}},"put":{"tags":["Messages"],"summary":"Update Message information","description":"This method updates message flags and also allows to move messages to a different mailbox","operationId":"putusersusermailboxesmailboxmessages","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Message ID. Either singular or comma separated number (1,2,3) or colon separated range (3:15), or a range from UID to end (3:*)","required":true},"moveTo":{"type":"string","description":"ID of the target Mailbox if you want to move messages","required":false},"seen":{"type":"boolean","description":"State of the \\Seen flag","required":false},"deleted":{"type":"boolean","description":"State of the \\Deleted flag","required":false},"flagged":{"type":"boolean","description":"State of the \\Flagged flag","required":false},"draft":{"type":"boolean","description":"State of the \\Draft flag","required":false},"expires":{"oneOf":[{"type":"string","required":false,"format":"date-time"},{"type":"boolean","required":false,"enum":[false]}],"description":"Either expiration date or false to turn off autoexpiration"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["message"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"array","items":{"type":"object","properties":{},"required":[]},"description":"If messages were moved then lists new ID values. Array entry is an array with first element pointing to old ID and second to new ID"},"mailbox":{"type":"string","description":"MoveTo mailbox address","required":false},"updated":{"type":"number","description":"If messages were not moved, then indicates the number of updated messages","required":false}},"required":["success"]}}}}}},"delete":{"tags":["Messages"],"summary":"Delete all Messages from a Mailbox","operationId":"deleteusersusermailboxesmailboxmessages","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"async","in":"query","description":"Schedule deletion task","required":false,"schema":{"type":"boolean"}},{"name":"skipArchive","in":"query","description":"Skip archived messages","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"deleted":{"type":"number","description":"Indicates the count of deleted messages","required":true},"errors":{"type":"number","description":"Indicate the count of errors during the delete","required":true}},"required":["success","deleted","errors"]}}}}}},"post":{"tags":["Messages"],"summary":"Upload Message","description":"This method allows to upload either an RFC822 formatted message or a message structure to a mailbox. Raw message is stored unmodified, no headers are added or removed. If you want to generate the uploaded message from structured data fields, then do not use the raw property.","operationId":"postusersusermailboxesmailboxmessages","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","description":"Date","required":false,"format":"date-time"},"unseen":{"type":"boolean","description":"Is the message unseen or not","required":false},"flagged":{"type":"boolean","description":"Is the message flagged or not","required":false},"draft":{"type":"boolean","description":"Is the message a draft or not","required":false},"raw":{"type":"string","description":"base64 encoded message source. Alternatively, you can provide this value as POST body by using message/rfc822 MIME type. If raw message is provided then it overrides any other mail configuration","required":false,"format":"binary"},"from":{"$ref":"#/components/schemas/AddressOptionalName"},"replyTo":{"$ref":"#/components/schemas/AddressOptionalName"},"to":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the To: header"},"cc":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the Cc: header"},"bcc":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the Bcc: header"},"headers":{"type":"array","items":{"$ref":"#/components/schemas/Header"},"description":"Custom headers for the message. If reference message is set then In-Reply-To and References headers are set automatically"},"subject":{"type":"string","description":"Message subject. If not then resolved from Reference message","required":false},"text":{"type":"string","description":"Plaintext message","required":false},"html":{"type":"string","description":"HTML formatted message","required":false},"files":{"type":"array","items":{"type":"string","required":false},"description":"Attachments as storage file IDs. NB! When retrieving message info then an array of objects is returned. When uploading a message then an array of IDs is used."},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"},"description":"Attachments for the message"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"reference":{"$ref":"#/components/schemas/ReferenceWithAttachments"},"replacePrevious":{"type":"object","description":"If set, then deletes a previous message when storing the new one. Useful when uploading a new Draft message.","properties":{"mailbox":{"type":"string","required":false},"id":{"type":"number","required":true}},"required":["id"]},"bimi":{"$ref":"#/components/schemas/Bimi"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"message":{"type":"object","description":"Message information","properties":{"id":{"type":"number","description":"Message ID in mailbox","required":true},"malbox":{"type":"string","description":"Mailbox ID the message was stored into","required":true},"size":{"type":"number","description":"Size of the RFC822 formatted email","required":true}},"required":["id","malbox","size"]},"previousDeleted":{"type":"boolean","description":"Set if replacing a previous message was requested","required":false},"previousDeleteError":{"type":"string","description":"Previous delete error message","required":false}},"required":["success","message"]}}}}}}},"/users/:user/search":{"get":{"tags":["Messages"],"summary":"Search for messages","description":"This method allows searching for matching messages.","operationId":"search","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","description":"Additional query string","required":false,"schema":{"type":"string"}},{"name":"mailbox","in":"query","description":"ID of the Mailbox","required":false,"schema":{"type":"string"}},{"name":"id","in":"query","description":"Message ID values, only applies when used in combination with `mailbox`. Either comma separated numbers (1,2,3) or colon separated range (3:15), or a range from UID to end (3:*)","required":false,"schema":{"type":"string"}},{"name":"thread","in":"query","description":"Thread ID","required":false,"schema":{"type":"string"}},{"name":"or","in":"query","description":"At least onOne of the included terms must match","required":false,"schema":{"type":"object"}},{"name":"query","in":"query","description":"Search string, uses MongoDB fulltext index. Covers data from message body and also common headers like from, to, subject etc.","required":false,"schema":{"type":"string"}},{"name":"datestart","in":"query","description":"Datestring for the earliest message storing time","required":false,"schema":{"type":"date"}},{"name":"dateend","in":"query","description":"Datestring for the latest message storing time","required":false,"schema":{"type":"date"}},{"name":"from","in":"query","description":"Partial match for the From: header line","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","description":"Partial match for the To: and Cc: header lines","required":false,"schema":{"type":"string"}},{"name":"subject","in":"query","description":"Partial match for the Subject: header line","required":false,"schema":{"type":"string"}},{"name":"minSize","in":"query","description":"Minimal message size in bytes","required":false,"schema":{"type":"number"}},{"name":"maxSize","in":"query","description":"Maximal message size in bytes","required":false,"schema":{"type":"number"}},{"name":"attachments","in":"query","description":"If true, then matches only messages with attachments","required":false,"schema":{"type":"boolean"}},{"name":"flagged","in":"query","description":"If true, then matches only messages with \\Flagged flags","required":false,"schema":{"type":"boolean"}},{"name":"unseen","in":"query","description":"If true, then matches only messages without \\Seen flags","required":false,"schema":{"type":"boolean"}},{"name":"includeHeaders","in":"query","description":"Comma separated list of header keys to include in the response","required":false,"schema":{"type":"string","example":"List-ID, MIME-Version"}},{"name":"searchable","in":"query","description":"If true, then matches messages not in Junk or Trash","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}},{"name":"threadCounters","in":"query","description":"If true, then includes threadMessageCount in the response. Counters come with some overhead","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"order","in":"query","description":"Ordering of the records by insert date. If no order is supplied, results are sorted by heir mongoDB ObjectId.","required":false,"schema":{"type":"any","enum":["asc","desc"]}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true},"query":{"type":"string","required":true},"total":{"type":"number","required":true},"page":{"type":"number","required":true},"previousCursor":{"oneOf":[{"type":"boolean","required":false},{"type":"string","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"boolean","required":false},{"type":"string","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetMessagesResult"},"description":"Message listing"}},"required":["success","query","total","page","previousCursor","nextCursor","results"]}}}}}},"post":{"tags":["Messages"],"summary":"Search and update messages","description":"This method allows applying an action to all matching messages. This is an async method so that it will return immediately. Actual modifications are run in the background.","operationId":"searchApply","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","description":"Additional query string","required":false},"mailbox":{"type":"string","description":"ID of the Mailbox","required":false},"id":{"type":"string","description":"Message ID values, only applies when used in combination with `mailbox`. Either comma separated numbers (1,2,3) or colon separated range (3:15), or a range from UID to end (3:*)","required":false},"thread":{"type":"string","description":"Thread ID","required":false},"or":{"type":"object","description":"At least onOne of the included terms must match","properties":{"query":{"type":"string","description":"Search string, uses MongoDB fulltext index. Covers data from message body and also common headers like from, to, subject etc.","required":false},"from":{"type":"string","description":"Partial match for the From: header line","required":false},"to":{"type":"string","description":"Partial match for the To: and Cc: header lines","required":false},"subject":{"type":"string","description":"Partial match for the Subject: header line","required":false}},"required":[]},"query":{"type":"string","description":"Search string, uses MongoDB fulltext index. Covers data from message body and also common headers like from, to, subject etc.","required":false},"datestart":{"type":"string","description":"Datestring for the earliest message storing time","required":false,"format":"date-time"},"dateend":{"type":"string","description":"Datestring for the latest message storing time","required":false,"format":"date-time"},"from":{"type":"string","description":"Partial match for the From: header line","required":false},"to":{"type":"string","description":"Partial match for the To: and Cc: header lines","required":false},"subject":{"type":"string","description":"Partial match for the Subject: header line","required":false},"minSize":{"type":"number","description":"Minimal message size in bytes","required":false},"maxSize":{"type":"number","description":"Maximal message size in bytes","required":false},"attachments":{"type":"boolean","description":"If true, then matches only messages with attachments","required":false},"flagged":{"type":"boolean","description":"If true, then matches only messages with \\Flagged flags","required":false},"unseen":{"type":"boolean","description":"If true, then matches only messages without \\Seen flags","required":false},"includeHeaders":{"type":"string","description":"Comma separated list of header keys to include in the response","required":false,"example":"List-ID, MIME-Version"},"searchable":{"type":"boolean","description":"If true, then matches messages not in Junk or Trash","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false},"action":{"type":"object","description":"Define actions to take with matching messages","properties":{"moveTo":{"type":"string","description":"ID of the target Mailbox if you want to move messages","required":false},"seen":{"type":"boolean","description":"State of the \\Seen flag","required":false},"flagged":{"type":"boolean","description":"State of the \\Flagged flag","required":false}},"required":[]}},"required":["action"]}}},"required":true},"parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates if the action succeeded or not","required":true},"scheduled":{"type":"string","description":"ID of the scheduled operation","required":true},"existing":{"type":"boolean","description":"Indicates if the scheduled operation already exists","required":true}},"required":["success","scheduled","existing"]}}}}}}},"/users/:user/mailboxes/:mailbox/messages/:message":{"get":{"tags":["Messages"],"summary":"Request Message information","operationId":"message","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}},{"name":"replaceCidLinks","in":"query","description":"If true then replaces cid links","required":false,"schema":{"type":"boolean"}},{"name":"markAsSeen","in":"query","description":"If true then marks message as seen","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"number","description":"Message ID","required":true},"mailbox":{"type":"string","description":"ID of the Mailbox","required":true},"user":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"envelope":{"$ref":"#/components/schemas/Envelope"},"thread":{"type":"string","description":"ID of the Thread","required":true},"from":{"$ref":"#/components/schemas/Address"},"replyTo":{"$ref":"#/components/schemas/Address"},"to":{"$ref":"#/components/schemas/Address"},"cc":{"$ref":"#/components/schemas/Address"},"bcc":{"$ref":"#/components/schemas/Address"},"subject":{"type":"string","description":"Message subject","required":true},"messageId":{"type":"string","description":"Message-ID header","required":true},"date":{"type":"string","description":"Date string from header","required":true,"format":"date-time"},"idate":{"type":"string","description":"Date string of receive time","required":false,"format":"date-time"},"list":{"$ref":"#/components/schemas/List"},"size":{"type":"number","description":"Message size","required":true},"expires":{"type":"string","description":"Datestring, if set then indicates the time after this message is automatically deleted","required":false},"seen":{"type":"boolean","description":"Does this message have a \\Seen flag","required":true},"deleted":{"type":"boolean","description":"Does this message have a \\Deleted flag","required":true},"flagged":{"type":"boolean","description":"Does this message have a \\Flagged flag","required":true},"draft":{"type":"boolean","description":"Does this message have a \\Draft flag","required":true},"html":{"type":"array","items":{"type":"string","required":false},"description":"An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string"},"text":{"type":"string","description":"Plaintext content of the message","required":false},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Attachment ID","required":true},"hash":{"type":"string","description":"SHA-256 hash of the contents of the attachment","required":false},"filename":{"type":"string","description":"Filename of the attachment","required":true},"contentType":{"type":"string","description":"MIME type","required":true},"disposition":{"type":"string","description":"Attachment disposition","required":true},"transferEncoding":{"type":"string","description":"Which transfer encoding was used (actual content when fetching attachments is not encoded)","required":true},"related":{"type":"boolean","description":"Was this attachment found from a multipart/related node. This usually means that this is an embedded image","required":true},"sizeKb":{"type":"number","description":"Approximate size of the attachment in kilobytes","required":true}},"required":["id","filename","contentType","disposition","transferEncoding","related","sizeKb"]},"description":"Attachments for the message"},"verificationResults":{"type":"object","description":"Security verification info if message was received from MX. If this property is missing then do not automatically assume invalid TLS, SPF or DKIM.","properties":{"tls":{"$ref":"#/components/schemas/Tls"},"spf":{"type":"object","description":"Domain name (either MFROM or HELO) of verified SPF or false if no SPF match was found","properties":{},"required":[]},"dkim":{"type":"object","description":"Domain name of verified DKIM signature or false if no valid signature was found","properties":{},"required":[]}},"required":["tls","spf","dkim"]},"bimi":{"type":"object","description":"BIMI logo info. If logo validation failed in any way, then this property is not set","properties":{"certified":{"type":"boolean","description":"If true, then this logo is from a VMC file","required":false},"url":{"type":"string","description":"URL of the resource the logo was retrieved from","required":false},"image":{"type":"string","description":"Data URL for the SVG image","required":false}},"required":[]},"contentType":{"type":"object","description":"Parsed Content-Type header. Usually needed to identify encrypted messages and such","properties":{"value":{"type":"string","description":"MIME type of the message, eg. \"multipart/mixed","required":true},"params":{"type":"object","description":"An object with Content-Type params as key-value pairs","properties":{},"required":[]}},"required":["value","params"]},"metaData":{"type":"object","description":"Custom metadata object set for this message","properties":{},"required":[]},"references":{"type":"array","items":{"$ref":"#/components/schemas/ReferenceWithAttachments"},"description":"References"},"files":{"type":"object","description":"List of files added to this message as attachments. Applies to Drafts, normal messages do not have this property. Needed to prevent uploading the same attachment every time a draft is updated","properties":{},"required":[]},"outbound":{"type":"array","items":{"type":"object","properties":{},"required":[]},"description":"Outbound queue entries"},"forwardTargets":{"type":"object","description":"Forward targets","properties":{},"required":[]},"reference":{"type":"object","description":"Referenced message info","properties":{},"required":[]},"answered":{"type":"boolean","description":"\\Answered flag value","required":true},"forwarded":{"type":"boolean","description":"$Forwarded flag value","required":true},"encrypted":{"type":"boolean","description":"True if message is encrypted","required":false}},"required":["success","id","mailbox","user","envelope","thread","from","subject","messageId","date","size","seen","deleted","flagged","draft","contentType","references","answered","forwarded"]}}}}}},"put":{"tags":["Messages"],"summary":"Update message information with path param","description":"This method updates message flags and also allows to move messages to a different mailbox","operationId":"putusersusermailboxesmailboxmessagesmessage","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"moveTo":{"type":"string","description":"ID of the target Mailbox if you want to move messages","required":false},"seen":{"type":"boolean","description":"State of the \\Seen flag","required":false},"deleted":{"type":"boolean","description":"State of the \\Deleted flag","required":false},"flagged":{"type":"boolean","description":"State of the \\Flagged flag","required":false},"draft":{"type":"boolean","description":"State of the \\Draft flag","required":false},"expires":{"oneOf":[{"type":"string","required":false,"format":"date-time"},{"type":"boolean","required":false,"enum":[false]}],"description":"Either expiration date or false to turn off autoexpiration"},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID. Either singular or comma separated number (1,2,3) or colon separated range (3:15), or a range from UID to end (3:*)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"array","items":{"type":"object","properties":{},"required":[]},"description":"If messages were moved then lists new ID values. Array entry is an array with first element pointing to old ID and second to new ID"},"mailbox":{"type":"string","description":"MoveTo mailbox address","required":false},"updated":{"type":"number","description":"If messages were not moved, then indicates the number of updated messages","required":false}},"required":["success"]}}}}}},"delete":{"tags":["Messages"],"summary":"Delete a Message","operationId":"deleteusersusermailboxesmailboxmessagesmessage","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/mailboxes/:mailbox/messages/:message/message.eml":{"get":{"tags":["Messages"],"summary":"Get Message source","description":"This method returns the full RFC822 formatted source of the stored message","operationId":"raw","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"message/rfc822":{"schema":{"type":"object","properties":{"success":{"type":"string","description":"Success","required":false,"format":"binary"}},"required":[]}}}}}}},"/users/:user/mailboxes/:mailbox/messages/:message/attachments/:attachment":{"get":{"tags":["Messages"],"summary":"Download Attachment","description":"This method returns attachment file contents in binary form","operationId":"attachment","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}},{"name":"attachment","in":"path","description":"ID of the Attachment","required":true,"schema":{"type":"string"}},{"name":"sendAsString","in":"query","description":"If true then sends the original attachment back in string format with correct encoding.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success","content":{"application/octet-stream":{"schema":{"type":"object","properties":{"success":{"type":"string","required":false,"format":"binary"}},"required":[]}}}}}}},"/users/:user/mailboxes/:mailbox/messages/:message/forward":{"post":{"tags":["Messages"],"summary":"Forward stored Message","description":"This method allows either to re-forward a message to an original forward target or forward it to some other address. This is useful if a user had forwarding turned on but the message was not delivered so you can try again. Forwarding does not modify the original message.","operationId":"postusersusermailboxesmailboxmessagesmessageforward","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"type":"number","description":"Number of original forwarding target","required":false},"addresses":{"type":"array","items":{"type":"string","required":false},"description":"An array of additional forward targets"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"queueId":{"type":"string","description":"Message ID in outbound queue","required":false},"forwarded":{"type":"array","items":{"$ref":"#/components/schemas/Forwarded"},"description":"Information about forwarding targets"}},"required":["success"]}}}}}}},"/users/:user/mailboxes/:mailbox/messages/:message/submit":{"post":{"tags":["Messages"],"summary":"Submit Draft for delivery","description":"This method allows to submit a draft message for delivery. Draft is moved to Sent mail folder.","operationId":"postusersusermailboxesmailboxmessagesmessagesubmit","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"deleteFiles":{"type":"boolean","description":"If true then deletes attachment files listed in metaData.files array","required":false},"sendTime":{"type":"string","description":"Datestring for delivery if message should be sent some later time","required":false,"format":"date-time"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"ID of the Mailbox","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"queueId":{"type":"string","description":"Message ID in outbound queue","required":true},"message":{"$ref":"#/components/schemas/Message"}},"required":["success","queueId"]}}}}}}},"/users/:user/outbound/:queueId":{"delete":{"tags":["Messages"],"summary":"Delete an Outbound Message","description":"You can delete outbound emails that are still in queue. Queue ID can be found from the `outbound` property of a stored email.","operationId":"deleteusersuseroutboundqueueid","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"queueId","in":"path","description":"Outbound queue ID of the message","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/archived/messages":{"get":{"tags":["Archive"],"summary":"List archived messages","description":"Archive contains all recently deleted messages besides Drafts etc.","operationId":"archived","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"order","in":"query","description":"Ordering of the records by insert date","required":false,"schema":{"type":"any","enum":["asc","desc"]}},{"name":"includeHeaders","in":"query","description":"Comma separated list of header keys to include in the response","required":false,"schema":{"type":"string","example":"List-ID, MIME-Version"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true},"total":{"type":"number","description":"How many results were found","required":true},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetMessagesResult"},"description":"Message listing"}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}}},"/users/:user/archived/restore":{"post":{"tags":["Archive"],"summary":"Restore archived messages","description":"Initiates a restore task to move archived messages of a date range back to the mailboxes the messages were deleted from. If target mailbox does not exist, then the messages are moved to INBOX.","operationId":"create_restore_task","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"type":"string","description":"Datestring","required":true,"format":"date-time"},"end":{"type":"string","description":"Datestring","required":true,"format":"date-time"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["start","end"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true},"task":{"type":"string","description":"Task ID","required":true}},"required":["success","task"]}}}}}}},"/users/:user/archived/messages/:message/restore":{"post":{"tags":["Archive"],"summary":"Restore archived messages","description":"Initiates a restore task to move archived messages of a date range back to the mailboxes the messages were deleted from. If target mailbox does not exist, then the messages are moved to INBOX.","operationId":"archived_restore","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mailbox":{"type":"string","description":"ID of the target Mailbox. If not set then original mailbox is used.","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"message","in":"path","description":"Message ID","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true},"mailbox":{"type":"string","description":"Mailbox ID the message was moved to","required":true},"id":{"type":"number","description":"New ID for the Message","required":true}},"required":["success","mailbox","id"]}}}}}}},"/users/:user/storage":{"post":{"tags":["Storage"],"summary":"Upload file","description":"This method allows to upload an attachment to be linked from a draft","operationId":"postusersuserstorage","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","description":"Name of the file","required":false},"contentType":{"type":"string","description":"MIME type of the file. Is detected from the file name by default","required":false},"encoding":{"type":"string","description":"Encoding of the file content. Useful if you want to upload the file in base64 encoded format. Valid options \"base64\", \"hex\", \"utf8\"","required":false,"enum":["base64"]},"content":{"type":"string","description":"File content in binary","required":true,"format":"binary"},"cid":{"type":"string","description":"content ID","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["content"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"File ID","required":true}},"required":["success","id"]}}}}}},"get":{"tags":["Storage"],"summary":"List stored files","operationId":"getusersuserstorage","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"query","in":"query","description":"partial match of a filename","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetFilesResult"},"description":"File listing"}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}}},"/users/:user/storage/:file":{"delete":{"tags":["Storage"],"summary":"Delete a File","operationId":"deleteusersuserstoragefile","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"file","in":"path","description":"ID of the File","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"get":{"tags":["Storage"],"summary":"Download File","description":"This method returns stored file contents in binary form","operationId":"storagefile","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"file","in":"path","description":"ID of the File","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/octet-stream":{"schema":{"type":"string","required":false,"format":"binary"}}}}}}},"/filters":{"get":{"tags":["Filters"],"summary":"List all Filters","operationId":"filters","parameters":[{"name":"forward","in":"query","description":"Partial match of a forward email address or URL","required":false,"schema":{"type":"string"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument.","required":true},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetAllFiltersResult"},"description":"Address listing"}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}}},"/users/:user/filters":{"get":{"tags":["Filters"],"summary":"List Filters for a User","operationId":"getusersuserfilters","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"metaData","in":"query","description":"If true, then includes metaData in the response","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"limits":{"type":"object","description":"Filter usage limits for the user account","properties":{"allowed":{"type":"number","description":"How many filters are allowed","required":false},"used":{"type":"number","description":"How many filters have been created","required":false}},"required":[]},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetFiltersResult"},"description":"Filter description"}},"required":["success","limits","results"]}}}}}},"post":{"tags":["Filters"],"summary":"Create a new Filter","operationId":"postusersuserfilters","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the Filter","required":false},"query":{"$ref":"#/components/schemas/Query"},"action":{"$ref":"#/components/schemas/Action"},"disabled":{"type":"boolean","description":"If true then this filter is ignored","required":false},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["query","action"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID for the created filter","required":true}},"required":["success","id"]}}}}}}},"/users/:user/filters/:filter":{"get":{"tags":["Filters"],"summary":"Request Filter information","operationId":"getusersuserfiltersfilter","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"filter","in":"path","description":"Filters unique ID","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Filters unique ID","required":true},"name":{"type":"string","description":"Name for the filter","required":true},"created":{"type":"string","description":"Datestring of the time the filter was created","required":true,"format":"date-time"},"query":{"$ref":"#/components/schemas/Query"},"action":{"$ref":"#/components/schemas/Action"},"disabled":{"type":"boolean","description":"If true, then this filter is ignored","required":true},"metaData":{"type":"object","description":"Custom metadata value","properties":{},"required":[]}},"required":["success","id","name","created","query","action","disabled"]}}}}}},"delete":{"tags":["Filters"],"summary":"Delete a Filter","operationId":"deleteusersuserfiltersfilter","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"filter","in":"path","description":"Filters unique ID","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"put":{"tags":["Filters"],"summary":"Update Filter information","operationId":"putusersuserfiltersfilter","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the Filter","required":false},"query":{"$ref":"#/components/schemas/Query"},"action":{"$ref":"#/components/schemas/Action"},"disabled":{"type":"boolean","description":"If true then this filter is ignored","required":false},"metaData":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"filter","in":"path","description":"Filters unique ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/domainaccess/:tag/allow":{"post":{"tags":["DomainAccess"],"summary":"Add domain to allowlist","description":"If an email is sent from a domain that is listed in the allowlist then it is never marked as spam. Lists apply for tagged users.","operationId":"postdomainaccesstagallow","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain name to allowlist for users/addresses that include this tag","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["domain"]}}},"required":true},"parameters":[{"name":"tag","in":"path","description":"Tag to look for","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID for the created record","required":true}},"required":["success","id"]}}}}}},"get":{"tags":["DomainAccess"],"summary":"List allowlisted domains","operationId":"getdomainaccesstagallow","parameters":[{"name":"tag","in":"path","description":"Tag to look for","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetAllowedDomainResult"},"description":"Domain list"}},"required":["success","results"]}}}}}}},"/domainaccess/:tag/block":{"post":{"tags":["DomainAccess"],"summary":"Add domain to blocklist","description":"If an email is sent from a domain that is listed in the blocklist then it is always marked as spam. Lists apply for tagged users.","operationId":"postdomainaccesstagblock","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain name to blocklist for users/addresses that include this tag","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["domain"]}}},"required":true},"parameters":[{"name":"tag","in":"path","description":"Tag to look for","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID for the created record","required":true}},"required":["success","id"]}}}}}},"get":{"tags":["DomainAccess"],"summary":"List blocklisted domains","operationId":"getdomainaccesstagblock","parameters":[{"name":"tag","in":"path","description":"Tag to look for","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetBlockedDomainResult"},"description":"Domain list"}},"required":["success","results"]}}}}}}},"/domainaccess/:domain":{"delete":{"tags":["DomainAccess"],"summary":"Delete a Domain from listing","operationId":"deletedomainaccessdomain","parameters":[{"name":"domain","in":"path","description":"Listed domain's unique ID","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"deleted":{"type":"string","description":"Deleted domain's unique ID","required":true}},"required":["success","deleted"]}}}}}}},"/users/:user/asps":{"get":{"tags":["ApplicationPasswords"],"summary":"List Application Passwords","operationId":"getusersuserasps","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"showAll","in":"query","description":"If not true then skips entries with a TTL set","required":false,"schema":{"type":"boolean"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetASPsResult"},"description":"Event listing"}},"required":["success","results"]}}}}}},"post":{"tags":["ApplicationPasswords"],"summary":"Create new Application Password","operationId":"postusersuserasps","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","description":"Description for the Application Password entry","required":true},"scopes":{"type":"array","items":{"type":"string","required":true,"enum":["imap","pop3","smtp","*"]},"description":"List of scopes this Password applies to. Special scope \"*\" indicates that this password can be used for any scope except \"master\""},"address":{"type":"string","description":"E-mail address to be used as the account address in mobileconfig file. Must be one of the listed identity addresses of the user. Defaults to the main address of the user","required":false},"password":{"type":"string","description":"Optional pregenerated password. Must be 16 characters, latin letters only.","required":false},"generateMobileconfig":{"type":"boolean","description":"If true then result contains a mobileconfig formatted file with account config","required":false},"ttl":{"type":"number","description":"TTL in seconds for this password. Every time password is used, TTL is reset to this value","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["description"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Application Password","required":true},"password":{"type":"string","description":"Application Specific Password. Generated password is whitespace agnostic, so it could be displayed to the client as \"abcd efgh ijkl mnop\" instead of \"abcdefghijklmnop\"","required":true},"mobileconfig":{"type":"string","description":"Base64 encoded mobileconfig file. Generated profile file should be sent to the client with Content-Type value of application/x-apple-aspen-config.","required":true},"name":{"type":"string","description":"Account name","required":true},"address":{"type":"string","description":"Account address or the address specified in params of this endpoint","required":true}},"required":["success","id","password","mobileconfig","name","address"]}}}}}}},"/users/:user/asps/:asp":{"get":{"tags":["ApplicationPasswords"],"summary":"Request ASP information","operationId":"getusersuseraspsasp","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"asp","in":"path","description":"ID of the Application Password","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Application Password","required":true},"description":{"type":"string","description":"Description","required":true},"scopes":{"type":"array","items":{"type":"string","required":true,"enum":["imap","pop3","smtp","*"]},"description":"Allowed scopes for the Application Password"},"lastUse":{"$ref":"#/components/schemas/LastUse"},"created":{"type":"string","description":"Datestring","required":true,"format":"date-time"},"expires":{"type":"string","description":"Application password expires after the given date","required":true,"format":"date-time"}},"required":["success","id","description","scopes","lastUse","created","expires"]}}}}}},"delete":{"tags":["ApplicationPasswords"],"summary":"Delete an Application Password","operationId":"deleteusersuseraspsasp","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"asp","in":"path","description":"ID of the Application Password","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa/totp/setup":{"post":{"tags":["TwoFactorAuth"],"summary":"Generate TOTP seed","description":"This method generates TOTP seed and QR code for 2FA. User needs to verify the seed value using 2fa/totp/enable endpoint","operationId":"postusersuser2fatotpsetup","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","description":"Label text for QR code (defaults to username)","required":false},"issuer":{"type":"string","description":"Description text for QR code (defaults to \"WildDuck\")","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["issuer"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"seed":{"type":"string","description":"Generated TOTP seed value","required":true},"qrcode":{"type":"string","description":"Base64 encoded QR code","required":true}},"required":["success","seed","qrcode"]}}}}}}},"/users/:user/2fa/totp/enable":{"post":{"tags":["TwoFactorAuth"],"summary":"Enable TOTP seed","description":"This method enables TOTP for a user by verifying the seed value generated from 2fa/totp/setup","operationId":"postusersuser2fatotpenable","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"6-digit number that matches seed value from 2fa/totp/setup","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["token"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa/totp":{"delete":{"tags":["TwoFactorAuth"],"summary":"Disable TOTP auth","description":"This method disables TOTP for a user. Does not affect other 2FA mechanisms a user might have set up","operationId":"deleteusersuser2fatotp","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa/totp/check":{"post":{"tags":["TwoFactorAuth"],"summary":"Validate TOTP Token","description":"This method checks if a TOTP token provided by a User is valid for authentication","operationId":"postusersuser2fatotpcheck","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"6-digit number","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["token"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa":{"delete":{"tags":["TwoFactorAuth"],"summary":"Disable 2FA","description":"This method disables all 2FA mechanisms a user might have set up","operationId":"deleteusersuser2fa","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa/custom":{"put":{"tags":["TwoFactorAuth"],"summary":"Enable custom 2FA for a user","description":"This method disables account password for IMAP/POP3/SMTP","operationId":"putusersuser2facustom","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}},"delete":{"tags":["TwoFactorAuth"],"summary":"Disable custom 2FA for a user","description":"This method disables custom 2FA. If it was the only 2FA set up, then account password for IMAP/POP3/SMTP gets enabled again","operationId":"deleteusersuser2facustom","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/2fa/webauthn/credentials":{"get":{"tags":["TwoFactorAuth"],"summary":"Get WebAuthN credentials for a user","description":"This method returns the list of WebAuthN credentials for a given user","operationId":"getusersuser2fawebauthncredentials","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"credentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Credential ID","required":true},"rawId":{"type":"string","description":"Raw ID string of the credential in hex","required":true},"description":{"type":"string","description":"Descriptive name for the authenticator","required":true},"authenticatorAttachment":{"type":"string","description":"Indicates whether authenticators is a part of the OS (\"platform\"), or roaming authenticators (\"cross-platform\")","required":true,"example":"platform"}},"required":["id","rawId","description","authenticatorAttachment"]},"description":"List of credentials"}},"required":["success","credentials"]}}}}}}},"/users/:user/2fa/webauthn/credentials/:credential":{"delete":{"tags":["TwoFactorAuth"],"summary":"Remove WebAuthN authenticator","description":"This method deletes the given WebAuthN authenticator for given user.","operationId":"deleteusersuser2fawebauthncredentialscredential","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"credential","in":"path","description":"Credential ID","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"deleted":{"type":"boolean","description":"Specifies whether the given credential has been deleted","required":true}},"required":["success","deleted"]}}}}}}},"/users/:user/2fa/webauthn/registration-challenge":{"post":{"tags":["TwoFactorAuth"],"summary":"Get the WebAuthN registration challenge","description":"This method initiates the WebAuthN authenticator registration challenge","operationId":"postusersuser2fawebauthnregistrationchallenge","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","description":"Descriptive name for the authenticator","required":true},"origin":{"type":"string","description":"Origin","required":true},"authenticatorAttachment":{"type":"string","description":"Indicates whether authenticators should be part of the OS (\"platform\"), or can be roaming authenticators (\"cross-platform\")","required":false,"enum":["platform","cross-platform"],"example":"cross-platform"},"rpId":{"type":"string","description":"Relaying party ID. Is domain.","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["description","origin"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"registrationOptions":{"type":"object","properties":{"challenge":{"type":"string","description":"Challenge as a hex string","required":true},"user":{"type":"object","properties":{"id":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"name":{"type":"string","description":"User address or name","required":true},"displayName":{"type":"string","description":"User display name or username","required":true}},"required":["id","name","displayName"]},"authenticatorSelection":{"type":"object","description":"Data about the authenticator","properties":{"authenticatorAttachment":{"type":"string","description":"\"platform\" or \"cross-platform\"","required":true}},"required":["authenticatorAttachment"]},"rp":{"type":"object","description":"Relaying party data","properties":{"name":{"type":"string","description":"Rp name","required":true},"id":{"type":"string","description":"Rp ID. Domain","required":true},"icon":{"type":"string","description":"Rp icon. data/image string in base64 format","required":false}},"required":["name","id"]},"excludeCredentials":{"type":"array","items":{"type":"object","properties":{"rawId":{"type":"string","description":"Raw ID of the credential as hex string","required":true},"type":{"type":"string","description":"Type of the credential","required":true},"transports":{"type":"array","items":{"type":"string","required":true},"description":"Credential transports. If authenticatorAttachment is \"platform\" then [\"internal\"] otherwise [\"usb\", \"nfc\", \"ble\"]"}},"required":["rawId","type","transports"]},"description":"List of credentials to exclude"}},"required":["challenge","authenticatorSelection","rp"]}},"required":["success"]}}}}}}},"/users/:user/2fa/webauthn/registration-attestation":{"post":{"tags":["TwoFactorAuth"],"summary":"Attestate WebAuthN authenticator","description":"Attestation is used to verify the authenticity of the authenticator and provide assurances about its features.","operationId":"postusersuser2fawebauthnregistrationattestation","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string","description":"Challenge as hex string","required":true},"rawId":{"type":"string","description":"Credential ID/RawID as hex string","required":true},"clientDataJSON":{"type":"string","description":"Clientside data JSON as hex string","required":true},"attestationObject":{"type":"string","description":"Attestation object represented as a hex string","required":true},"rpId":{"type":"string","description":"Relaying party ID. Is domain.","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["challenge","rawId","clientDataJSON","attestationObject"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Credential ID","required":true},"rawId":{"type":"string","description":"Credential RawID as a hex string","required":true},"description":{"type":"string","description":"Description for the authenticator","required":true},"authenticatorAttachment":{"type":"string","description":"Specifies whether authenticator is \"platform\" or \"cross-platform\"","required":true}},"required":["success","id","rawId","description","authenticatorAttachment"]}}}}}}},"/users/:user/2fa/webauthn/authentication-challenge":{"post":{"tags":["TwoFactorAuth"],"summary":"Begin WebAuthN authentication challenge","description":"This method retrieves the WebAuthN PublicKeyCredentialRequestOptions object to use it for authentication","operationId":"postusersuser2fawebauthnauthenticationchallenge","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string","description":"Origin domain","required":true},"authenticatorAttachment":{"type":"string","description":"Indicates whether authenticators should be part of the OS (\"platform\"), or can be roaming authenticators (\"cross-platform\")","required":false,"enum":["platform","cross-platform"],"example":"cross-platform"},"rpId":{"type":"string","description":"Relaying party ID. Domain","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["origin"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"authenticationOptions":{"type":"object","description":"PublicKeyCredentialRequestOptions object","properties":{"challenge":{"type":"string","description":"Challenge as hex string","required":true},"allowCredentials":{"type":"array","items":{"type":"object","properties":{"rawId":{"type":"string","description":"RawId of the credential as hex string","required":true},"type":{"type":"string","description":"Credential type","required":true}},"required":["rawId","type"]},"description":"Allowed credential(s) based on the request"},"rpId":{"type":"string","description":"Relaying Party ID. Domain","required":false},"rawChallenge":{"type":"string","description":"Raw challenge bytes. ArrayBuffer","required":false},"attestation":{"type":"string","description":"Attestation string. `direct`/`indirect`/`none`","required":false},"extensions":{"type":"object","description":"Any credential extensions","properties":{},"required":[]},"userVerification":{"type":"string","description":"User verification type. `required`/`preferred`/`discouraged`","required":false},"timeout":{"type":"number","description":"Timeout in milliseconds (ms)","required":false}},"required":["challenge","allowCredentials"]}},"required":["success","authenticationOptions"]}}}}}}},"/users/:user/2fa/webauthn/authentication-assertion":{"post":{"tags":["TwoFactorAuth"],"summary":"WebAuthN authentication Assertion","description":"Assert WebAuthN authentication request and actually authenticate the user","operationId":"postusersuser2fawebauthnauthenticationassertion","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string","description":"Challenge of the credential as hex string","required":true},"rawId":{"type":"string","description":"RawId of the credential","required":true},"clientDataJSON":{"type":"string","description":"Client data JSON as hex string","required":true},"authenticatorData":{"type":"string","description":"Authentication data as hex string","required":true},"signature":{"type":"string","description":"Private key encrypted signature to verify with public key on the server. Hex string","required":true},"rpId":{"type":"string","description":"Relaying party ID. Domain","required":false},"token":{"type":"boolean","description":"If true response will contain the user auth token","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["challenge","rawId","clientDataJSON","authenticatorData","signature"]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"response":{"type":"object","description":"Auth data","properties":{"authenticated":{"type":"boolean","description":"Authentication status","required":true},"credential":{"type":"string","description":"WebAuthN credential ID","required":true}},"required":["authenticated","credential"]},"token":{"type":"string","description":"User auth token","required":false}},"required":["success","response"]}}}}}}},"/users/:user/updates":{"get":{"tags":["Users"],"summary":"Open change stream","description":"This api call returns an EventSource response. Listen on this stream to get notifications about changes in messages and mailboxes. Returned events are JSON encoded strings","operationId":"getusersuserupdates","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"Last-Event-ID","in":"query","description":"Last event ID header as query param","required":false,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"text/event-stream":{"schema":{"type":"string","required":false}}}}}}},"/preauth":{"post":{"tags":["Authentication"],"summary":"Pre-auth check","description":"Check if an username exists and can be used for authentication","operationId":"postpreauth","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"oneOf":[{"type":"string","required":false},{"type":"string","required":false}],"description":"Username or E-mail address"},"scope":{"type":"string","description":"Required scope. One of master, imap, smtp, pop3","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["username"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"username":{"type":"string","description":"Username of authenticated User","required":true},"address":{"type":"string","description":"Default email address of authenticated User","required":true},"scope":{"type":"string","description":"The scope this authentication is valid for","required":true},"require2fa":{"type":"array","items":{"type":"string","required":false},"description":"List of enabled 2FA mechanisms"}},"required":["success","id","username","address","scope","require2fa"]}}}}}}},"/authenticate":{"post":{"tags":["Authentication"],"summary":"Authenticate a User","operationId":"postauthenticate","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"oneOf":[{"type":"string","required":false},{"type":"string","required":false}],"description":"Username or E-mail address"},"password":{"type":"string","description":"Password","required":true},"protocol":{"type":"string","description":"Application identifier for security logs","required":false},"scope":{"type":"string","description":"Required scope. One of master, imap, smtp, pop3","required":false},"appId":{"type":"string","description":"Optional appId which is the URL of the app","required":false},"token":{"type":"boolean","description":"If true then generates a temporary access token that is valid for this user. Only available if scope is \"master\". When using user tokens then you can replace user ID in URLs with \"me\".","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["username","password"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"username":{"type":"string","description":"Username of authenticated User","required":true},"address":{"type":"string","description":"Default email address of authenticated User","required":true},"scope":{"type":"string","description":"The scope this authentication is valid for","required":true},"require2fa":{"type":"array","items":{"type":"string","required":false},"description":"List of enabled 2FA mechanisms"},"requirePasswordChange":{"type":"boolean","description":"Indicates if account hassword has been reset and should be replaced","required":true},"token":{"type":"string","description":"If access token was requested then this is the value to use as access token when making API requests on behalf of logged in user.","required":false}},"required":["success","id","username","address","scope","require2fa","requirePasswordChange"]}}}}}},"delete":{"tags":["Authentication"],"summary":"Invalidate authentication token","description":"This method invalidates currently used authentication token. If token is not provided then nothing happens","operationId":"deleteauthenticate","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/authlog":{"get":{"tags":["Authentication"],"summary":"List authentication Events","operationId":"authlog","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"action","in":"query","description":"Limit listing only to values with specific action value","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"filterip","in":"query","description":"Limit listing only to values with specific IP address","required":false,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"action":{"type":"string","description":"Limit listing only to values with specific action value","required":true},"total":{"type":"number","description":"How many results were found","required":true},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true},"previousCursor":{"type":"string","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"},"nextCursor":{"type":"string","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetAuthlogResult"}}},"required":["success","action","total","page","results"]}}}}}}},"/users/:user/authlog/:event":{"get":{"tags":["Authentication"],"summary":"Request Event information","operationId":"getusersuserauthlogevent","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"event","in":"path","description":"ID of the Event","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID of the event","required":true},"action":{"type":"string","description":"Action identifier","required":true},"result":{"type":"string","description":"Did the action succeed","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false},"created":{"type":"string","description":"Datestring of the Event time","required":true,"format":"date-time"},"protocol":{"type":"string","description":"Protocol that the authentication was made from","required":false},"requiredScope":{"type":"string","description":"Scope of the auth","required":false},"last":{"type":"string","description":"Date of the last update of Event","required":true,"format":"date-time"},"events":{"type":"number","description":"Number of times same auth Event has occurred","required":true},"source":{"type":"string","description":"Source of auth. Example: `master` if password auth was used","required":false},"expires":{"type":"string","description":"After this date the given auth Event will not be updated and instead a new one will be created","required":true,"format":"date-time"}},"required":["id","action","result","created","last","events","expires"]}}}}}}},"/users/:user/autoreply":{"put":{"tags":["Autoreplies"],"summary":"Update Autoreply information","operationId":"putusersuserautoreply","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Is the autoreply enabled (true) or not (false)","required":false},"name":{"type":"string","description":"Name that is used for the From: header in autoreply message","required":false,"enum":[""]},"subject":{"type":"string","description":"Subject line for the autoreply. If empty then uses subject of the original message","required":false,"enum":[""]},"text":{"type":"string","description":"Plaintext formatted content of the autoreply message","required":false,"enum":[""]},"html":{"type":"string","description":"HTML formatted content of the autoreply message","required":false,"enum":[""]},"start":{"type":"string","description":"Datestring of the start of the autoreply or boolean false to disable start checks","required":false,"format":"date-time","enum":[false]},"end":{"type":"string","description":"Datestring of the end of the autoreply or boolean false to disable end checks","required":false,"format":"date-time","enum":[false]},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Autoreply ID","required":true}},"required":["success","id"]}}}}}},"get":{"tags":["Autoreplies"],"summary":"Request Autoreply information","operationId":"getusersuserautoreply","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"status":{"type":"boolean","description":"Is the autoreply enabled (true) or not (false)","required":false},"name":{"type":"string","description":"Name that is used for the From: header in autoreply message","required":false,"enum":[""]},"subject":{"type":"string","description":"Subject line for the autoreply. If empty then uses subject of the original message","required":false,"enum":[""]},"text":{"type":"string","description":"Plaintext formatted content of the autoreply message","required":false,"enum":[""]},"html":{"type":"string","description":"HTML formatted content of the autoreply message","required":false,"enum":[""]},"start":{"type":"string","description":"Datestring of the start of the autoreply or boolean false to disable start checks","required":false,"format":"date-time","enum":[false]},"end":{"type":"string","description":"Datestring of the end of the autoreply or boolean false to disable end checks","required":false,"format":"date-time","enum":[false]},"created":{"type":"string","description":"Datestring of when the Autoreply was created","required":true,"format":"date-time"}},"required":["success","created"]}}}}}},"delete":{"tags":["Autoreplies"],"summary":"Delete Autoreply information","operationId":"deleteusersuserautoreply","parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/users/:user/submit":{"post":{"tags":["Submission"],"summary":"Submit a Message for Delivery","description":"Use this method to send emails from a user account","operationId":"send","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mailbox":{"type":"string","description":"ID of the Mailbox","required":false},"from":{"$ref":"#/components/schemas/AddressOptionalName"},"replyTo":{"$ref":"#/components/schemas/AddressOptionalName"},"to":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the To: header"},"cc":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the Cc: header"},"bcc":{"type":"array","items":{"$ref":"#/components/schemas/AddressOptionalName"},"description":"Addresses for the Bcc: header"},"headers":{"type":"array","items":{"$ref":"#/components/schemas/Header"},"description":"Custom headers for the message. If reference message is set then In-Reply-To and References headers are set automatically"},"subject":{"type":"string","description":"Message subject. If not then resolved from Reference message","required":false},"text":{"type":"string","description":"Plaintext message","required":false},"html":{"type":"string","description":"HTML formatted message","required":false},"attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","description":"Attachment filename","required":false},"contentType":{"type":"string","description":"MIME type for the attachment file","required":false},"encoding":{"type":"string","description":"Encoding to use to store the attachments","required":false},"contentTransferEncoding":{"type":"string","description":"Transfer encoding","required":false},"contentDisposition":{"type":"string","description":"Content Disposition","required":false,"enum":["inline","attachment"]},"content":{"type":"string","description":"Base64 encoded attachment content","required":true},"cid":{"type":"string","description":"Content-ID value if you want to reference to this attachment from HTML formatted message","required":false}},"required":["content"]},"description":"Attachments for the message"},"meta":{"type":"object","description":"Optional metadata, must be an object or JSON formatted string","required":false,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false},"reference":{"$ref":"#/components/schemas/Reference"},"isDraft":{"type":"boolean","description":"Is the message a draft or not","required":false},"draft":{"type":"object","description":"Draft message to base this one on","properties":{"mailbox":{"type":"string","description":"ID of the Mailbox","required":true},"id":{"type":"number","description":"Message ID","required":true}},"required":["mailbox","id"]},"sendTime":{"type":"string","description":"Send time","required":false,"format":"date-time"},"uploadOnly":{"type":"boolean","description":"If true only uploads the message but does not send it","required":false},"envelope":{"type":"object","description":"Optional envelope","properties":{"from":{"$ref":"#/components/schemas/AddressOptionalName"},"to":{"type":"array","items":{"type":"object","description":"Addresses for the To: header","properties":{"name":{"type":"string","description":"Name of the sender","required":false},"address":{"type":"string","description":"Address of the sender","required":true}},"required":["address"]}}},"required":[]}},"required":[]}}},"required":true},"parameters":[{"name":"user","in":"path","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"message":{"$ref":"#/components/schemas/MessageWithQueueId"}},"required":["success","message"]}}}}}}},"/audit":{"post":{"tags":["Audit"],"summary":"Create new audit","description":"Initiates a message audit","operationId":"postaudit","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"start":{"type":"string","description":"Start time as ISO date","required":false,"format":"date-time","enum":[false]},"end":{"type":"string","description":"End time as ISO date","required":false,"format":"date-time","enum":[false]},"expires":{"type":"string","description":"Expiration date. Audit data is deleted after this date","required":true,"format":"date-time"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["user","expires"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID for the created Audit","required":true}},"required":["success","id"]}}}}}}},"/audit/:audit":{"get":{"tags":["Audit"],"summary":"Request Audit Info","description":"This method returns information about stored audit","operationId":"getauditaudit","parameters":[{"name":"audit","in":"path","description":"ID of the Audit","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Audit","required":true},"user":{"type":"string","description":"Example: `507f1f77bcf86cd799439011`\nID of the User","required":true},"start":{"type":"string","description":"Start time as ISO date","required":false,"format":"date-time","enum":[false]},"end":{"type":"string","description":"End time as ISO date","required":false,"format":"date-time","enum":[false]},"expires":{"type":"string","description":"Expiration date. Audit data is deleted after this date","required":true,"format":"date-time"},"import":{"type":"object","description":"Audit import data","properties":{"status":{"type":"string","description":"Status of the audit","required":true},"failed":{"type":"number","description":"How many messages failed","required":true},"copied":{"type":"number","description":"How many messages copied","required":true}},"required":["status","failed","copied"]}},"required":["success","id","user","expires","import"]}}}}}}},"/audit/:audit/export.mbox":{"get":{"tags":["Audit"],"summary":"Export Audited Emails","description":"This method returns a mailbox file that contains all audited emails","operationId":"getauditauditexportmbox","parameters":[{"name":"audit","in":"path","description":"ID of the Audit","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/octet-stream":{"schema":{"type":"string","required":false,"format":"binary"}}}}}}},"/domainaliases":{"get":{"tags":["DomainAliases"],"summary":"List registered Domain Aliases","operationId":"domainaliases","parameters":[{"name":"query","in":"query","description":"Partial match of a Domain Alias or Domain name","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetDomainAliasesResult"},"description":"Aliases listing"}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}},"post":{"tags":["DomainAliases"],"summary":"Create new Domain Alias","description":"Add a new Alias for a Domain. This allows to accept mail on username@domain and username@alias","operationId":"postdomainaliases","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"alias":{"type":"string","description":"Domain Alias","required":true},"domain":{"type":"string","description":"Domain name this Alias applies to","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["alias","domain"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Domain Alias","required":true}},"required":["success","id"]}}}}}}},"/domainaliases/resolve/:alias":{"get":{"tags":["DomainAliases"],"summary":"Resolve ID for a domain alias","operationId":"getdomainaliasesresolvealias","parameters":[{"name":"alias","in":"path","description":"Alias domain","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Unique ID (24 byte hex)","required":true}},"required":["success","id"]}}}}}}},"/domainaliases/:alias":{"get":{"tags":["DomainAliases"],"summary":"Request Alias information","operationId":"getdomainaliasesalias","parameters":[{"name":"alias","in":"path","description":"ID of the Alias","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Alias","required":true},"alias":{"type":"string","description":"Alias domain","required":true},"domain":{"type":"string","description":"Alias target","required":true},"created":{"type":"string","description":"Datestring of the time the alias was created","required":true,"format":"date-time"}},"required":["success","id","alias","domain","created"]}}}}}},"delete":{"tags":["DomainAliases"],"summary":"Delete an Alias","operationId":"deletedomainaliasesalias","parameters":[{"name":"alias","in":"path","description":"ID of the Alias","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/dkim":{"get":{"tags":["DKIM"],"summary":"List registered DKIM keys","operationId":"dkim","parameters":[{"name":"query","in":"query","description":"Partial match of a Domain name","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"query":{"type":"string","description":"Query string. Partial match of a Domain name","required":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetDkimKeysResult"},"description":"DKIM listing"}},"required":["success","total","page","previousCursor","nextCursor","query","results"]}}}}}},"post":{"tags":["DKIM"],"summary":"Create or update DKIM key for domain","description":"Add a new DKIM key for a Domain or update existing one. There can be single DKIM key registered for each domain name.","operationId":"postdkim","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain name this DKIM key applies to. Use \"*\" as a special value that will be used for domains that do not have their own DKIM key set","required":true},"selector":{"type":"string","description":"Selector for the key","required":true},"privateKey":{"oneOf":[{"type":"string","description":"PEM format RSA or ED25519 string","required":false},{"type":"string","description":"Raw ED25519 key 44 bytes long if using base64","required":false}],"description":"Pem formatted DKIM private key, raw ED25519 is also allowed. If not set then a new 2048 bit RSA key is generated, beware though that it can take several seconds to complete."},"description":{"type":"string","description":"Key description","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["domain","selector"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the DKIM","required":true},"domain":{"type":"string","description":"The domain this DKIM key applies to","required":true},"selector":{"type":"string","description":"DKIM selector","required":true},"description":{"type":"string","description":"Key description","required":true},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true},"publicKey":{"type":"string","description":"Public key in DNS format (no prefix/suffix, single line)","required":true},"dnsTxt":{"$ref":"#/components/schemas/DnsTxt"}},"required":["success","id","domain","selector","description","fingerprint","publicKey","dnsTxt"]}}}}}}},"/dkim/resolve/:domain":{"get":{"tags":["DKIM"],"summary":"Resolve ID for a DKIM domain","operationId":"getdkimresolvedomain","parameters":[{"name":"domain","in":"path","description":"DKIM domain","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"DKIM unique ID (24 byte hex)","required":true,"example":"609d201236d1d936948f23b1"}},"required":["success","id"]}}}}}}},"/dkim/:dkim":{"get":{"tags":["DKIM"],"summary":"Request DKIM information","operationId":"getdkimdkim","parameters":[{"name":"dkim","in":"path","description":"ID of the DKIM","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the DKIM","required":true},"domain":{"type":"string","description":"The domain this DKIM key applies to","required":true},"selector":{"type":"string","description":"DKIM selector","required":true},"description":{"type":"string","description":"Key description","required":true},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true},"publicKey":{"type":"string","description":"Public key in DNS format (no prefix/suffix, single line)","required":true},"dnsTxt":{"$ref":"#/components/schemas/DnsTxt"},"created":{"type":"string","description":"DKIM created datestring","required":true,"format":"date-time"}},"required":["success","id","domain","selector","description","fingerprint","publicKey","dnsTxt","created"]}}}}}},"delete":{"tags":["DKIM"],"summary":"Delete a DKIM key","operationId":"deletedkimdkim","parameters":[{"name":"dkim","in":"path","description":"ID of the DKIM","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/certs":{"get":{"tags":["Certs"],"summary":"List registered TLS certificates","operationId":"cert","parameters":[{"name":"query","in":"query","description":"Partial match of a server name","required":false,"schema":{"type":"string","example":"example.com"}},{"name":"altNames","in":"query","description":"Match `query` value against SAN as well (including wildcard names)","required":false,"schema":{"type":"boolean","example":"true"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"query":{"type":"string","description":"Initial query","required":false},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetTLSCertResult"}}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}},"post":{"tags":["Certs"],"summary":"Create or update TLS certificate for server name","description":"Add a new TLS certificate for a server name or update existing one. You can add a single certificate for each server name but SAN names are supported as well. For example you can add a certificate for \"mydomain.com\" that includes \"*.mydomain.com\" in SAN and the same certificate would be used for requests that do not have it's own server name registered but match the SAN value.\n> NB! you must ensure yourself that the `servername` value is actually listed in certificate's common name or SAN as WildDuck is going to use this certificate regardless.","operationId":"postcerts","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"servername":{"type":"string","description":"Server name this TLS certificate applies to","required":true},"privateKey":{"type":"string","description":"PEM formatted TLS private key. Optional if certificate is managed by ACME","required":false},"cert":{"type":"string","description":"PEM formatted TLS certificate or a certificate bundle with concatenated certificate and CA chain. Optional if certificate is managed by ACME","required":false},"ca":{"type":"array","items":{"type":"string","required":false},"description":"CA chain certificates. Not needed if `cert` value is a bundle"},"description":{"type":"string","description":"Certificate description","required":false},"acme":{"type":"boolean","description":"If true then private key and certificate are managed automatically by ACME","required":false},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["servername"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the certificate","required":true,"example":"609d201236d1d936948f23b1"},"servername":{"type":"string","description":"The server name this certificate applies to","required":true,"example":"imap.example.com"},"description":{"type":"string","description":"Key description","required":true,"example":"Some notes about this certificate"},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true,"example":"59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3"},"expires":{"type":"string","description":"Certificate expiration time","required":true,"format":"date-time","example":"2024-06-26T21:55:55.000Z"},"altNames":{"type":"array","items":{"type":"string","required":true},"description":"SAN servernames listed in the certificate"},"acme":{"type":"boolean","description":"If true then private key and certificate are managed automatically by ACME","required":true}},"required":["success","id","servername","description","fingerprint","expires","altNames","acme"]}}}}}}},"/certs/resolve/:servername":{"get":{"tags":["Certs"],"summary":"Resolve ID for a server name","operationId":"getcertsresolveservername","parameters":[{"name":"servername","in":"path","description":"Server name","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"Unique ID of the cert (24 byte hex)","required":true,"example":"609d201236d1d936948f23b1"}},"required":["success","id"]}}}}}}},"/certs/:cert":{"get":{"tags":["Certs"],"summary":"Request TLS certificate information","operationId":"getcertscert","parameters":[{"name":"cert","in":"path","description":"ID of the TLS certificate","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the certificate","required":true,"example":"609d201236d1d936948f23b1"},"servername":{"type":"string","description":"The server name this certificate applies to","required":true,"example":"imap.example.com"},"description":{"type":"string","description":"Key description","required":true,"example":"Some notes about this certificate"},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true,"example":"59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3"},"expires":{"type":"string","description":"Certificate expiration time","required":true,"format":"date-time","example":"2024-06-26T21:55:55.000Z"},"created":{"type":"string","description":"Created datestring","required":true,"format":"date-time","example":"2024-05-13T20:06:46.179Z"},"autogenerated":{"type":"boolean","description":"Was the certificate automatically generated on SNI request","required":false},"altNames":{"type":"array","items":{"type":"string","required":true},"description":"SAN servernames listed in the certificate"},"acme":{"type":"boolean","description":"If true then private key and certificate are managed automatically by ACME","required":true},"hasCert":{"type":"boolean","description":"True if certificate actually has the certificate or private key","required":true}},"required":["success","id","servername","description","fingerprint","expires","created","altNames","acme","hasCert"]}}}}}},"delete":{"tags":["Certs"],"summary":"Delete a TLS certificate","operationId":"deletecertscert","parameters":[{"name":"cert","in":"path","description":"ID of the TLS certificate","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List registered Webhooks","operationId":"webhooks","parameters":[{"name":"type","in":"query","description":"Prefix or exact match. Prefix match must end with \".*\", eg \"channel.*\". Use \"*\" for all types","required":false,"schema":{"type":"string"}},{"name":"user","in":"query","description":"User ID","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"How many records to return","required":false,"schema":{"type":"number"}},{"name":"next","in":"query","description":"Cursor value for next page, retrieved from nextCursor response value","required":false,"schema":{"type":"string","example":"eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0"}},{"name":"previous","in":"query","description":"Cursor value for previous page, retrieved from previousCursor response value","required":false,"schema":{"type":"string","example":"TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR"}},{"name":"page","in":"query","description":"Current page number. Informational only, page numbers start from 1","required":false,"schema":{"type":"number"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"total":{"type":"number","description":"How many results were found","required":true,"example":541},"page":{"type":"number","description":"Current page number. Derived from page query argument","required":true,"example":1},"previousCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any previous results"},"nextCursor":{"oneOf":[{"type":"string","required":false},{"type":"boolean","required":false}],"description":"Either a cursor string or false if there are not any next results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GetWebhooksResult"},"description":"Webhook listing"}},"required":["success","total","page","previousCursor","nextCursor","results"]}}}}}},"post":{"tags":["Webhooks"],"summary":"Create new Webhook","operationId":"postwebhooks","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"array","items":{"type":"string","required":false},"description":"An array of event types to match. For prefix match use \".*\" at the end (eg. \"user.*\") or \"*\" for all types"},"user":{"type":"string","description":"User ID to match (only makes sense for user specific resources)","required":false},"url":{"type":"string","description":"URL to POST data to","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["type","url"]}}},"required":true},"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"id":{"type":"string","description":"ID of the Webhook","required":true}},"required":["success","id"]}}}}}}},"/webhooks/:webhook":{"delete":{"tags":["Webhooks"],"summary":"Delete a webhook","operationId":"deletewebhookswebhook","parameters":[{"name":"webhook","in":"path","description":"ID of the Webhook","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}}}}},"/settings":{"get":{"tags":["Settings"],"summary":"List registered Settings","operationId":"settings","parameters":[{"name":"filter","in":"query","description":"Optional partial match of the Setting key","required":false,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"filter":{"type":"string","description":"Partial match if requested","required":false},"settings":{"type":"array","items":{"$ref":"#/components/schemas/GetSettingsResult"},"description":"Setting listing"}},"required":["success","settings"]}}}}}}},"/settings/:key":{"post":{"tags":["Settings"],"summary":"Create or Update Setting","description":"Create a new or update an existing setting","operationId":"postsettingskey","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"object","description":"Setting value","required":true,"format":"any"},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false}},"required":["value"]}}},"required":true},"parameters":[{"name":"key","in":"path","description":"Key of the Setting","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"key":{"type":"string","description":"Key of the Setting","required":true}},"required":["success","key"]}}}}}},"get":{"tags":["Settings"],"summary":"Get Setting value","operationId":"getsettingskey","parameters":[{"name":"key","in":"path","description":"Key of the Setting","required":true,"schema":{"type":"string"}},{"name":"sess","in":"query","description":"Session identifier for the logs","required":false,"schema":{"type":"string"}},{"name":"ip","in":"query","description":"IP address for the logs ","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"key":{"type":"string","description":"Key of the Setting","required":true},"value":{"oneOf":[{"type":"string","description":"Setting value","required":false},{"type":"number","description":"Setting value","required":false}],"description":"Setting value"},"error":{"type":"string","description":"Error if present","required":false,"example":"Key was not found"}},"required":["success","key"]}}}}}}},"/health":{"get":{"tags":["Health"],"summary":"Check the health of the API","description":"Check the status of the WildDuck API service, that is if db is connected and readable/writable, same for redis.","operationId":"gethealth","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true}},"required":["success"]}}}},"500":{"description":"Failed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates successful response","required":true,"example":true},"message":{"type":"string","description":"Error message specifying what went wrong","required":true}},"required":["success","message"]}}}}}}}},"components":{"schemas":{"Quota":{"type":"object","description":"Quota usage limits","properties":{"allowed":{"type":"number","description":"Allowed quota of the user in bytes","required":true},"used":{"type":"number","description":"Space used in bytes","required":true}},"required":["allowed","used"]},"GetUsersResult":{"type":"object","properties":{"id":{"type":"string","description":"Users unique ID (24byte hex)","required":true},"username":{"type":"string","description":"Username of the User","required":true},"name":{"type":"string","description":"Name of the User","required":true},"address":{"type":"string","description":"Main email address of the User","required":true},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the User"},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets"},"enabled2fa":{"type":"array","items":{"type":"string","required":false},"description":"List of enabled 2FA methods"},"autoreply":{"type":"boolean","description":"Is autoreply enabled or not (start time may still be in the future or end time in the past)","required":true},"encryptMessages":{"type":"boolean","description":"If true then received messages are encrypted","required":true},"encryptForwarded":{"type":"boolean","description":"If true then forwarded messages are encrypted","required":true},"quota":{"$ref":"#/components/schemas/Quota"},"metaData":{"type":"object","description":"Custom metadata value. Included if metaData query argument was true","properties":{},"required":[]},"internalData":{"type":"object","description":"Custom metadata value for internal use. Included if internalData query argument was true and request was not made using user-role token","properties":{},"required":[]},"hasPasswordSet":{"type":"boolean","description":"If true then the User has a password set and can authenticate","required":true},"activated":{"type":"boolean","description":"Is the account activated","required":true},"disabled":{"type":"boolean","description":"If true then user can not authenticate or receive any new mail","required":true},"suspended":{"type":"boolean","description":"If true then user can not authenticate","required":true}},"required":["id","username","name","address","tags","targets","enabled2fa","autoreply","encryptMessages","encryptForwarded","hasPasswordSet","activated","disabled","suspended"]},"Mailboxes":{"type":"object","description":"Optional names for special mailboxes","properties":{"sent":{"type":"string","required":false},"trash":{"type":"string","required":false},"junk":{"type":"string","required":false},"drafts":{"type":"string","required":false}},"required":[]},"KeyInfo":{"type":"object","description":"Information about public key or false if key is not available","properties":{"name":{"type":"string","description":"Name listed in public key","required":true},"address":{"type":"string","description":"E-mail address listed in public key","required":true},"fingerprint":{"type":"string","description":"Fingerprint of the public key","required":true}},"required":["name","address","fingerprint"]},"Recipients":{"type":"object","description":"Sending quota","properties":{"allowed":{"type":"number","description":"How many messages per 24 hours can be send","required":true},"used":{"type":"number","description":"How many messages are sent during current 24 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 24 hour period","required":true}},"required":["allowed","used","ttl"]},"Filters":{"type":"object","description":"Sending quota","properties":{"allowed":{"type":"number","description":"How many filters are allowed","required":true},"used":{"type":"number","description":"How many filters have been created","required":true}},"required":["allowed","used"]},"Forwards":{"type":"object","description":"Forwarding quota","properties":{"allowed":{"type":"number","description":"How many messages per 24 hours can be forwarded","required":true},"used":{"type":"number","description":"How many messages are forwarded during current 24 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 24 hour period","required":true}},"required":["allowed","used","ttl"]},"Received":{"type":"object","description":"Receiving quota","properties":{"allowed":{"type":"number","description":"How many messages per 1 hour can be received","required":true},"used":{"type":"number","description":"How many messages are received during current 1 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 1 hour period","required":true}},"required":["allowed","used","ttl"]},"ImapUpload":{"type":"object","description":"IMAP upload quota","properties":{"allowed":{"type":"number","description":"How many bytes per 24 hours can be uploaded via IMAP. Only message contents are counted, not protocol overhead.","required":true},"used":{"type":"number","description":"How many bytes are uploaded during current 24 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 24 hour period","required":true}},"required":["allowed","used","ttl"]},"ImapDownload":{"type":"object","description":"IMAP download quota","properties":{"allowed":{"type":"number","description":"How many bytes per 24 hours can be downloaded via IMAP. Only message contents are counted, not protocol overhead.","required":true},"used":{"type":"number","description":"How many bytes are downloaded during current 24 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 24 hour period","required":true}},"required":["allowed","used","ttl"]},"Pop3Download":{"type":"object","description":"POP3 download quota","properties":{"allowed":{"type":"number","description":"How many bytes per 24 hours can be downloaded via POP3. Only message contents are counted, not protocol overhead.","required":true},"used":{"type":"number","description":"How many bytes are downloaded during current 24 hour period","required":true},"ttl":{"type":"number","description":"Time until the end of current 24 hour period","required":true}},"required":["allowed","used","ttl"]},"ImapMaxConnections":{"type":"object","description":"a","properties":{"allowed":{"type":"number","description":"How many parallel IMAP connections are permitted","required":true},"used":{"type":"number","description":"How many parallel IMAP connections are currently in use","required":true}},"required":["allowed","used"]},"UserLimits":{"type":"object","description":"Account limits and usage","properties":{"quota":{"$ref":"#/components/schemas/Quota"},"recipients":{"$ref":"#/components/schemas/Recipients"},"filters":{"$ref":"#/components/schemas/Filters"},"forwards":{"$ref":"#/components/schemas/Forwards"},"received":{"$ref":"#/components/schemas/Received"},"imapUpload":{"$ref":"#/components/schemas/ImapUpload"},"imapDownload":{"$ref":"#/components/schemas/ImapDownload"},"pop3Download":{"$ref":"#/components/schemas/Pop3Download"},"imapMaxConnections":{"$ref":"#/components/schemas/ImapMaxConnections"}},"required":["recipients","filters","forwards","received","imapUpload","imapDownload","pop3Download"]},"GetAddressesResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Address","required":true},"name":{"type":"string","description":"Identity name","required":true},"address":{"type":"string","description":"E-mail address string","required":true},"user":{"type":"string","description":"User ID this address belongs to if this is a User address","required":true},"forwarded":{"type":"boolean","description":"If true then it is a forwarded address","required":true},"forwardedDisabled":{"type":"boolean","description":"If true then the forwarded address is disabled","required":true},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the Address"},"metaData":{"type":"object","description":"Metadata object (if available)","properties":{},"required":[]},"internalData":{"type":"object","description":"Internal metadata object (if available), not included for user-role requests","properties":{},"required":[]}},"required":["id","name","address","user","forwarded","forwardedDisabled","tags"]},"GetUserAddressesResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Address","required":true},"name":{"type":"string","description":"Identity name","required":true},"address":{"type":"string","description":"E-mail Address","required":true},"main":{"type":"boolean","description":"Indicates if this is the default address for the User","required":true},"created":{"type":"string","description":"Datestring of the time the address was created","required":true,"format":"date-time"},"tags":{"type":"array","items":{"type":"string","required":false},"description":"List of tags associated with the Address"},"metaData":{"type":"object","description":"Metadata object (if available)","properties":{},"required":[]},"internalData":{"type":"object","description":"Internal metadata object (if available), not included for user-role requests","properties":{},"required":[]}},"required":["id","name","address","main","created","tags"]},"GetUserAddressesregisterResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Address","required":true},"name":{"type":"string","description":"Name from address header","required":false},"address":{"type":"string","description":"E-mail Address","required":true}},"required":["id","address"]},"Autoreply":{"type":"object","description":"Autoreply information","properties":{"status":{"type":"boolean","description":"If true, then autoreply is enabled for this address","required":false},"start":{"type":"string","description":"Either a date string or boolean false to disable start time checks","required":false,"format":"date-time","enum":[false]},"end":{"type":"string","description":"Either a date string or boolean false to disable end time checks","required":false,"format":"date-time","enum":[false]},"name":{"type":"string","description":"Name that is used for the From: header in autoreply message","required":false},"subject":{"type":"string","description":"Autoreply subject line","required":false},"text":{"type":"string","description":"Autoreply plaintext content","required":false},"html":{"type":"string","description":"Autoreply HTML content","required":false}},"required":[]},"AddressLimits":{"type":"object","description":"Account limits and usage","properties":{"forwards":{"$ref":"#/components/schemas/Forwards"}},"required":["forwards"]},"AutoreplyInfo":{"type":"object","description":"Autoreply information","properties":{"status":{"type":"boolean","description":"If true, then autoreply is enabled for this address","required":true},"name":{"type":"string","description":"Name that is used for the From: header in autoreply message","required":true},"subject":{"type":"string","description":"Autoreply subject line","required":true},"text":{"type":"string","description":"Autoreply plaintext content","required":true},"html":{"type":"string","description":"Autoreply HTML content","required":true}},"required":["status","name","subject","text","html"]},"Address":{"type":"object","properties":{"name":{"type":"string","description":"Name of the sender/recipient","required":true},"address":{"type":"string","description":"Address of the sender/recipient","required":true}},"required":["name","address"]},"ReferenceWithAttachments":{"type":"object","properties":{"mailbox":{"type":"string","description":"ID of the Mailbox","required":true},"id":{"type":"number","description":"Message ID","required":true},"action":{"type":"string","description":"Either reply, replyAll or forward","required":true,"enum":["reply","replyAll","forward"]},"attachments":{"oneOf":[{"type":"boolean","required":false},{"type":"array","items":{"type":"string","required":false}}],"description":"If true, then includes all attachments from the original message. If it is an array of attachment ID's includes attachments from the list"}},"required":["mailbox","id","action"]},"Bimi":{"type":"object","description":"Marks BIMI verification as passed for a domain. NB! BIMI record and logo files for the domain must be valid.","properties":{"domain":{"type":"string","description":"Domain name for the BIMI record. It does not have to be the same as the From address.","required":true},"selector":{"type":"string","description":"Optional BIMI selector","required":false}},"required":["domain"]},"ContentType":{"type":"object","description":"Parsed Content-Type header. Usually needed to identify encrypted messages and such","properties":{"value":{"type":"string","description":"MIME type of the message, eg. \"multipart/mixed\"","required":true},"params":{"type":"object","description":"An object with Content-Type params as key-value pairs","properties":{},"required":[]}},"required":["value","params"]},"GetMessagesResult":{"type":"object","properties":{"id":{"type":"number","description":"ID of the Message","required":true},"mailbox":{"type":"string","description":"ID of the Mailbox","required":true},"thread":{"type":"string","description":"ID of the Thread","required":true},"threadMessageCount":{"type":"number","description":"Amount of messages in the Thread. Included if threadCounters query argument was true","required":false},"from":{"$ref":"#/components/schemas/Address"},"to":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"Recipients in To: field"},"cc":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"Recipients in Cc: field"},"bcc":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"Recipients in Bcc: field. Usually only available for drafts"},"messageId":{"type":"string","description":"Message ID","required":true},"subject":{"type":"string","description":"Message subject","required":true},"date":{"type":"string","description":"Date string from header","required":true,"format":"date-time"},"idate":{"type":"string","description":"Date string of receive time","required":false,"format":"date-time"},"intro":{"type":"string","description":"First 128 bytes of the message","required":true},"attachments":{"type":"boolean","description":"Does the message have attachments","required":true},"size":{"type":"number","description":"Message size in bytes","required":true},"seen":{"type":"boolean","description":"Is this message already seen or not","required":true},"deleted":{"type":"boolean","description":"Does this message have a Deleted flag (should not have as messages are automatically deleted once this flag is set)","required":true},"flagged":{"type":"boolean","description":"Does this message have a Flagged flag","required":true},"draft":{"type":"boolean","description":"is this message a draft","required":true},"answered":{"type":"boolean","description":"Does this message have a Answered flag","required":true},"forwarded":{"type":"boolean","description":"Does this message have a $Forwarded flag","required":true},"references":{"type":"array","items":{"$ref":"#/components/schemas/ReferenceWithAttachments"},"description":"References"},"bimi":{"$ref":"#/components/schemas/Bimi"},"contentType":{"$ref":"#/components/schemas/ContentType"},"encrypted":{"type":"boolean","description":"Specifies whether the message is encrypted","required":false},"metaData":{"type":"object","description":"Custom metadata value. Included if metaData query argument was true","properties":{},"required":[]},"headers":{"type":"object","description":"Header object keys requested with the includeHeaders argument","properties":{},"required":[]}},"required":["id","mailbox","thread","to","cc","bcc","messageId","subject","date","intro","attachments","size","seen","deleted","flagged","draft","answered","forwarded","references","bimi","contentType"]},"AddressOptionalName":{"type":"object","description":"Address for the From: header","properties":{"name":{"type":"string","description":"Name of the sender","required":false},"address":{"type":"string","description":"Address of the sender","required":true}},"required":["address"]},"Header":{"type":"object","properties":{"key":{"type":"string","description":"Header key ('X-Mailer')","required":false},"value":{"type":"string","description":"Header value ('My Awesome Mailing Service')","required":false}},"required":[]},"Attachment":{"type":"object","properties":{"filename":{"type":"string","description":"Attachment filename","required":false},"contentType":{"type":"string","description":"MIME type for the attachment file","required":false},"encoding":{"type":"string","description":"Encoding to use to store the attachments","required":false},"contentTransferEncoding":{"type":"string","description":"Transfer encoding","required":false},"content":{"type":"string","description":"Base64 encoded attachment content","required":true},"cid":{"type":"string","description":"Content-ID value if you want to reference to this attachment from HTML formatted message","required":false},"contentDisposition":{"type":"string","description":"Content Disposition","required":false,"enum":["inline","attachment"]}},"required":["content"]},"Rcpt":{"type":"object","properties":{"value":{"type":"string","description":"RCPT TO address as provided by SMTP client","required":true},"formatted":{"type":"string","description":"Normalized RCPT address","required":true}},"required":["value","formatted"]},"Envelope":{"type":"object","description":"SMTP envelope (if available)","properties":{"from":{"type":"string","description":"Address from MAIL FROM","required":true},"rcpt":{"type":"array","items":{"$ref":"#/components/schemas/Rcpt"},"description":"Array of addresses from RCPT TO (should have just one normally)"}},"required":["from"]},"List":{"type":"object","description":"If set then this message is from a mailing list","properties":{"id":{"type":"string","description":"Value from List-ID header","required":true},"unsubscribe":{"type":"string","description":"Value from List-Unsubscribe header","required":true}},"required":["id","unsubscribe"]},"Tls":{"type":"object","description":"TLS information. Value is false if TLS was not used","properties":{"name":{"type":"object","description":"Cipher name, eg \"ECDHE-RSA-AES128-GCM-SHA256\"","properties":{},"required":[]},"version":{"type":"object","description":"TLS version, eg \"TLSv1/SSLv3\"","properties":{},"required":[]}},"required":["name","version"]},"Forwarded":{"type":"object","properties":{"seq":{"type":"string","description":"Sequence ID","required":true},"type":{"type":"string","description":"Target type","required":true},"value":{"type":"string","description":"Target address","required":true}},"required":["seq","type","value"]},"Message":{"type":"object","description":"Message information","properties":{"id":{"type":"number","description":"Message ID in mailbox","required":true},"mailbox":{"type":"string","description":"Mailbox ID the message was stored into","required":true},"size":{"type":"number","description":"Size of the RFC822 formatted email","required":true}},"required":["id","mailbox","size"]},"GetFilesResult":{"type":"object","properties":{"id":{"type":"string","description":"File ID","required":true},"filename":{"oneOf":[{"type":"string","required":true},{"type":"boolean","required":true}],"description":"Filename. False if none"},"contentType":{"oneOf":[{"type":"string","required":true},{"type":"boolean","required":true}],"description":"Content-Type of the file. False if none"},"cid":{"type":"string","description":"Content ID","required":false},"size":{"type":"number","description":"File size","required":true},"created":{"type":"string","description":"Created datestring","required":true,"format":"date-time"},"md5":{"type":"string","description":"md5 hash","required":true}},"required":["id","filename","contentType","size","created","md5"]},"GetAllFiltersResult":{"type":"object","properties":{"id":{"type":"string","description":"Filter ID","required":true},"user":{"type":"string","description":"User ID","required":true},"name":{"type":"string","description":"Name for the filter","required":true},"created":{"type":"string","description":"Datestring of the time the filter was created","required":true,"format":"date-time"},"query":{"type":"array","items":{"type":"array","items":{"type":"string","required":false}},"description":"Filter query strings"},"action":{"type":"array","items":{"type":"array","items":{"type":"string","required":false}},"description":"Filter action strings"},"disabled":{"type":"boolean","description":"If true, then this filter is ignored","required":true},"metaData":{"type":"object","description":"Custom metadata value. Included if metaData query argument was true","properties":{},"required":[]},"targets":{"type":"array","items":{"type":"string","required":false},"description":"List of forwarding targets"}},"required":["id","user","name","created","query","action","disabled"]},"GetFiltersResult":{"type":"object","properties":{"id":{"type":"string","description":"Filter ID","required":true},"name":{"type":"string","description":"Name for the filter","required":true},"created":{"type":"string","description":"Datestring of the time the filter was created","required":true,"format":"date-time"},"query":{"type":"array","items":{"type":"array","items":{"type":"string","required":false}},"description":"Filter query strings"},"action":{"type":"array","items":{"type":"array","items":{"type":"string","required":false}},"description":"Filter action strings"},"disabled":{"type":"boolean","description":"If true, then this filter is ignored","required":true},"metaData":{"type":"object","description":"Custom metadata value. Included if metaData query argument was true","properties":{},"required":[]}},"required":["id","name","created","query","action","disabled"]},"Query":{"type":"object","description":"Rules that a message must match","properties":{"from":{"type":"string","description":"Partial match for the From: header (case insensitive)","required":false},"to":{"type":"string","description":"Partial match for the To:/Cc: headers (case insensitive)","required":false},"subject":{"type":"string","description":"Partial match for the Subject: header (case insensitive)","required":false},"listId":{"type":"string","description":"Partial match for the List-ID: header (case insensitive)","required":false},"text":{"type":"string","description":"Fulltext search against message text","required":false},"ha":{"type":"boolean","description":"Does a message have to have an attachment or not","required":false},"size":{"type":"number","description":"Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value","required":false}},"required":[]},"Action":{"type":"object","description":"Action to take with a matching message","properties":{"seen":{"type":"boolean","description":"If true then mark matching messages as Seen","required":false},"flag":{"type":"boolean","description":"If true then mark matching messages as Flagged","required":false},"delete":{"type":"boolean","description":"If true then do not store matching messages","required":false},"spam":{"type":"boolean","description":"If true then store matching messages to Junk Mail folder","required":false},"mailbox":{"type":"string","description":"Mailbox ID to store matching messages to","required":false},"targets":{"type":"array","items":{"type":"string","required":false},"description":"An array of forwarding targets. The value could either be an email address or a relay url to next MX server (\"smtp://mx2.zone.eu:25\") or an URL where mail contents are POSTed to"}},"required":[]},"GetAllowedDomainResult":{"type":"object","properties":{"id":{"type":"string","description":"Entry ID","required":true},"domain":{"type":"string","description":"Allowlisted domain name","required":true},"action":{"type":"string","description":"Action: `allow`","required":true,"example":"allow"}},"required":["id","domain","action"]},"GetBlockedDomainResult":{"type":"object","properties":{"id":{"type":"string","description":"Entry ID","required":true},"domain":{"type":"string","description":"Blocklisted domain name","required":true},"action":{"type":"string","description":"Action: `block`","required":true,"example":"block"}},"required":["id","domain","action"]},"LastUse":{"type":"object","description":"Information about last use","properties":{"time":{"type":"string","description":"Datestring of last use or false if password has not been used","required":true,"format":"date-time"},"event":{"type":"string","description":"Event ID of the security log for the last authentication","required":true}},"required":["time","event"]},"GetASPsResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Application Password","required":true},"description":{"type":"string","description":"Description","required":true},"scopes":{"type":"array","items":{"type":"string","required":true,"enum":["imap","pop3","smtp","*"]},"description":"Allowed scopes for the Application Password"},"lastUse":{"$ref":"#/components/schemas/LastUse"},"created":{"type":"string","description":"Datestring","required":true,"format":"date-time"},"expires":{"type":"string","description":"Application password expires after the given date","required":true,"format":"date-time"}},"required":["id","description","scopes","lastUse","created","expires"]},"GetAuthlogResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the event","required":true},"action":{"type":"string","description":"Action identifier","required":true},"result":{"type":"string","description":"Did the action succeed","required":true},"sess":{"type":"string","description":"Session identifier for the logs","required":false},"ip":{"type":"string","description":"IP address for the logs ","required":false},"created":{"type":"string","description":"Datestring of the Event time","required":true,"format":"date-time"},"protocol":{"type":"string","description":"Protocol that the authentication was made from","required":false},"requiredScope":{"type":"string","description":"Scope of the auth","required":false},"last":{"type":"string","description":"Date of the last update of data","required":true,"format":"date-time"},"events":{"type":"number","description":"Number of times same auth log has occurred","required":true},"source":{"type":"string","description":"Source of auth. Example: `master` if password auth was used","required":false},"expires":{"type":"string","description":"After this date the given auth log document will not be updated and instead a new one will be created","required":true,"format":"date-time"}},"required":["id","action","result","created","last","events","expires"]},"Reference":{"type":"object","description":"Optional referenced email. If uploaded message is a reply draft and relevant fields are not provided then these are resolved from the message to be replied to","properties":{"mailbox":{"type":"string","description":"ID of the Mailbox","required":true},"id":{"type":"number","description":"Message ID","required":true},"action":{"type":"string","description":"Either reply, replyAll or forward","required":true,"enum":["reply","replyAll","forward"]}},"required":["mailbox","id","action"]},"MessageWithQueueId":{"type":"object","description":"Information about submitted Message","properties":{"mailbox":{"type":"string","description":"Mailbox ID the message was stored to","required":true},"id":{"type":"number","description":"Message ID in the Mailbox","required":true},"queueId":{"type":"string","description":"Queue ID in MTA","required":true}},"required":["mailbox","id","queueId"]},"GetDomainAliasesResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the Domain Alias","required":true},"alias":{"type":"string","description":"Domain Alias","required":true},"domain":{"type":"string","description":"The domain this alias applies to","required":true}},"required":["id","alias","domain"]},"GetDkimKeysResult":{"type":"object","properties":{"id":{"type":"string","description":"ID of the DKIM","required":true},"domain":{"type":"string","description":"The domain this DKIM key applies to","required":true},"selector":{"type":"string","description":"DKIM selector","required":true},"description":{"type":"string","description":"Key description","required":true},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true},"created":{"type":"string","description":"DKIM created datestring","required":true,"format":"date-time"}},"required":["id","domain","selector","description","fingerprint","created"]},"DnsTxt":{"type":"object","description":"Value for DNS TXT entry","properties":{"name":{"type":"string","description":"Is the domain name of TXT","required":true},"value":{"type":"string","description":"Is the value of TXT","required":true}},"required":["name","value"]},"GetTLSCertResult":{"type":"object","description":"Certificate listing","properties":{"id":{"type":"string","description":"ID of the certificate","required":true,"example":"609d201236d1d936948f23b1"},"servername":{"type":"string","description":"The server name this certificate applies to","required":true,"example":"imap.example.com"},"acme":{"type":"boolean","description":"If true then private key and certificate are managed automatically by ACME","required":true},"description":{"type":"string","description":"Key description","required":true,"example":"Some notes about this certificate"},"fingerprint":{"type":"string","description":"Key fingerprint (SHA1)","required":true,"example":"59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3"},"created":{"type":"string","description":"Datestring","required":true,"format":"date-time","example":"2024-03-13T20:06:46.179Z"},"expires":{"type":"string","description":"Certificate expiration time","required":true,"format":"date-time","example":"2024-04-26T21:55:55.000Z"},"autogenerated":{"type":"boolean","description":"Was the certificate automatically generated on SNI request","required":false},"altNames":{"type":"array","items":{"type":"string","required":true},"description":"SAN servernames listed in the certificate"}},"required":["id","servername","acme","description","fingerprint","created","expires","altNames"]},"GetWebhooksResult":{"type":"object","properties":{"id":{"type":"string","description":"Webhooks unique ID (24 byte hex)","required":true},"type":{"type":"array","items":{"type":"string","required":false},"description":"An array of event types this webhook matches"},"user":{"type":"string","description":"User ID or null","required":true},"url":{"type":"string","description":"Webhook URL","required":true}},"required":["id","type","user","url"]},"GetSettingsResult":{"type":"object","properties":{"key":{"type":"string","description":"Setting key","required":true},"value":{"oneOf":[{"type":"string","description":"Setting value","required":false},{"type":"number","description":"Setting value","required":false}],"description":"Setting value"},"name":{"type":"string","description":"Setting name","required":true},"description":{"type":"string","description":"Setting description","required":true},"type":{"type":"string","description":"Value subtype","required":true},"custom":{"type":"boolean","description":"If true then the value is set","required":true}},"required":["key","value","name","description","type","custom"]}},"securitySchemes":{"AccessTokenAuth":{"name":"X-Access-Token","type":"apiKey","in":"header","description":"If authentication is enabled in the WildDuck configuration, you will need to supply an access token in the `X-Access-Token` header.\n```json\n{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}\n```\n"}}},"security":[{"AccessTokenAuth":[]}]} \ No newline at end of file diff --git a/docs/in-depth/command-line.md b/docs/in-depth/command-line.md index 77e648ea..62747366 100644 --- a/docs/in-depth/command-line.md +++ b/docs/in-depth/command-line.md @@ -75,7 +75,7 @@ wduck-users() { } ``` -### Query user informations +### Query user information ``` curl -i http://localhost:8080/users/$USERID diff --git a/imap-core/lib/commands/copy.js b/imap-core/lib/commands/copy.js index 2d99d585..6fb8424d 100644 --- a/imap-core/lib/commands/copy.js +++ b/imap-core/lib/commands/copy.js @@ -48,7 +48,7 @@ module.exports = { _user: this.session.user.id.toString(), _mailbox: this.selected.mailbox, _sess: this.id, - _message_count: messages.lentgh + _message_count: messages.length }; this._server.onCopy( diff --git a/imap-core/lib/commands/list.js b/imap-core/lib/commands/list.js index 00652b9d..533dd887 100644 --- a/imap-core/lib/commands/list.js +++ b/imap-core/lib/commands/list.js @@ -153,7 +153,7 @@ module.exports = { let specialUseFlag = folder.specialUse; if (specialUseFlag) { if (isXlist && XlistTags.has(specialUseFlag)) { - // rewite flag to XLIST tag which is a bit different + // rewrite flag to XLIST tag which is a bit different specialUseFlag = XlistTags.get(specialUseFlag); } flags.push(specialUseFlag); diff --git a/imap-core/lib/commands/move.js b/imap-core/lib/commands/move.js index e30b89c8..c5bf4f69 100644 --- a/imap-core/lib/commands/move.js +++ b/imap-core/lib/commands/move.js @@ -48,7 +48,7 @@ module.exports = { _user: this.session.user.id.toString(), _mailbox: this.selected.mailbox, _sess: this.id, - _message_count: messages.lentgh + _message_count: messages.length }; this._server.onMove( diff --git a/imap-core/lib/commands/namespace.js b/imap-core/lib/commands/namespace.js index f5947424..acb81915 100644 --- a/imap-core/lib/commands/namespace.js +++ b/imap-core/lib/commands/namespace.js @@ -4,7 +4,7 @@ module.exports = { state: ['Authenticated', 'Selected'], handler(command, callback) { - // fixed structre + // fixed structure this.send('* NAMESPACE (("" "/")) NIL NIL'); callback(null, { diff --git a/imap-core/lib/commands/search.js b/imap-core/lib/commands/search.js index 8c672490..9b7df2d8 100644 --- a/imap-core/lib/commands/search.js +++ b/imap-core/lib/commands/search.js @@ -223,7 +223,7 @@ function parseQueryTerms(terms, uidList) { break; case 'or': - // ensure that value is alwas an array + // ensure that value is always an array response.value = [].concat(curTerm.slice(1) || []); break; diff --git a/imap-core/lib/commands/store.js b/imap-core/lib/commands/store.js index bb6426be..f9167779 100644 --- a/imap-core/lib/commands/store.js +++ b/imap-core/lib/commands/store.js @@ -47,7 +47,7 @@ module.exports = { let type = 'flags'; // currently hard coded, in the future might support other values as well, eg. X-GM-LABELS let range = (command.attributes[0] && command.attributes[0].value) || ''; - // if arguments include extenstions at index 1, then length is 4, otherwise 3 + // if arguments include extensions at index 1, then length is 4, otherwise 3 let pos = command.attributes.length === 4 ? 1 : 0; let action = ((command.attributes[pos + 1] && command.attributes[pos + 1].value) || '').toString().toUpperCase(); @@ -124,7 +124,7 @@ module.exports = { _user: this.session.user.id.toString(), _mailbox: this.selected.mailbox, _sess: this.id, - _message_count: messages.lentgh, + _message_count: messages.length, _flags: flags.join(', '), _store_action: action, _silent: silent ? 'yes' : '', @@ -157,11 +157,13 @@ module.exports = { // STORE returns MODIFIED as sequence numbers, so convert UIDs to sequence list if (modified && modified.length) { logdata._modified = modified.length; - modified = modified.map(uid => this.selected.uidList.indexOf(uid) + 1).filter( - seq => - // ensure that deleted items (eg seq=0) do not end up in the list - seq > 0 - ); + modified = modified + .map(uid => this.selected.uidList.indexOf(uid) + 1) + .filter( + seq => + // ensure that deleted items (eg seq=0) do not end up in the list + seq > 0 + ); } let message = success === true ? 'STORE completed' : false; @@ -181,8 +183,8 @@ module.exports = { typeof success === 'string' ? success.toUpperCase() : modified && modified.length - ? 'MODIFIED ' + imapTools.packMessageRange(modified) - : false, + ? 'MODIFIED ' + imapTools.packMessageRange(modified) + : false, message }; diff --git a/imap-core/lib/commands/uid-store.js b/imap-core/lib/commands/uid-store.js index a946fb60..dc798d09 100644 --- a/imap-core/lib/commands/uid-store.js +++ b/imap-core/lib/commands/uid-store.js @@ -37,7 +37,7 @@ module.exports = { let type = 'flags'; // currently hard coded, in the future might support other values as well, eg. X-GM-LABELS let range = (command.attributes[0] && command.attributes[0].value) || ''; - // if arguments include extenstions at index 1, then length is 4, otherwise 3 + // if arguments include extensions at index 1, then length is 4, otherwise 3 let pos = command.attributes.length === 4 ? 1 : 0; let action = ((command.attributes[pos + 1] && command.attributes[pos + 1].value) || '').toString().toUpperCase(); @@ -111,7 +111,7 @@ module.exports = { _user: this.session.user.id.toString(), _mailbox: this.selected.mailbox, _sess: this.id, - _message_count: messages.lentgh, + _message_count: messages.length, _flags: flags.join(', '), _store_action: action, _silent: silent ? 'yes' : '', @@ -160,8 +160,8 @@ module.exports = { typeof success === 'string' ? success.toUpperCase() : modified && modified.length - ? 'MODIFIED ' + imapTools.packMessageRange(modified) - : false, + ? 'MODIFIED ' + imapTools.packMessageRange(modified) + : false, message }); } diff --git a/imap-core/lib/commands/xapplepushservice.js b/imap-core/lib/commands/xapplepushservice.js index e71b9aa2..b0daf6a7 100644 --- a/imap-core/lib/commands/xapplepushservice.js +++ b/imap-core/lib/commands/xapplepushservice.js @@ -116,7 +116,7 @@ module.exports = { } } - // Make sure all required keys (exept mailboxes) are present + // Make sure all required keys (except mailboxes) are present for (let requiredKey of requiredKeys) { if (!data[requiredKey] && requiredKey !== 'mailboxes') { return callback(null, { diff --git a/imap-core/lib/handler/imap-compile-stream.js b/imap-core/lib/handler/imap-compile-stream.js index cc245fa2..aa92c1b3 100644 --- a/imap-core/lib/handler/imap-compile-stream.js +++ b/imap-core/lib/handler/imap-compile-stream.js @@ -57,22 +57,16 @@ module.exports = (response, isLogging) => { if (stream.isLimited) { // stream is already limited let limiter = new LengthLimiter(expectedLength - startFrom, ' ', 0); - stream.pipe(limiter).pipe( - output, - { - end: false - } - ); + stream.pipe(limiter).pipe(output, { + end: false + }); limiter.once('end', () => resolve()); } else { // force limites let limiter = new LengthLimiter(expectedLength, ' ', startFrom); - stream.pipe(limiter).pipe( - output, - { - end: false - } - ); + stream.pipe(limiter).pipe(output, { + end: false + }); limiter.once('end', () => resolve()); } @@ -106,7 +100,7 @@ module.exports = (response, isLogging) => { // (...) resp.push(LEFT_PARENTHESIS); - // Check if we need to skip separtor WS between two arrays + // Check if we need to skip separator WS between two arrays let isSubArray = node.length > 1 && Array.isArray(node[0]); for (let child of node) { @@ -190,7 +184,7 @@ module.exports = (response, isLogging) => { if (isLogging && node.value.length > 20) { resp.push(Buffer.from('"(* ' + node.value.length + 'B string *)"')); } else { - // JSON.stringify conveniently adds enclosing quotes and escapes any "\ occurences + // JSON.stringify conveniently adds enclosing quotes and escapes any "\ occurrences resp.push(Buffer.from(JSON.stringify((node.value || '').toString('binary')), 'binary')); } break; diff --git a/imap-core/lib/handler/imap-compiler.js b/imap-core/lib/handler/imap-compiler.js index 69680ec3..8ad1dce5 100644 --- a/imap-core/lib/handler/imap-compiler.js +++ b/imap-core/lib/handler/imap-compiler.js @@ -7,12 +7,12 @@ const imapFormalSyntax = require('./imap-formal-syntax'); /** * Compiles an input object into */ -module.exports = function(response, asArray, isLogging) { +module.exports = function (response, asArray, isLogging) { let respParts = []; let resp = (response.tag || '') + (response.command ? ' ' + response.command : ''); let val; let lastType; - let walk = function(node, options) { + let walk = function (node, options) { options = options || {}; if (lastType === 'LITERAL' || (!['(', '<', '['].includes(resp.substr(-1)) && resp.length)) { @@ -32,7 +32,7 @@ module.exports = function(response, asArray, isLogging) { lastType = 'LIST'; resp += '('; - // check if we need to skip separtor WS between two arrays + // check if we need to skip separator WS between two arrays let subArray = node.length > 1 && Array.isArray(node[0]); node.forEach(child => { diff --git a/imap-core/lib/imap-connection.js b/imap-core/lib/imap-connection.js index ce478087..7eeb0633 100644 --- a/imap-core/lib/imap-connection.js +++ b/imap-core/lib/imap-connection.js @@ -249,7 +249,7 @@ class IMAPConnection extends EventEmitter { return this.close(); } if (this.compression) { - // make sure we transmit the message immediatelly + // make sure we transmit the message immediately this._deflate.flush(); } this.logger.debug( @@ -621,7 +621,7 @@ class IMAPConnection extends EventEmitter { // append received notifications to the list conn.selected.notifications = conn.selected.notifications.concat(updates); if (conn.idling) { - // when idling emit notifications immediatelly + // when idling emit notifications immediately conn.emitNotifications(); } }); diff --git a/imap-core/lib/search.js b/imap-core/lib/search.js index 2ac1251f..7acb593f 100644 --- a/imap-core/lib/search.js +++ b/imap-core/lib/search.js @@ -11,7 +11,7 @@ const queryHandlers = { return callback(null, true); }, - // matches if the message object includes (exists:true) or does not include (exists:false) specifiec flag + // matches if the message object includes (exists:true) or does not include (exists:false) specific flag flag(message, query, callback) { let pos = [].concat(message.flags || []).indexOf(query.value); return callback(null, query.exists ? pos >= 0 : pos < 0); @@ -290,7 +290,7 @@ function matchSearchTerm(message, query, callback) { } /** - * Traverses query tree and checks if all query terms match or not. Stops on first false match occurence + * Traverses query tree and checks if all query terms match or not. Stops on first false match occurrence * * @param {Object} message Stored message object * @param {Object} query Query term object diff --git a/imap-core/test/imap-compile-stream-test.js b/imap-core/test/imap-compile-stream-test.js index 9c031b90..81ae51ef 100644 --- a/imap-core/test/imap-compile-stream-test.js +++ b/imap-core/test/imap-compile-stream-test.js @@ -9,9 +9,9 @@ const crypto = require('crypto'); const expect = chai.expect; chai.config.includeStack = true; -describe('IMAP Command Compile Stream', function() { - describe('#compile', function() { - it('should compile correctly', function(done) { +describe('IMAP Command Compile Stream', function () { + describe('#compile', function () { + it('should compile correctly', function (done) { let command = '* FETCH (ENVELOPE ("Mon, 2 Sep 2013 05:30:13 -0700 (PDT)" NIL ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "tr.ee")) NIL NIL NIL "<-4730417346358914070@unknownmsgid>") BODYSTRUCTURE (("MESSAGE" "RFC822" NIL NIL NIL "7BIT" 105 (NIL NIL ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "pangalink.net")) NIL NIL "" NIL) ("TEXT" "PLAIN" NIL NIL NIL "7BIT" 12 0 NIL NIL NIL) 5 NIL NIL NIL)("MESSAGE" "RFC822" NIL NIL NIL "7BIT" 83 (NIL NIL ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "pangalink.net")) NIL NIL "NIL" NIL) ("TEXT" "PLAIN" NIL NIL NIL "7BIT" 12 0 NIL NIL NIL) 4 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "utf-8") NIL NIL "QUOTED-PRINTABLE" 19 0 NIL NIL NIL) "MIXED" ("BOUNDARY" "----mailcomposer-?=_1-1328088797399") NIL NIL))', parsed = imapHandler.parser(command, { @@ -26,18 +26,18 @@ describe('IMAP Command Compile Stream', function() { }); }); - describe('Types', function() { + describe('Types', function () { let parsed; - beforeEach(function() { + beforeEach(function () { parsed = { tag: '*', command: 'CMD' }; }); - describe('No attributes', function() { - it('should compile correctly', function(done) { + describe('No attributes', function () { + it('should compile correctly', function (done) { let command = '* CMD'; resolveStream(imapHandler.compileStream(parsed), (err, compiled) => { @@ -48,8 +48,8 @@ describe('IMAP Command Compile Stream', function() { }); }); - describe('TEXT', function() { - it('should compile correctly', function(done) { + describe('TEXT', function () { + it('should compile correctly', function (done) { parsed.attributes = [ { type: 'TEXT', @@ -65,8 +65,8 @@ describe('IMAP Command Compile Stream', function() { }); }); - describe('SECTION', function() { - it('should compile correctly', function(done) { + describe('SECTION', function () { + it('should compile correctly', function (done) { parsed.attributes = [ { type: 'SECTION', @@ -87,8 +87,8 @@ describe('IMAP Command Compile Stream', function() { }); }); - describe('ATOM', function() { - it('should compile correctly', function(done) { + describe('ATOM', function () { + it('should compile correctly', function (done) { parsed.attributes = [ { type: 'ATOM', @@ -112,8 +112,8 @@ describe('IMAP Command Compile Stream', function() { }); }); - describe('SEQUENCE', function() { - it('should compile correctly', function(done) { + describe('SEQUENCE', function () { + it('should compile correctly', function (done) { parsed.attributes = [ { type: 'SEQUENCE', @@ -129,8 +129,8 @@ describe('IMAP Command Compile Stream', function() { }); }); - describe('NIL', function() { - it('should compile correctly', function(done) { + describe('NIL', function () { + it('should compile correctly', function (done) { parsed.attributes = [null, null]; let command = '* CMD NIL NIL'; @@ -142,8 +142,8 @@ describe('IMAP Command Compile Stream', function() { }); }); - describe('TEXT', function() { - it('should compile correctly', function(done) { + describe('TEXT', function () { + it('should compile correctly', function (done) { parsed.attributes = [ // keep indentation { @@ -162,7 +162,7 @@ describe('IMAP Command Compile Stream', function() { }); }); - it('should keep short strings', function(done) { + it('should keep short strings', function (done) { parsed.attributes = [ // keep indentation { @@ -180,7 +180,7 @@ describe('IMAP Command Compile Stream', function() { }); }); - it('should hide strings', function(done) { + it('should hide strings', function (done) { parsed.attributes = [ // keep indentation { @@ -199,7 +199,7 @@ describe('IMAP Command Compile Stream', function() { }); }); - it('should hide long strings', function(done) { + it('should hide long strings', function (done) { parsed.attributes = [ // keep indentation { @@ -218,8 +218,8 @@ describe('IMAP Command Compile Stream', function() { }); }); - describe('No Command', function() { - it('should compile correctly', function(done) { + describe('No Command', function () { + it('should compile correctly', function (done) { parsed = { tag: '*', attributes: [ @@ -239,8 +239,8 @@ describe('IMAP Command Compile Stream', function() { }); }); }); - describe('Literal', function() { - it('shoud return as text', function(done) { + describe('Literal', function () { + it('should return as text', function (done) { let parsed = { tag: '*', command: 'CMD', @@ -262,7 +262,7 @@ describe('IMAP Command Compile Stream', function() { }); }); - it('should compile correctly without tag and command', function(done) { + it('should compile correctly without tag and command', function (done) { let parsed = { attributes: [ { @@ -283,7 +283,7 @@ describe('IMAP Command Compile Stream', function() { }); }); - it('shoud return byte length', function(done) { + it('should return byte length', function (done) { let parsed = { tag: '*', command: 'CMD', @@ -305,7 +305,7 @@ describe('IMAP Command Compile Stream', function() { }); }); - it('should mix with other values', function(done) { + it('should mix with other values', function (done) { let s = new PassThrough(); let str = 'abc'.repeat(100); let parsed = { @@ -338,7 +338,7 @@ describe('IMAP Command Compile Stream', function() { } ] }; - setImmediate(function() { + setImmediate(function () { s.end(str); }); let command = 'BODY {10}\r\nTere tere! BODY {' + str.length + '}\r\n' + str + ' UID 12345'; @@ -349,7 +349,7 @@ describe('IMAP Command Compile Stream', function() { }); }); - it('shoud pipe literal streams', function(done) { + it('should pipe literal streams', function (done) { let stream1 = new PassThrough(); let stream2 = new PassThrough(); let stream3 = new PassThrough(); @@ -403,7 +403,7 @@ describe('IMAP Command Compile Stream', function() { }, 100); }); - it('shoud pipe limited literal streams', function(done) { + it('should pipe limited literal streams', function (done) { let stream1 = new PassThrough(); let stream2 = new PassThrough(); let stream3 = new PassThrough(); @@ -462,7 +462,7 @@ describe('IMAP Command Compile Stream', function() { }, 100); }); - it('shoud pipe errors for literal streams', function(done) { + it('should pipe errors for literal streams', function (done) { let stream1 = new PassThrough(); let parsed = { tag: '*', @@ -493,10 +493,10 @@ describe('IMAP Command Compile Stream', function() { }); }); - describe('#LengthLimiter', function() { + describe('#LengthLimiter', function () { this.timeout(10000); //eslint-disable-line no-invalid-this - it('should emit exact length', function(done) { + it('should emit exact length', function (done) { let len = 1024; let limiter = new imapHandler.compileStream.LengthLimiter(len); let expected = 'X'.repeat(len); @@ -523,7 +523,7 @@ describe('IMAP Command Compile Stream', function() { setTimeout(emitter, 100); }); - it('should truncate output', function(done) { + it('should truncate output', function (done) { let len = 1024; let limiter = new imapHandler.compileStream.LengthLimiter(len - 100); let expected = 'X'.repeat(len - 100); @@ -550,7 +550,7 @@ describe('IMAP Command Compile Stream', function() { setTimeout(emitter, 100); }); - it('should skip output', function(done) { + it('should skip output', function (done) { let len = 1024; let limiter = new imapHandler.compileStream.LengthLimiter(len - 100, false, 30); let expected = 'X'.repeat(len - 100 - 30); @@ -577,7 +577,7 @@ describe('IMAP Command Compile Stream', function() { setTimeout(emitter, 100); }); - it('should pad output', function(done) { + it('should pad output', function (done) { let len = 1024; let limiter = new imapHandler.compileStream.LengthLimiter(len + 100); let expected = 'X'.repeat(len) + ' '.repeat(100); @@ -604,7 +604,7 @@ describe('IMAP Command Compile Stream', function() { setTimeout(emitter, 100); }); - it('should pipe to several streams', function(done) { + it('should pipe to several streams', function (done) { let len = 1024; let start = 30; let margin = 200; @@ -614,7 +614,7 @@ describe('IMAP Command Compile Stream', function() { let expected1 = input.substr(start, len - margin - start); let expected2 = input.substr(len - margin); - limiter.on('done', function(remainder) { + limiter.on('done', function (remainder) { stream.unpipe(limiter); if (remainder) { stream.unshift(remainder); diff --git a/imap-core/test/imap-compiler-test.js b/imap-core/test/imap-compiler-test.js index 51d81ad1..0eb6dfd5 100644 --- a/imap-core/test/imap-compiler-test.js +++ b/imap-core/test/imap-compiler-test.js @@ -7,9 +7,9 @@ const imapHandler = require('../lib/handler/imap-handler'); const expect = chai.expect; chai.config.includeStack = true; -describe('IMAP Command Compiler', function() { - describe('#compile', function() { - it('should compile correctly', function() { +describe('IMAP Command Compiler', function () { + describe('#compile', function () { + it('should compile correctly', function () { let command = '* FETCH (ENVELOPE ("Mon, 2 Sep 2013 05:30:13 -0700 (PDT)" NIL ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "tr.ee")) NIL NIL NIL "<-4730417346358914070@unknownmsgid>") BODYSTRUCTURE (("MESSAGE" "RFC822" NIL NIL NIL "7BIT" 105 (NIL NIL ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "pangalink.net")) NIL NIL "" NIL) ("TEXT" "PLAIN" NIL NIL NIL "7BIT" 12 0 NIL NIL NIL) 5 NIL NIL NIL)("MESSAGE" "RFC822" NIL NIL NIL "7BIT" 83 (NIL NIL ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "kreata.ee")) ((NIL NIL "andris" "pangalink.net")) NIL NIL "NIL" NIL) ("TEXT" "PLAIN" NIL NIL NIL "7BIT" 12 0 NIL NIL NIL) 4 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "utf-8") NIL NIL "QUOTED-PRINTABLE" 19 0 NIL NIL NIL) "MIXED" ("BOUNDARY" "----mailcomposer-?=_1-1328088797399") NIL NIL))', parsed = imapHandler.parser(command, { @@ -21,24 +21,24 @@ describe('IMAP Command Compiler', function() { }); }); - describe('Types', function() { + describe('Types', function () { let parsed; - beforeEach(function() { + beforeEach(function () { parsed = { tag: '*', command: 'CMD' }; }); - describe('No attributes', function() { - it('should compile correctly', function() { + describe('No attributes', function () { + it('should compile correctly', function () { expect(imapHandler.compiler(parsed)).to.equal('* CMD'); }); }); - describe('TEXT', function() { - it('should compile correctly', function() { + describe('TEXT', function () { + it('should compile correctly', function () { parsed.attributes = [ { type: 'TEXT', @@ -49,8 +49,8 @@ describe('IMAP Command Compiler', function() { }); }); - describe('SECTION', function() { - it('should compile correctly', function() { + describe('SECTION', function () { + it('should compile correctly', function () { parsed.attributes = [ { type: 'SECTION', @@ -66,8 +66,8 @@ describe('IMAP Command Compiler', function() { }); }); - describe('ATOM', function() { - it('should compile correctly', function() { + describe('ATOM', function () { + it('should compile correctly', function () { parsed.attributes = [ // { @@ -87,8 +87,8 @@ describe('IMAP Command Compiler', function() { }); }); - describe('SEQUENCE', function() { - it('should compile correctly', function() { + describe('SEQUENCE', function () { + it('should compile correctly', function () { parsed.attributes = [ { type: 'SEQUENCE', @@ -99,16 +99,16 @@ describe('IMAP Command Compiler', function() { }); }); - describe('NIL', function() { - it('should compile correctly', function() { + describe('NIL', function () { + it('should compile correctly', function () { parsed.attributes = [null, null]; expect(imapHandler.compiler(parsed)).to.equal('* CMD NIL NIL'); }); }); - describe('TEXT', function() { - it('should compile correctly', function() { + describe('TEXT', function () { + it('should compile correctly', function () { parsed.attributes = [ // keep indentation { @@ -122,7 +122,7 @@ describe('IMAP Command Compiler', function() { expect(imapHandler.compiler(parsed)).to.equal('* CMD "Tere tere!" "Vana kere"'); }); - it('should keep short strings', function() { + it('should keep short strings', function () { parsed.attributes = [ // keep indentation { @@ -135,7 +135,7 @@ describe('IMAP Command Compiler', function() { expect(imapHandler.compiler(parsed, false, true)).to.equal('* CMD "Tere tere!" "Vana kere"'); }); - it('should hide strings', function() { + it('should hide strings', function () { parsed.attributes = [ // keep indentation { @@ -149,7 +149,7 @@ describe('IMAP Command Compiler', function() { expect(imapHandler.compiler(parsed, false, true)).to.equal('* CMD "(* value hidden *)" "Vana kere"'); }); - it('should hide long strings', function() { + it('should hide long strings', function () { parsed.attributes = [ // keep indentation { @@ -163,8 +163,8 @@ describe('IMAP Command Compiler', function() { }); }); - describe('No Command', function() { - it('should compile correctly', function() { + describe('No Command', function () { + it('should compile correctly', function () { parsed = { tag: '*', attributes: [ @@ -179,8 +179,8 @@ describe('IMAP Command Compiler', function() { expect(imapHandler.compiler(parsed)).to.equal('* 1 EXPUNGE'); }); }); - describe('Literal', function() { - it('shoud return as text', function() { + describe('Literal', function () { + it('should return as text', function () { let parsed = { tag: '*', command: 'CMD', @@ -197,7 +197,7 @@ describe('IMAP Command Compiler', function() { expect(imapHandler.compiler(parsed)).to.equal('* CMD {10}\r\nTere tere! "Vana kere"'); }); - it('should return as an array text 1', function() { + it('should return as an array text 1', function () { let parsed = { tag: '*', command: 'CMD', @@ -215,7 +215,7 @@ describe('IMAP Command Compiler', function() { expect(imapHandler.compiler(parsed, true)).to.deep.equal(['* CMD {10}\r\n', 'Tere tere! {9}\r\n', 'Vana kere']); }); - it('should return as an array text 2', function() { + it('should return as an array text 2', function () { let parsed = { tag: '*', command: 'CMD', @@ -235,7 +235,7 @@ describe('IMAP Command Compiler', function() { expect(imapHandler.compiler(parsed, true)).to.deep.equal(['* CMD {10}\r\n', 'Tere tere! {9}\r\n', 'Vana kere "zzz"']); }); - it('should compile correctly without tag and command', function() { + it('should compile correctly without tag and command', function () { let parsed = { attributes: [ { @@ -251,7 +251,7 @@ describe('IMAP Command Compiler', function() { expect(imapHandler.compiler(parsed, true)).to.deep.equal(['{10}\r\n', 'Tere tere! {9}\r\n', 'Vana kere']); }); - it('shoud return byte length', function() { + it('should return byte length', function () { let parsed = { tag: '*', command: 'CMD', diff --git a/imap-core/test/memory-notifier.js b/imap-core/test/memory-notifier.js index 85127805..e4da6bde 100644 --- a/imap-core/test/memory-notifier.js +++ b/imap-core/test/memory-notifier.js @@ -71,7 +71,7 @@ class MemoryNotifier extends EventEmitter { return callback(null, false); } - // store entires in the folder object + // store entries in the folder object if (!folder.journal) { folder.journal = []; } diff --git a/imap-core/test/protocol-test.js b/imap-core/test/protocol-test.js index 7a351707..dec9000f 100644 --- a/imap-core/test/protocol-test.js +++ b/imap-core/test/protocol-test.js @@ -47,7 +47,7 @@ describe('IMAP Protocol integration tests', function () { }); describe('CAPABILITY', function () { - it('should list capabilites', function (done) { + it('should list capabilities', function (done) { let cmds = ['T1 CAPABILITY', 'T2 LOGOUT']; testClient( diff --git a/imap-core/test/test-server.js b/imap-core/test/test-server.js index 9bc2d9f6..70017853 100644 --- a/imap-core/test/test-server.js +++ b/imap-core/test/test-server.js @@ -393,7 +393,7 @@ module.exports = function (options) { break; } - // notifiy only if something changed + // notify only if something changed if (updated) { message.modseq = ++folder.modifyIndex; diff --git a/indexer.js b/indexer.js index e0493a86..d414e5f1 100644 --- a/indexer.js +++ b/indexer.js @@ -29,7 +29,7 @@ let liveIndexingQueue; const FORCE_DISABLED_MESSAGE = 'Can not set up change streams. Not a replica set. Changes are not indexed to ElasticSearch.'; class Indexer { - constuctor() { + constructor() { this.running = false; } @@ -297,11 +297,11 @@ function indexingJob(esclient) { .exec(); if (err1) { - log.verbose('Indexing', 'Failed checking tombstone key=%s erro=%s', tombstoneTdy, err1.message); + log.verbose('Indexing', 'Failed checking tombstone key=%s error=%s', tombstoneTdy, err1.message); } if (err2) { - log.verbose('Indexing', 'Failed checking tombstone key=%s erro=%s', tombstoneYdy, err2.message); + log.verbose('Indexing', 'Failed checking tombstone key=%s error=%s', tombstoneYdy, err2.message); } if (isDeleted1 || isDeleted2) { diff --git a/lib/acme/certs.js b/lib/acme/certs.js index 99e96de3..fcafc400 100644 --- a/lib/acme/certs.js +++ b/lib/acme/certs.js @@ -223,7 +223,7 @@ const acquireCert = async (domain, acmeOptions, certificateData, certHandler) => const acmeAccount = await getAcmeAccount(acmeOptions, certHandler); if (!acmeAccount) { - log.info('ACME', 'Skip certificate renwal for %s, acme account not found', domain); + log.info('ACME', 'Skip certificate renewal for %s, acme account not found', domain); return false; } diff --git a/lib/api/audit.js b/lib/api/audit.js index d001d5ee..d539d9f2 100644 --- a/lib/api/audit.js +++ b/lib/api/audit.js @@ -219,7 +219,7 @@ module.exports = (db, server, auditHandler) => { } res.setHeader('Content-Type', 'application/octet-stream'); - res.setHeader('Content-Dispositon', 'attachment; filename=export.mbox'); + res.setHeader('Content-Disposition', 'attachment; filename=export.mbox'); output.on('error', err => { log.error('Audit', `Failed processing audit ${req.params.audit}: ${err.message}`); diff --git a/lib/api/auth.js b/lib/api/auth.js index 5677eaf6..872898fd 100644 --- a/lib/api/auth.js +++ b/lib/api/auth.js @@ -352,7 +352,7 @@ module.exports = (db, server, userHandler) => { protocol: Joi.string().description('Protocol that the authentication was made from'), requiredScope: Joi.string().description('Scope of the auth'), last: Joi.date().required().description('Date of the last update of data'), - events: Joi.number().required().description('Number of times same auth log has accured'), + events: Joi.number().required().description('Number of times same auth log has occurred'), source: Joi.string().description('Source of auth. Example: `master` if password auth was used'), expires: Joi.date() .required() @@ -524,7 +524,7 @@ module.exports = (db, server, userHandler) => { protocol: Joi.string().description('Protocol that the authentication was made from'), requiredScope: Joi.string().description('Scope of the auth'), last: Joi.date().required().description('Date of the last update of Event'), - events: Joi.number().required().description('Number of times same auth Event has accured'), + events: Joi.number().required().description('Number of times same auth Event has occurred'), source: Joi.string().description('Source of auth. Example: `master` if password auth was used'), expires: Joi.date() .required() diff --git a/lib/api/certs.js b/lib/api/certs.js index 22fd69f5..28fb176d 100644 --- a/lib/api/certs.js +++ b/lib/api/certs.js @@ -312,7 +312,7 @@ module.exports = (db, server) => { summary: 'Create or update TLS certificate for server name', tags: ['Certs'], description: - 'Add a new TLS certificate for a server name or update existing one. You can add a single certificate for each server name but SAN names are supported as well. For example you can add a sertificate for "mydomain.com" that includes "*.mydomain.com" in SAN and the same certificate would be used for requests that do not have it\'s own server name registered but match the SAN value.\n> NB! you must ensure yourself that the `servername` value is actually listed in certificate\'s common name or SAN as WildDuck is going to use this certificate regardless.', + 'Add a new TLS certificate for a server name or update existing one. You can add a single certificate for each server name but SAN names are supported as well. For example you can add a certificate for "mydomain.com" that includes "*.mydomain.com" in SAN and the same certificate would be used for requests that do not have it\'s own server name registered but match the SAN value.\n> NB! you must ensure yourself that the `servername` value is actually listed in certificate\'s common name or SAN as WildDuck is going to use this certificate regardless.', validationObjs: { pathParams: {}, queryParams: {}, diff --git a/lib/api/messages.js b/lib/api/messages.js index 36b41993..41fdddd5 100644 --- a/lib/api/messages.js +++ b/lib/api/messages.js @@ -392,7 +392,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti intro: Joi.string().required().description('First 128 bytes of the message'), attachments: booleanSchema.required().description('Does the message have attachments'), size: Joi.number().required().description('Message size in bytes'), - seen: booleanSchema.required().description('Is this message alread seen or not'), + seen: booleanSchema.required().description('Is this message already seen or not'), deleted: booleanSchema .required() .description( @@ -620,7 +620,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti .trim() .max(255) .empty('') - .description('Search string, uses MongoDB fulltext index. Covers data from mesage body and also common headers like from, to, subject etc.'), + .description('Search string, uses MongoDB fulltext index. Covers data from message body and also common headers like from, to, subject etc.'), from: Joi.string().trim().empty('').description('Partial match for the From: header line'), to: Joi.string().trim().empty('').description('Partial match for the To: and Cc: header lines'), subject: Joi.string().trim().empty('').description('Partial match for the Subject: header line') @@ -630,7 +630,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti .trim() .max(255) .empty('') - .description('Search string, uses MongoDB fulltext index. Covers data from mesage body and also common headers like from, to, subject etc.'), + .description('Search string, uses MongoDB fulltext index. Covers data from message body and also common headers like from, to, subject etc.'), datestart: Joi.date().label('Start time').empty('').description('Datestring for the earliest message storing time'), dateend: Joi.date().label('End time').empty('').description('Datestring for the latest message storing time'), from: Joi.string().trim().empty('').description('Partial match for the From: header line'), @@ -1988,7 +1988,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti let mailbox = new ObjectId(result.value.mailbox); if (result.value.async) { - // instead of deleting immediatelly, scheule deletion task + // instead of deleting immediately, schedule deletion task let r; try { @@ -2086,7 +2086,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti 'base64 encoded message source. Alternatively, you can provide this value as POST body by using message/rfc822 MIME type. If raw message is provided then it overrides any other mail configuration' ), - from: AddressOptionalName.description('Addres for the From: header'), + from: AddressOptionalName.description('Address for the From: header'), replyTo: AddressOptionalName.description('Address for the Reply-To: header'), @@ -2160,7 +2160,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti .required() .description('Message information'), previousDeleted: booleanSchema.description('Set if replacing a previous message was requested'), - previousDeleteError: Joi.string().description('Previus delete error message') + previousDeleteError: Joi.string().description('Previous delete error message') }) } } @@ -3242,7 +3242,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti intro: Joi.string().required().description('First 128 bytes of the message'), attachments: booleanSchema.required().description('Does the message have attachments'), size: Joi.number().required().description('Message size in bytes'), - seen: booleanSchema.required().description('Is this message alread seen or not'), + seen: booleanSchema.required().description('Is this message already seen or not'), deleted: booleanSchema .required() .description( @@ -3545,7 +3545,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti description: 'Success', model: Joi.object({ success: booleanSchema.required().description('Indicates successful response'), - mailbox: Joi.string().required().description('Maibox ID the message was moved to'), + mailbox: Joi.string().required().description('Mailbox ID the message was moved to'), id: Joi.number().required().description('New ID for the Message') }) } diff --git a/lib/api/submit.js b/lib/api/submit.js index 8e35dd98..4defc0a6 100644 --- a/lib/api/submit.js +++ b/lib/api/submit.js @@ -632,7 +632,7 @@ module.exports = (db, server, messageHandler, userHandler, settingsHandler) => { validationObjs: { requestBody: { mailbox: Joi.string().hex().lowercase().length(24).description('ID of the Mailbox'), - from: AddressOptionalName.description('Addres for the From: header'), + from: AddressOptionalName.description('Address for the From: header'), replyTo: AddressOptionalName.description('Address for the Reply-To: header'), to: Joi.array() .items( @@ -700,7 +700,7 @@ module.exports = (db, server, messageHandler, userHandler, settingsHandler) => { uploadOnly: booleanSchema.default(false).description('If true only uploads the message but does not send it'), envelope: Joi.object() .keys({ - from: AddressOptionalName.description('Addres for the From: header'), + from: AddressOptionalName.description('Address for the From: header'), to: Joi.array().items( Joi.object() .keys({ diff --git a/lib/api/users.js b/lib/api/users.js index 488b45b6..a1bb5f4b 100644 --- a/lib/api/users.js +++ b/lib/api/users.js @@ -371,7 +371,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { imapMaxDownload: Joi.number().min(0).default(0).description('How many bytes can be downloaded via IMAP during 24 hour'), pop3MaxDownload: Joi.number().min(0).default(0).description('How many bytes can be downloaded via POP3 during 24 hour'), pop3MaxMessages: Joi.number().min(0).default(0).description('How many latest messages to list in POP3 session'), - imapMaxConnections: Joi.number().min(0).default(0).description('How many parallel IMAP connections are alowed'), + imapMaxConnections: Joi.number().min(0).default(0).description('How many parallel IMAP connections are allowed'), receivedMax: Joi.number().min(0).default(0).description('How many messages can be received from MX during 60 seconds'), fromWhitelist: Joi.array() @@ -867,7 +867,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { .$_setFlag('objectName', 'Pop3Download'), imapMaxConnections: Joi.object({ allowed: Joi.number().required().description('How many parallel IMAP connections are permitted'), - used: Joi.number().required().description('How many parallel IMAP connections are currenlty in use') + used: Joi.number().required().description('How many parallel IMAP connections are currently in use') }) .description('a') .$_setFlag('objectName', 'ImapMaxConnections') @@ -1229,7 +1229,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { imapMaxDownload: Joi.number().min(0).description('How many bytes can be downloaded via IMAP during 24 hour'), pop3MaxDownload: Joi.number().min(0).description('How many bytes can be downloaded via POP3 during 24 hour'), pop3MaxMessages: Joi.number().min(0).description('How many latest messages to list in POP3 session'), - imapMaxConnections: Joi.number().min(0).description('How many parallel IMAP connections are alowed'), + imapMaxConnections: Joi.number().min(0).description('How many parallel IMAP connections are allowed'), receivedMax: Joi.number().min(0).description('How many messages can be received from MX during 60 seconds'), diff --git a/lib/attachments/gridstore-storage.js b/lib/attachments/gridstore-storage.js index d3fa858e..d2e180ad 100644 --- a/lib/attachments/gridstore-storage.js +++ b/lib/attachments/gridstore-storage.js @@ -271,7 +271,7 @@ class GridstoreStorage { if (tryCount++ < 5) { if (/\.chunks /.test(err.message)) { // Partial chunks detected. Might be because of: - // * another process is inserting the same attachment and thus no "files" entry yet (should not happend though due to locking) + // * another process is inserting the same attachment and thus no "files" entry yet (should not happened though due to locking) // * previously deleted attachment that has not been properly removed // Load data for an existing chunk to see the age of it @@ -352,7 +352,7 @@ class GridstoreStorage { if (options && attachmentData.metadata.decoded) { let offsetOptions = base64Offset(attachmentData.metadata.lineLen, options.startFrom, options.maxLength); encoderOptions.skipStartBytes = offsetOptions.base64SkipStartBytes; - encoderOptions.limitOutbutBytes = offsetOptions.base64LimitBytes; + encoderOptions.limitOutputBytes = offsetOptions.base64LimitBytes; encoderOptions.startPadding = offsetOptions.base64Padding; streamOptions.start = offsetOptions.binaryStartOffset || 0; diff --git a/lib/consts.js b/lib/consts.js index 0d180f9a..28981ff8 100644 --- a/lib/consts.js +++ b/lib/consts.js @@ -69,17 +69,17 @@ module.exports = { MAX_ALLOWED_MESSAGE_SIZE: 64 * 1024 * 1024, // Refuse to process attachments larger than 64 MB - MAX_ALLOWED_ATACHMENT_SIZE: 25 * 1024 * 1024, + MAX_ALLOWED_ATTACHMENT_SIZE: 25 * 1024 * 1024, // how long to keep deleted messages around before purgeing ARCHIVE_TIME: 25 * 24 * 3600 * 1000, // merge similar authlog events into 6 hour buckets instead of storing each separately - // this is mostly needed for IMAP clients that make crazy amout of connections and thus logins + // this is mostly needed for IMAP clients that make crazy amount of connections and thus logins AUTHLOG_BUCKET: 6 * 3600 * 1000, AUTHLOG_TIME: 30 * 24 * 3600 * 1000, - // start processing tasks 5 minues after startup + // start processing tasks 5 minutes after startup TASK_STARTUP_INTERVAL: 1 * 60 * 1000, // if no tasks were found, wait 2 seconds diff --git a/lib/dkim-handler.js b/lib/dkim-handler.js index 267775f8..7bfe978e 100644 --- a/lib/dkim-handler.js +++ b/lib/dkim-handler.js @@ -55,7 +55,7 @@ class DkimHandler { if (!keyPair || !keyPair.privateKey || !keyPair.publicKey) { let err = new Error('Failed to generate key pair'); err.responseCode = 500; - err.code = 'KeyGenereateError'; + err.code = 'KeyGenerateError'; throw err; } privateKeyPem = keyPair.privateKey; @@ -86,7 +86,7 @@ ${Buffer.concat([Buffer.from(ASN1_PADDING, 'base64'), Buffer.from(privateKeyPem, if (!publicKeyPem && !publicKeyDer) { let err = new Error('Failed to generate public key'); err.responseCode = 500; - err.code = 'KeyGenereateError'; + err.code = 'KeyGenerateError'; throw err; } diff --git a/lib/dkim-stream.js b/lib/dkim-stream.js index 86210339..40983922 100644 --- a/lib/dkim-stream.js +++ b/lib/dkim-stream.js @@ -28,7 +28,7 @@ class DkimStream extends Transform { let c = chunk[i]; if (state === 'file' && (c === 0x0a || c === 0x0d)) { - // do nothing, found \n or \r at the end of chunk, stil end of file + // do nothing, found \n or \r at the end of chunk, still end of file } else if (state === 'file' && (c === 0x09 || c === 0x20)) { // switch to line ending mode, this is the last non-empty line state = 'line'; diff --git a/lib/handlers/on-xapplepushservice.js b/lib/handlers/on-xapplepushservice.js index 13799874..7d60f7a1 100644 --- a/lib/handlers/on-xapplepushservice.js +++ b/lib/handlers/on-xapplepushservice.js @@ -9,7 +9,7 @@ // TODO: // 1. store APS information in DB, each deviceToken separately -// 2. on new email use the stored information to push to apple (use mathcing deviceTokens as an array of recipients) +// 2. on new email use the stored information to push to apple (use matching deviceTokens as an array of recipients) // 3. if pushing to a specific deviceToken yields in 410, remove that token module.exports = server => (accountID, deviceToken, subTopic, mailboxes, session, callback) => { diff --git a/lib/hashes.js b/lib/hashes.js index 6f3feb62..c0960d9f 100644 --- a/lib/hashes.js +++ b/lib/hashes.js @@ -3,7 +3,7 @@ const bcrypt = require('bcryptjs'); const pbkdf2 = require('@phc/pbkdf2'); // see https://www.npmjs.com/package/@phc/pbkdf2 const unixcrypt = require('unixcrypt'); -// unefficient but we are rehashing immediatelly after successful verification +// inefficient but we are rehashing immediately after successful verification const { argon2Verify } = require('hash-wasm'); // this crap is only needed to support legacy users imported from some older system const cryptMD5 = require('./md5/cryptmd5').cryptMD5; diff --git a/lib/imap-notifier.js b/lib/imap-notifier.js index 6055810c..95876a40 100644 --- a/lib/imap-notifier.js +++ b/lib/imap-notifier.js @@ -52,7 +52,7 @@ class ImapNotifier extends EventEmitter { data.count++; if (data.initial < Date.now() - 1000) { - // if the event has been held back already for a second, then fire immediatelly + // if the event has been held back already for a second, then fire immediately return fire(); } } else { @@ -108,7 +108,7 @@ class ImapNotifier extends EventEmitter { // events without payload are scheduled, these are notifications about changes in journal scheduleDataEvent(data.e); } else if (data.e) { - // events with payload are triggered immediatelly, these are actions for doing something + // events with payload are triggered immediately, these are actions for doing something this._listeners.emit(data.e, data.p); } } @@ -348,7 +348,7 @@ class ImapNotifier extends EventEmitter { break; case 'FETCH': if (entry.unseen) { - // either increase or decrese + // either increase or decrease counters.get(m).unseen += typeof entry.unseen === 'number' ? entry.unseen : 1; } else if (entry.unseenChange) { // volatile change, just clear the cache diff --git a/lib/mailbox-handler.js b/lib/mailbox-handler.js index 5658fb28..298e0100 100644 --- a/lib/mailbox-handler.js +++ b/lib/mailbox-handler.js @@ -245,7 +245,7 @@ class MailboxHandler { } /** - * Deletes a mailbox. Does not immediatelly release quota as the messages get deleted after a while + * Deletes a mailbox. Does not immediately release quota as the messages get deleted after a while */ del(user, mailbox, callback) { this.database.collection('mailboxes').findOne( diff --git a/lib/maildropper.js b/lib/maildropper.js index bdea384d..0bbbb4a4 100644 --- a/lib/maildropper.js +++ b/lib/maildropper.js @@ -368,13 +368,13 @@ class Maildropper { } parseAddressList(headers, key, withNames) { - return this.parseAddressses( + return this.parseAddresses( headers.getDecoded(key).map(header => header.value), withNames ); } - parseAddressses(headerList, withNames) { + parseAddresses(headerList, withNames) { let map = this.convertAddresses( headerList.map(address => { if (typeof address === 'string') { diff --git a/lib/mbox-stream.js b/lib/mbox-stream.js index d3dc17f0..f7581129 100644 --- a/lib/mbox-stream.js +++ b/lib/mbox-stream.js @@ -31,7 +31,7 @@ class MboxStream extends Transform { let value = Buffer.from(`From ${this.from} ${asctime(this.date)}\n`); if (value.length) { this.push(value); - this.lastByte = value[value.lenght - 1]; + this.lastByte = value[value.length - 1]; } this.headerSent = true; @@ -57,7 +57,7 @@ class MboxStream extends Transform { let value = chunk.slice(startPos, startPos + len); if (value.length) { this.push(value); - this.lastByte = value[value.lenght - 1]; + this.lastByte = value[value.length - 1]; } len = 0; } @@ -73,7 +73,7 @@ class MboxStream extends Transform { let value = chunk.slice(startPos, startPos + len); if (value.length) { this.push(value); - this.lastByte = value[value.lenght - 1]; + this.lastByte = value[value.length - 1]; } len = 0; } @@ -100,7 +100,7 @@ class MboxStream extends Transform { let value = Buffer.from(this.pending); if (value.length) { this.push(value); - this.lastByte = value[value.lenght - 1]; + this.lastByte = value[value.length - 1]; } this.pending = []; @@ -113,7 +113,7 @@ class MboxStream extends Transform { let value = Buffer.from(this.pending); if (value.length) { this.push(value); - this.lastByte = value[value.lenght - 1]; + this.lastByte = value[value.length - 1]; } this.pending = []; @@ -148,7 +148,7 @@ class MboxStream extends Transform { let value = chunk.slice(startPos, startPos + len); if (value.length) { this.push(value); - this.lastByte = value[value.lenght - 1]; + this.lastByte = value[value.length - 1]; } } @@ -160,7 +160,7 @@ class MboxStream extends Transform { let value = Buffer.from(this.pending); if (value.length) { this.push(value); - this.lastByte = value[value.lenght - 1]; + this.lastByte = value[value.length - 1]; } this.pending = []; } diff --git a/lib/message-handler.js b/lib/message-handler.js index 240aadab..8ec2cf29 100644 --- a/lib/message-handler.js +++ b/lib/message-handler.js @@ -178,7 +178,7 @@ class MessageHandler { ); } } catch (err) { - // can ignore, not an important opration + // can ignore, not an important operation } } @@ -1672,7 +1672,7 @@ class MessageHandler { // remove quoted parts // "> quote from previous message" .replace(/^>.*$/gm, '') - // remove lines with repetetive chars + // remove lines with repetitive chars // "---------------------" .replace(/^\s*(.)\1+\s*$/gm, '') // join lines diff --git a/lib/schemas/request/filters-schemas.js b/lib/schemas/request/filters-schemas.js index 115d9223..4cc95d39 100644 --- a/lib/schemas/request/filters-schemas.js +++ b/lib/schemas/request/filters-schemas.js @@ -7,7 +7,7 @@ const FilterAction = Joi.object({ seen: booleanSchema.description('If true then mark matching messages as Seen'), flag: booleanSchema.description('If true then mark matching messages as Flagged'), delete: booleanSchema.description('If true then do not store matching messages'), - spam: booleanSchema.description('If true then store matching messags to Junk Mail folder'), + spam: booleanSchema.description('If true then store matching messages to Junk Mail folder'), mailbox: Joi.string().hex().lowercase().length(24).empty('').description('Mailbox ID to store matching messages to'), targets: Joi.array() .items( diff --git a/lib/schemas/response/mailboxes-schemas.js b/lib/schemas/response/mailboxes-schemas.js index 7023a690..3b3eac9a 100644 --- a/lib/schemas/response/mailboxes-schemas.js +++ b/lib/schemas/response/mailboxes-schemas.js @@ -12,7 +12,7 @@ const GetMailboxesResult = Joi.object({ modifyIndex: Joi.number().required().description('Modification sequence number. Incremented on every change in the mailbox.'), subscribed: booleanSchema.required().description('Mailbox subscription status. IMAP clients may unsubscribe from a folder.'), retention: Joi.number().description( - 'Default retention policy for this mailbox (in ms). If set then messages added to this maibox will be automatically deleted after retention time.' + 'Default retention policy for this mailbox (in ms). If set then messages added to this mailbox will be automatically deleted after retention time.' ), hidden: booleanSchema.required().description('Is the folder hidden or not'), total: Joi.number().required().description('How many messages are stored in this mailbox'), diff --git a/lib/tasks/user-delete.js b/lib/tasks/user-delete.js index 40c2dce2..8462f245 100644 --- a/lib/tasks/user-delete.js +++ b/lib/tasks/user-delete.js @@ -109,7 +109,7 @@ const deleteRegistryAddresses = async (task, data) => { done = true; break; } - addresses = addresses.map(addresseData => addresseData._id); + addresses = addresses.map(addressData => addressData._id); lastId = addresses[addresses.length - 1]; let updateEntries = []; diff --git a/lib/tools.js b/lib/tools.js index 16cc8e14..98ddd138 100644 --- a/lib/tools.js +++ b/lib/tools.js @@ -20,8 +20,8 @@ const addressparser = require('nodemailer/lib/addressparser'); let templates = false; function checkRangeQuery(uids, ne) { - // check if uids is a straight continous array and if such then return a range query, - // otherwise retrun a $in query + // check if uids is a straight continuous array and if such then return a range query, + // otherwise return a $in query if (uids.length === 1) { return { @@ -106,7 +106,7 @@ function normalizeAddress(address, withNames, options) { } /** - * Generate a list of possible wildcard addresses by generating all posible + * Generate a list of possible wildcard addresses by generating all possible * substrings of the username email address part. * * @param {String} username - The username part of the email address. diff --git a/lib/user-handler.js b/lib/user-handler.js index 7db82ae5..f334f1d7 100644 --- a/lib/user-handler.js +++ b/lib/user-handler.js @@ -160,14 +160,14 @@ class UserHandler { addrview: { $in: partialWildcards } }; - let sortedDomainPartials = partialWildcards.map(addr => addr.replace(/^\*/, '')).sort((a, b) => b.lenght - a.length); + let sortedDomainPartials = partialWildcards.map(addr => addr.replace(/^\*/, '')).sort((a, b) => b.length - a.length); let sortedAliasPartials = []; if (aliasDomain) { // search for alias domain as well let aliasWildcards = tools.getWildcardAddresses(username, aliasDomain); query.addrview.$in = query.addrview.$in.concat(aliasWildcards); - sortedAliasPartials = aliasWildcards.map(addr => addr.replace(/^\*/, '')).sort((a, b) => a.lenght - b.length); + sortedAliasPartials = aliasWildcards.map(addr => addr.replace(/^\*/, '')).sort((a, b) => a.length - b.length); } let sortedPartials = sortedDomainPartials.concat(sortedAliasPartials); @@ -3648,7 +3648,7 @@ class UserHandler { // Step 1. restore user entry try { - existingAccount.address = ''; // clear for now, restore after address objects are sucessfully re-inserted + existingAccount.address = ''; // clear for now, restore after address objects are successfully re-inserted let r = await this.users.collection('users').insertOne(existingAccount); if (r.insertedId) { try { diff --git a/lmtp.js b/lmtp.js index c62e6284..b8439849 100644 --- a/lmtp.js +++ b/lmtp.js @@ -57,7 +57,7 @@ const serverOptions = { // reset session entries session.users = []; - // accept alls sender addresses + // accept all sender addresses return callback(); }, diff --git a/plugins/example.js b/plugins/example.js index b6dfa64b..dcdfcaa2 100644 --- a/plugins/example.js +++ b/plugins/example.js @@ -5,7 +5,7 @@ module.exports.title = 'Example Plugin'; module.exports.init = (app, done) => { // do your initialization stuff here - // init hook is called immediatelly after server is started + // init hook is called immediately after server is started app.addHook('init', async () => { app.logger.info('Example plugin initialized. Value1=%s', JSON.stringify(app.config)); }); diff --git a/setup/00_install_global_functions_variables.sh b/setup/00_install_global_functions_variables.sh index 74a9546a..9193eb24 100755 --- a/setup/00_install_global_functions_variables.sh +++ b/setup/00_install_global_functions_variables.sh @@ -18,7 +18,7 @@ export NC='\033[0m' # No Color # GLOBAL FUNCTIONS fun_get_password(){ -# If we are not root, we should aquire the sudo password +# If we are not root, we should acquire the sudo password if [ `whoami` == 'root' ] then PASSWORD='' diff --git a/tasks.js b/tasks.js index adc76ac2..d89d7bc0 100644 --- a/tasks.js +++ b/tasks.js @@ -213,7 +213,7 @@ module.exports.start = callback => { ensureCollections(() => { deleteIndexes(() => { ensureIndexes(() => { - // Do not release the indexing lock immediatelly + // Do not release the indexing lock immediately setTimeout(() => { gcLock.releaseLock(lock, err => { if (err) {