Mail servers and panels

Postfix integration

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 guideGet an API key

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

main.cfPostfix 3.0 or later

/etc/postfix/main.cf
# 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 made for it, with a daily credit cap.
Costs
1 credit = 1 validated address, as with any API request. Free: unknown results, API errors, malformed addresses and test addresses on sandbox.email-validation.org.
Full guide
Read the full setup guide

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, which stays the reference when a step does not match what you see.

Read the full setup guide

  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.

  • 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.

Connect Postfix.

Test it on our sandbox addresses for free, then on your own contacts.

Create your accountRead the full setup guide

Updated · Maintained by: Email Validation LLC