- Webhooks still receive it, with
email.spam.isJunk: true. See Webhook Structure. - IMAP shows it in the
Junkfolder instead ofINBOXand the scope folders. See IMAP Behavior. - The mailbox API lists it in the
Junkfolder (folder=junkon the older/messagesendpoint), and the email API returnsspam.is_junk.
Junk without changing the account’s verdict.
Filter levels
Set the level in the Mailboxes & SMTP dashboard or withPUT /api/e2/spam-filter. It applies to the whole account and to emails received after the change; earlier verdicts aren’t recalculated. GET /api/e2/spam-filter returns the current level:
isDefault is true while the level has never been set. PUT returns the same shape.
Each email gets a level from 0 (none) to 4 (clear) for spam, phishing, fraud, malware and impersonation. An email is junk when any one of these categories meets the account’s level.
For spam, phishing and fraud, the classifier usually gives the probability that the level is at least 2, at least 3, or exactly 4. Those probabilities decide:
Malware and impersonation, and spam, phishing or fraud when probabilities are missing, use the level and the classifier’s confidence instead. The classifier counts as confident when its confidence is at least 0.6 and its own level, before any authentication rules raised it, is 2 or higher:
Failed authentication (for example a DMARC failure) can raise a level. Without the classifier backing it, a raised level counts at
strict but not at standard or lenient.
Prompt injection (text aimed at an AI reading the email) is checked too, but never marks an email as junk by itself.
Unless the level is off, an email that fails the receiving server’s spam check or virus scan is also marked as junk. A failed virus scan counts as clear malware.
Guard rules
Guard rules take precedence over the filter level, includingoff:
- The
junkaction marks matching emails as junk without blocking them. - The
allowaction marks matching emails as not junk, even if the filter would flag them. - The
blockaction still blocks delivery entirely.
Per-mailbox spam settings
A mailbox credential can override the account level and keep its own sender lists. These settings only decide whether a message is in that credential’sINBOX or Junk.
Use an account API key with
/mailboxes/{mailboxId}/spam, or a mailbox password with /mailboxes/me/spam when the credential’s selfService.spam is enabled. See Access and Limits.
PUTrequireslevel,allowandblock. Every endpoint returns the full settings:level,effectiveLevel,allowandblock, whereeffectiveLevelis the level in use after falling back to the account’s.levelisoff,lenient,standard,strictornull.nulluses the account level.allowandblockhold up to 1,000 patterns each. A pattern is an exact email address, such asboss@example.net, or a whole domain written as@partner.example. Patterns are stored in lowercase and compared with the message’s firstFromaddress; a domain pattern doesn’t include subdomains. A pattern can’t be on both lists (PUTreturns400), adding to a full list returns409, and removing a pattern that isn’t on the list returns404.- Allowed senders stay in
INBOX; blocked senders go toJunk. Blocking doesn’t reject or drop mail. - Settings apply to new mail as it arrives. Changing the level or lists also re-sorts mail already in this mailbox’s
INBOXandJunkunder the new settings, in batches of at most 500 messages per sync, newest first. Later mailbox reads and syncs continue the catch-up; a settings update does not reclassify the whole mailbox before returning. Until a message is processed, its previous verdict remains in use. Messages with a decision of their own (step 1 below) and messages a filter moved to another folder stay where they are.
- A message you moved into or out of
Junkin this mailbox, or that a filter marked, keeps that decision. - A sender on the allow list is not junk, even when a domain on the block list, an account decision or the level would mark it.
- A sender on the block list is junk.
- A decision you made for the whole account, or a matching Guard rule, applies.
- Otherwise the mailbox’s
levelapplies, with the same thresholds as the account levels.offmarks nothing, andnulluses the account verdict.
Correcting a verdict
Moving a message betweenINBOX and Junk in an email client, or setting isJunk with PATCH /api/e2/mailboxes/{id}/messages/{messageId}, records your decision for that mailbox credential only. It doesn’t change the account verdict, other credentials, the spam fields in the email API or webhooks.
Setting is_junk with PATCH /api/e2/emails/{id} records your decision for the email across the account. Mailboxes follow it unless they have their own decision for the message or the sender is on their allow or block list. Automatic verdicts never override a decision you made.
Account-wide decisions made by moving messages in a mailbox before per-mailbox settings existed are kept as account decisions with reason
user. They are not converted into per-mailbox decisions.classifier, ses_spam, guard_rule or user.