# Postfix Integration: Email Validation

URL: https://email-validation.org/integrations/postfix/
Updated: 2026-11-29

> Documentation index: https://email-validation.org/llms.txt

A small policy service lets a Postfix server check the outside recipients of the mail your users send, while it is being submitted. Until you turn on refusing it only logs each result, and when a check cannot be made in time Postfix carries on and the mail goes out as usual.

[Read the full setup guide](https://email-validation.org/docs/guides/postfix/) [Get an API key](https://email-validation.org/signin/)

- Status: Setup guide
- One zip: the ev-policy daemon and one main.cf line

**main.cf** Postfix 3.0 or later

/etc/postfix/main.cf

```text
# first in the list, above what is there
smtpd_recipient_restrictions =
    check_policy_service { unix:private/ev-policy, timeout=5s, default_action=DUNNO, try_limit=1 }
    ...the entries you already have...
```

## At a glance.

- **Status**: **Setup guide.** Not listed on a marketplace yet: you set it up yourself in a few steps, below and in the full guide.
- **For**: Mail administrators and hosting providers who run Postfix as the server their users send through, and want to see, and if they choose refuse, the mail addressed to mailboxes that do not exist.
- **You need**: A Postfix 3.0 or later server you are root on, with Python 3 (standard library only, no packages) and systemd for the service, and an [API key](https://email-validation.org/app/api-keys/) made for it, with a [daily credit cap](https://email-validation.org/docs/authentication/#limits).
- **Costs**: 1 credit = 1 validated address, as with any API request. Free: unknown results, API errors, malformed addresses, test addresses on sandbox.email-validation.org and, in a bulk list, repeats of an address (charged once).
- **Full guide**: [Read the full setup guide](https://email-validation.org/docs/guides/postfix/)

## Typical uses.

- **See who mails dead addresses**: The default log mode writes one line per checked recipient with its status and reason, and Postfix’s queue id, so you learn which senders reach addresses that do not exist before you change anything.
- **Refuse what you choose**: With `mode = reject`, a recipient whose status you list (by default invalid and disposable) is refused with a 5xx text you can edit. The sender sees it at once instead of a bounce later, and the other recipients still get the message.
- **Protect the server’s name**: Mail to addresses that do not exist is what mailbox providers count against a sending server. Reject mode keeps that mail from leaving, for when your reputation matters more than the chance of a wrong refusal.

## Set it up. 5 steps.

The short version of the [full setup guide](https://email-validation.org/docs/guides/postfix/), which stays the reference when a step does not match what you see.

1. **Download the zip and make a key**: There is no package repository yet: download ev-policy-1.0.0.zip from the guide, which unpacks into a folder ev-policy/. Create an API key for the server with Validate addresses and a daily credit cap.
2. **Put the files in place**: Put the key in `/etc/ev-policy/api-key` (one line, `chmod 600`), copy `ev_policy.py` and `ev-policy.conf` into place, set `outbound_networks` to your relay hosts, then run the service with `--check-config`.
3. **Start the service**: Install `ev-policy.socket` and `ev-policy.service` in `/etc/systemd/system/` and run `systemctl enable --now ev-policy.socket`. On a systemd older than 247, the guide shows how to run it as its own user instead.
4. **Add the line to main.cf**: Make the `check_policy_service` line the first entry of `smtpd_recipient_restrictions`. A service in `master.cf` with a list of its own, often `submission`, gets the check through a named list.
5. **Check, reload and try it**: Run `postfix check` and `postfix reload`, then try `no_mailbox@sandbox.email-validation.org` as the recipient in a session that logs in and ends after `RCPT TO` (`swaks --auth … --quit-after RCPT`), so nothing is sent, and read the log line. Never send a whole message to a test address: log mode lets it out and the bounce hurts your sender.

## Good to know.

- Only outbound mail is checked: a client that logged in, or one of the servers you list in outbound\_networks. Recipients at your own domains, mail arriving for your users and messages submitted with the sendmail command are not.
- It never asks Postfix to delay mail. A check with no answer after a few seconds finishes in the background for the next message, and when the service is stopped or silent, Postfix carries on by itself.
- Its own cache, a limit per sender, a daily limit for all senders together and the key’s daily credit cap bound what it spends; all but the last can be changed in its settings file. An answer from the cache costs nothing.
- It sends only each outside recipient’s address, in the body of a request, never in a URL. Its cache holds keyed hashes and its log short hashes, never an address or the key. `region = eu` sends the checks to our [EU host](https://email-validation.org/docs/eu-data-residency/).
- The optional X-EV-Recipient-Status header reaches every copy of the message, Bcc recipients included, so the guide keeps it for relays with no local mailboxes.
- To switch it all off at once, run `systemctl stop ev-policy.socket ev-policy.service`: Postfix goes on delivering as before.

## Related

- [The full Postfix setup guide](https://email-validation.org/docs/guides/postfix/)
- [What gets checked, and what does not](https://email-validation.org/docs/guides/postfix/#scope)
- [Log, reject and header modes](https://email-validation.org/docs/guides/postfix/#modes)
- [What happens when a check fails](https://email-validation.org/docs/guides/postfix/#failures)
- [rspamd integration](https://email-validation.org/integrations/rspamd/)
- [DirectAdmin integration](https://email-validation.org/integrations/directadmin/)
- [Exim and cPanel integration](https://email-validation.org/integrations/exim/)
- [Plesk integration](https://email-validation.org/integrations/plesk/)
- [All integrations](https://email-validation.org/integrations/)
