跳至内容

HTTP API

smtp-probe 内置 HTTP 服务器,提供编程方式访问。

启动服务器

smtp-probe serve                    # 默认::8080
smtp-probe serve --port 9090        # 自定义端口

接口概览

接口方法参数
/v1/healthGET
/v1/checkGETdomain=example.com
/v1/verifyGETemailbind_iptimeoutdisposablepool
/v1/blacklistGETip=1.2.3.4
/v1/reportGETdomain=example.com

示例

健康检查

curl http://localhost:8080/v1/health
# {"status":"ok"}

域名检查

curl "http://localhost:8080/v1/check?domain=gmail.com"
{
  "domain": "gmail.com",
  "score": 95,
  "spf": {"valid": true, "record": "v=spf1 redirect=_spf.google.com"},
  "dkim": {"valid": true},
  "dmarc": {"valid": true, "policy": "reject"},
  "mx": [{"host": "gmail-smtp-in.l.google.com", "priority": 5}],
  "ptr": {"valid": false}
}

邮箱验证

curl "http://localhost:8080/v1/verify?email=user@example.com"
curl "http://localhost:8080/v1/verify?email=user@example.com&bind_ip=1.2.3.4&timeout=30s"
curl "http://localhost:8080/v1/verify?email=user@example.com&disposable=true&pool=true"

黑名单检查

curl "http://localhost:8080/v1/blacklist?ip=1.2.3.4"

完整报告

curl "http://localhost:8080/v1/report?domain=example.com"