Skip to main content
Version: 0.16

QueuedMessage

Represents a queued email message pending delivery.

This object can be configured from the WebUI under Management › Emails › Queued

Fields

createdAt

Type: UTCDateTime · server-set

When the message was received and queued

nextRetry

Type: UTCDateTime?

When the next delivery attempt is scheduled

nextNotify

Type: UTCDateTime? · server-set

When the next DSN notification is scheduled

blobId

Type: BlobId · server-set

Reference to the stored message content

returnPath

Type: String · server-set

Envelope sender address (MAIL FROM)

recipients

Type: Map<EmailAddress, QueuedRecipient>

List of envelope recipients and their delivery status

receivedFromIp

Type: IpAddr · server-set

IP address of the client that submitted the message

receivedViaPort

Type: UnsignedInt · server-set · default: 25 · min: 1 · max: 65535

Local port on which the message was received

flags

Type: MessageFlag[] · server-set

Classification flags for the message

envId

Type: String?

SMTP ENVID parameter for delivery status notifications

priority

Type: Integer · default: 0 · min: -100 · max: 100

Message priority (lower values = higher priority)

size

Type: UnsignedInt · server-set · default: 0

Size of the message in bytes

JMAP API

The QueuedMessage object is available via the urn:stalwart:jmap capability.

x:QueuedMessage/get

This is a standard Foo/get method as defined in RFC 8620, Section 5.1.

This method requires the sysQueuedMessageGet permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:QueuedMessage/get",
{
"ids": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

x:QueuedMessage/set

This is a standard Foo/set method as defined in RFC 8620, Section 5.3.

Supports create, update, and destroy operations in a single call.

Create

This operation requires the sysQueuedMessageCreate permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:QueuedMessage/set",
{
"create": {
"new1": {
"envId": "Example",
"nextRetry": "2026-01-01T00:00:00Z",
"priority": 0,
"recipients": {}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

Update

This operation requires the sysQueuedMessageUpdate permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:QueuedMessage/set",
{
"update": {
"id1": {
"envId": "updated value"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

Destroy

This operation requires the sysQueuedMessageDestroy permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:QueuedMessage/set",
{
"destroy": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

x:QueuedMessage/query

This is a standard Foo/query method as defined in RFC 8620, Section 5.5.

This method requires the sysQueuedMessageQuery permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:QueuedMessage/query",
{
"filter": {
"text": "example"
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

The x:QueuedMessage/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):

ConditionKind
texttext
totext
duedate
queueNametext
returnPathtext

CLI

stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.

Fetch

stalwart-cli get queued-message id1

Create

stalwart-cli create queued-message \
--field nextRetry=2026-01-01T00:00:00Z \
--field 'recipients={}' \
--field envId=Example \
--field priority=0

Query

stalwart-cli query queued-message
stalwart-cli query queued-message --where text=example

Update

stalwart-cli update queued-message id1 --field description='Updated'

Delete

stalwart-cli delete queued-message --ids id1

Nested types

QueuedRecipient

Delivery status and scheduling for a message recipient.

retryCount

Type: UnsignedInt · default: 0

Number of delivery attempts made

retryDue

Type: UTCDateTime · required

When the next delivery attempt is scheduled

notifyCount

Type: UnsignedInt · default: 0

Number of DSN notifications sent

notifyDue

Type: UTCDateTime · required

When the next DSN notification is scheduled

expires

Type: QueueExpiry · required

Message expiry information for this recipient

queueName

Type: String · server-set · max length: 8

Queue name for this recipient

status

Type: RecipientStatus · required

Current delivery status

flags

Type: RecipientFlag[] · server-set

Status flags for this recipient

orcpt

Type: String?

Original recipient address (SMTP ORCPT parameter)

QueueExpiry

Message expiry strategy for a queued recipient.

QueueExpiryTtl

TTL-based message expiry settings.

expiresAt

Type: UTCDateTime · required

Absolute time when the message expires

QueueExpiryAttempts

Attempt-based message expiry settings.

expiresAttempts

Type: UnsignedInt · default: 0

Maximum number of delivery attempts before the message expires

RecipientStatus

Delivery status for a queued message recipient.

  • Scheduled: Delivery is pending. No additional fields.
  • Completed: Message was successfully delivered. Carries the fields of ServerResponse.
  • TemporaryFailure: Delivery failed temporarily, will retry. Carries the fields of DeliveryError.
  • PermanentFailure: Delivery failed permanently, will not retry. Carries the fields of DeliveryError.
ServerResponse

SMTP server response details.

responseHostname

Type: String?

Hostname of the remote server that responded

responseCode

Type: UnsignedInt? · min: 100 · max: 599

SMTP response code from the remote server

responseEnhanced

Type: String?

SMTP enhanced status code (e.g., "4.7.1")

responseMessage

Type: String?

SMTP response message from the remote server

DeliveryError

Details of a delivery error including the triggering command.

errorType

Type: DeliveryErrorType · required

Type of delivery error encountered

errorMessage

Type: String?

Detailed error message

errorCommand

Type: String?

SMTP command that triggered an unexpected response

responseHostname

Type: String?

Hostname of the remote server that responded

responseCode

Type: UnsignedInt? · min: 100 · max: 599

SMTP response code from the remote server

responseEnhanced

Type: String?

SMTP enhanced status code (e.g., "4.7.1")

responseMessage

Type: String?

SMTP response message from the remote server

Enums

DeliveryErrorType

ValueLabel
dnsErrorDNS resolution failed
unexpectedResponseRemote server returned an unexpected SMTP response
connectionErrorFailed to establish connection to remote server
tlsErrorTLS handshake or encryption failed
daneErrorDANE validation failed
mtaStsErrorMTA-STS policy validation failed
rateLimitedDelivery delayed due to rate limiting
concurrencyLimitedDelivery delayed due to connection limits
ioNetwork I/O error occurred

RecipientFlag

ValueLabel
dsnSentA delivery status notification has been sent for this recipient
spamPayloadMessage content was classified as spam

MessageFlag

ValueLabel
authenticatedMessage was received from an authenticated session
unauthenticatedMessage was received without authentication
unauthenticatedDmarcMessage was received without authentication but passed DMARC
dsnMessage is a Delivery Status Notification
reportMessage is an automated report (DMARC, TLS-RPT, etc.)
autogeneratedMessage was automatically generated by the server