Skip to Content

Test address list policy against an address.

Evaluates inbound or outbound address list policies for a specific address to test whether it would be allowed, blocked, or bypassed.

openemail.mailboxAddressLists.evaluate(
  mailboxId: string,
  body: MailboxAddressListsEvaluateBody,
  options?: CallOptions,
): ApiPromise<AddressListVerdict>

It calls POST /mailboxes/{mailboxId}/lists/evaluate: Test address list policy against an address in the API reference.

Example

const addressListVerdict = await openemail.mailboxAddressLists.evaluate(mailboxId, { direction: 'inbound' })

Arguments

ArgumentTypeDescription
mailboxIdstringMailbox ULID identifier. The path's {mailboxId}.
bodyMailboxAddressListsEvaluateBodyThe request's body.

Options

It takes no options of its own. Every call also takes signal, timeout, retry and headers, which say how that one call is sent (call options).

Answer

Awaited, it is the API's JSON, AddressListVerdict. It is an ApiPromise: .withResponse() gives the same with the Response it came in, for its headers.

Errors

StatusWhat it means
400validation_failed, or invalid_pattern
401unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a WWW-Authenticate: Bearer challenge
404not_found — the account, mailbox, scope or list is not accessible
413too_large: JSON request body exceeds 1 MiB or 500,000 values (object keys included), checked before parsing
503temporary_failure — a contact lookup a flagged catch-all required could not answer; retry

A failed call rejects with a RequestError: its status, and its code, the API's error. Decide on the code: one status covers several.

Types

MailboxAddressListsEvaluateBody

/** The body of `mailboxAddressLists.evaluate`. */
type MailboxAddressListsEvaluateBody = {
  /** Target email address to evaluate, taken as vouched. Required unless `envelopeFrom` simulates a message. */
  address?: string
  /** Traffic direction ('inbound' or 'outbound') */
  direction: ('inbound' | 'outbound')
  /** Message simulation: the DMARC verdict for the From (`pass` vouches for a single-domain From) */
  dmarc?: string
  /** Narrow the chain with a domain scope you own. With a mailbox and no domain, the mailbox's own domain, as every delivery door judges it. */
  domain?: string
  /** Message simulation: the envelope sender (empty for a null sender, which skips the catch-all floor as delivery does). Judged with `from`, `spf`, `dmarc` and `submitted` the way an arriving message would be. */
  envelopeFrom?: string
  /** Message simulation: the RFC 5322 From addresses (judged up to the evaluator's own candidate bound, as delivery is) */
  from?: string[]
  /** …and/or a mailbox scope you own */
  mailboxId?: string
  /** Message simulation: the SPF verdict for the envelope sender (`pass` vouches for it) */
  spf?: string
  /** Message simulation: an authenticated local submission, which vouches for the envelope and the From */
  submitted?: boolean
}

It names these types of the API, each on a page of its own: AddressListVerdict.