Documentation
API reference and setup guide for mailer.khalid.id — a receive-only temp mail service.
Setup
DNS Configuration
Add an MX record pointing your domain to mailer.khalid.id:
Type: MX Host: @ (apex domain) Priority: 10 Value: mailer.khalid.id
For wildcard support (catch-all on any subdomain), add a second record:
Host: * Priority: 10 Value: mailer.khalid.id
Steps
- Add the MX record in your DNS provider
- Wait for propagation (usually seconds, up to 48h)
- On the Claim page, enter your domain and click Check MX
- Click Claim domain to get your API key
- Save the API key — it's shown only once
Cloudflare users: MX records must use DNS Only mode (gray cloud). Cloudflare's proxy does not support MX traffic.
API Reference
Base URL: https://mailer.khalid.id/api/v1
Authentication
Pass your API key in the X-API-Key header or as Authorization: Bearer <key>. Public endpoints don't need auth.
Pagination
List endpoints accept ?limit=N&offset=M. Default limit is 50, max 200.
Public Endpoints
Authenticated Endpoints
SMTP
The SMTP server listens on port 25 at mailer.khalid.id. It is receive-only — you cannot send outbound mail through it.
When a message arrives for a known domain, the server automatically creates a mailbox if one doesn't exist yet. Max message size is 10 MB.
Retention
- Messages are deleted after 1 hour
- Cleanup runs every 5 minutes
- Stats (counts) are permanent
Examples
Claim a domain
curl -X POST https://mailer.khalid.id/api/v1/domains \
-H 'Content-Type: application/json' \
-d '{"domain": "example.com"}'Create a mailbox
curl -X POST https://mailer.khalid.id/api/v1/mailboxes \
-H 'X-API-Key: tm_your_key_here' \
-H 'Content-Type: application/json' \
-d '{"local_part": "hello", "domain": "example.com"}'Create a random mailbox
curl -X POST https://mailer.khalid.id/api/v1/mailboxes \
-H 'X-API-Key: tm_your_key_here' \
-H 'Content-Type: application/json' \
-d '{"domain": "example.com"}'List mailboxes
curl https://mailer.khalid.id/api/v1/mailboxes \ -H 'X-API-Key: tm_your_key_here'
List messages
curl 'https://mailer.khalid.id/api/v1/mailboxes/hello@example.com/messages?limit=10' \ -H 'X-API-Key: tm_your_key_here'
Read a message
curl https://mailer.khalid.id/api/v1/messages/1 \ -H 'X-API-Key: tm_your_key_here'
Delete a message
curl -X DELETE https://mailer.khalid.id/api/v1/messages/1 \ -H 'X-API-Key: tm_your_key_here'