# GET /mail/check

First published 7 Nov 2026 (release 0.2.27) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the mail group.

Check the server hostname's public mail records and outbound reverse DNS

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

UrbeStack queries public DNS for the server hostname's mail records and checks reverse DNS for every IP address used to send mail. The response returns the results in check. If the hostname is a hosted domain, UrbeStack checks it as that domain and sets hosted to true. Otherwise, hosted is false.

UrbeStack returns 409 if the server lacks a hostname containing a dot or if the mail stack is disabled or missing. This operation requires an administrator and a token with the mail scope.

## 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/check" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "check": {
    "checked_at": "text",
    "dns": "here",
    "dns_server": "text",
    "failed": true,
    "hosted": true,
    "name": "alice",
    "nameservers": [
      "text"
    ],
    "records": [
      {
        "adds": [
          "text"
        ],
        "copy": {
          "name": "alice",
          "priority": 1,
          "type": "rebuild",
          "value": 8443
        },
        "expected": "text",
        "fix": "publish",
        "fqdn": "text",
        "inherited": "text",
        "key": "panel.port",
        "name": "alice",
        "state": "correct",
        "theirs": "text",
        "type": "A",
        "until": "text",
        "value": 8443,
        "world": [
          "text"
        ]
      }
    ],
    "resolver": "text",
    "resolvers": [
      "text"
    ],
    "reverse": [
      {
        "address": "info@example.com",
        "bound": true,
        "family": "ipv4",
        "hostname_address": true,
        "matches_hostname": true,
        "on_machine": true,
        "points_back": true,
        "ptr": "text",
        "state": "correct"
      }
    ]
  }
}
```

## Errors

- 400: <what> must be text without control characters, 1 to <max> characters
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid IPv4 address
- 400: Invalid IPv6 address
- 400: Invalid domain name
- 400: Invalid port
- 400: Invalid setting key
- 401: Authentication required
- 404: Setting '<key>' not found
- 409: The mail stack is not installed on this server
- 409: The server has no hostname to check
