# GET /mail/greylist

First published 19 Nov 2026 (release 0.2.30) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the mail group.

List messages deferred by greylisting

- Who may call it: administrator
- Token scope, any of: mail, read, all
- Answers: 200 OK

Returns a page of messages in greylist, ordered by most recent delivery attempt first. Greylisting defers suspicious mail. Each message appears from its first deferral and remains listed for as long as Rspamd remembers it.

Each entry includes the sending server's IP address and its verified name if available, the sender and recipients, the first and last deferral times, the number of deferrals, when a retry can pass and when a retry passed if one has. The response counts text matches by state before applying the state filter or pagination.

The API returns 400 for an invalid match or state, or when limit or offset fails integer validation. Requires an administrator token with the mail scope.

## As a command

- [urbestack-mail-greylist-list](https://urbestack.com/docs/commands/urbestack-mail-greylist-list.md): Lists messages deferred by greylisting.

## Parameters

- `match` (query, string, up to 200 characters): Substring to match in the sender or recipient email addresses, the sending server's IP address or its name. Accepts up to 200 characters with no control characters.
- `state` (query, string, one of waiting, ready, let_through, passed): State to include. Use waiting if a retry would still be deferred, ready if the next retry can pass, let_through if the message was released manually and awaits a retry, or passed if a retry passed greylisting.
- `limit` (query, integer, 1 to 1000): Maximum number of messages to return, from 1 to 1000. Defaults to 200.
- `offset` (query, integer, 0 to 1000000): Number of matching messages to skip, from 0 to 1,000,000.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X GET "$API/mail/greylist?match=text&state=waiting&limit=1&offset=1" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "greylist": {
    "available": 1,
    "error": "Domain 'example.com' already exists",
    "held": [
      {
        "dkim": [
          "text"
        ],
        "first_at": "text",
        "host": "text",
        "id": 1,
        "ip": "203.0.113.7",
        "last_at": "text",
        "let_through_at": "text",
        "passed_at": "text",
        "passes_from": "text",
        "recipients": [
          "text"
        ],
        "sender": "text",
        "sender_domain": "text",
        "spf": 1,
        "state": "waiting",
        "tries": 1,
        "verified_by": [
          "spf"
        ]
      }
    ],
    "read_at": "text",
    "states": {
      "let_through": 1,
      "passed": 1,
      "ready": 1,
      "waiting": 1
    },
    "total": 1,
    "waiting": 1
  }
}
```

## Errors

- 400: --<k> is a whole number up to <max>
- 400: --match is text without control characters, 200 characters at most
- 400: --state is waiting, ready, let_through or passed
- 400: <what> must be a whole number from 0 to <max>
- 400: <what> must be text without control characters, 1 to <max> characters
- 400: state is one of: 
- 400: state is waiting, ready, let_through or passed
- 401: Authentication required
- 403: Only an administrator can view the complete list of held senders.
