MultiMail provisions domains with SPF, DKIM, and DMARC alignment and adds signed identity metadata so every agent-sent email is both deliverable and provable.
Standard email authentication protocols — SPF, DKIM, DMARC, ARC — were designed for servers, not agents. They answer 'did this domain send this message?' but not 'which agent sent it, under whose authorization, and with what oversight level?' Teams building production AI agents hit this gap quickly: deliverability requires proper DNS alignment, but compliance under frameworks like the EU AI Act also requires provenance — knowing exactly which model instance generated an email and whether a human approved it. Bolting identity tracking onto standard authentication after the fact produces fragile, unauditable systems.
MultiMail handles both layers together. Domain provisioning generates DKIM keypairs, publishes SPF and DMARC records, and configures ARC sealing automatically. On top of that, every outbound message carries a cryptographically signed X-MultiMail-Identity header that records the agent ID, oversight mode, and whether the send was human-approved. Recipients — and your own audit logs — can verify both the domain authentication chain and the agent provenance chain independently. This means standard spam filters see a properly authenticated sender while your compliance tooling sees a fully attributable agent action.
Call the domain configuration endpoint with your domain. MultiMail generates a DKIM keypair (RSA-2048 or Ed25519), returns the DNS records you need to publish, and sets the selector. You keep ownership of your domain; MultiMail signs on your behalf using the provisioned key.
Publish the TXT records for SPF (v=spf1 include:send.multimail.dev ~all), DKIM selector, and DMARC policy. MultiMail polls for propagation and runs an alignment check — SPF envelope-from, DKIM d= tag, and From header domain must all match for DMARC to pass. Misalignment is reported before you send a single message.
When your agent calls send_email or reply_email, MultiMail appends a signed X-MultiMail-Identity header containing the agent_id, the oversight_mode active at send time, and an approval_ref if a human approved the action. The signature uses the same Ed25519 keypair as your DKIM configuration so the provenance chain is tied to your domain authentication.
Every outbound message leaves MultiMail with DKIM signature, SPF alignment, DMARC policy in effect, ARC sealing for forwarded messages, and the agent identity header. Your audit log records the full authentication state for every send event.
import requests
headers = {
"Authorization": "Bearer $MULTIMAIL_API_KEY",
"Content-Type": "application/json",
}
"cm"># Configure domain — returns DKIM selector and DNS record values
resp = requests.post(
"https://api.multimail.dev/v1/domains",
headers=headers,
json={
"domain": "mail.yourcompany.com",
"dkim_key_type": "ed25519",
"dmarc_policy": "quarantine",
"dmarc_rua": "mailto:[email protected]",
},
)
domain = resp.json()
print("Publish these DNS records:")
for record in domain["dns_records"]:
print(f" {record[&"cm">#039;type']} {record['name']} → {record['value']}")
"cm"># Output:
"cm"># TXT mail.yourcompany.com → v=spf1 include:send.multimail.dev ~all
"cm"># TXT mm1._domainkey.mail.yourcompany.com → v=DKIM1; k=ed25519; p=<pubkey>
"cm"># TXT _dmarc.mail.yourcompany.com → v=DMARC1; p=quarantine; rua=mailto:...
Configure a sending domain and retrieve the DNS records to publish. Call this once per domain; MultiMail returns the exact TXT record values.
import requests
import time
headers = {"Authorization": "Bearer $MULTIMAIL_API_KEY"}
domain_id = "dom_01abc123"
for attempt in range(12): "cm"># up to 60 minutes
resp = requests.post(
f"https://api.multimail.dev/v1/domains/{domain_id}/verify",
headers=headers,
)
result = resp.json()
if result["status"] == "aligned":
print("Domain fully aligned:")
print(f" SPF: {result[&"cm">#039;checks']['spf']}")
print(f" DKIM: {result[&"cm">#039;checks']['dkim']}")
print(f" DMARC: {result[&"cm">#039;checks']['dmarc']}")
print(f" Alignment: {result[&"cm">#039;checks']['alignment']}")
break
elif result["status"] == "misaligned":
print(f"Misalignment detected: {result[&"cm">#039;detail']}")
break
else:
print(f"Still propagating... (attempt {attempt + 1}/12)")
time.sleep(300)
Poll for DNS propagation and run the alignment check. MultiMail validates that SPF, DKIM, and DMARC are all correctly aligned before you send production traffic.
import requests
headers = {
"Authorization": "Bearer $MULTIMAIL_API_KEY",
"Content-Type": "application/json",
}
resp = requests.post(
"https://api.multimail.dev/v1/send_email",
headers=headers,
json={
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Your AI email authentication setup is complete",
"text": (
"SPF, DKIM, and DMARC are aligned, and MultiMail identity "
"signing is active for verifiable agent email. "
"Every message from this mailbox carries a signed provenance "
"header so recipients and auditors can verify the sending agent."
),
"agent_id": "onboarding-agent-v2",
"oversight_mode": "monitored",
"cm"># X-MultiMail-Identity header is added and signed automatically
},
)
msg = resp.json()
print(f"Message ID: {msg[&"cm">#039;message_id']}")
print(f"Authentication: {msg[&"cm">#039;authentication']}")
"cm"># authentication: { spf: 'pass', dkim: 'pass', dmarc: 'pass', identity_signed: true }
Send an email that carries both standard DKIM authentication and a signed agent identity header. The oversight_mode and agent_id appear in the X-MultiMail-Identity header on every outbound message.
import requests
import base64
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
from cryptography.hazmat.primitives.serialization import load_der_public_key
def verify_agent_identity(identity_header: str) -> dict:
"""
Verify an X-MultiMail-Identity header.
Header format: agent_id=<id>; oversight=<mode>; sig=<base64>
"""
parts = dict(p.strip().split("=", 1) for p in identity_header.split(";"))
agent_id = parts["agent_id"]
oversight = parts["oversight"]
sig_bytes = base64.b64decode(parts["sig"])
# Fetch the public key for this agent from MultiMail
resp = requests.get(
f"https://api.multimail.dev/v1/identity/pubkey/{agent_id}",
headers={"Authorization": "Bearer $MULTIMAIL_API_KEY"},
)
pubkey_der = base64.b64decode(resp.json()["public_key_der"])
pub = load_der_public_key(pubkey_der)
# Signed payload is agent_id + oversight concatenated
payload = f"{agent_id}:{oversight}".encode()
try:
pub.verify(sig_bytes, payload)
return {"verified": True, "agent_id": agent_id, "oversight": oversight}
except Exception:
return {"verified": False}
# Example usage
result = verify_agent_identity(
"agent_id=onboarding-agent-v2; oversight=monitored; sig=ABC123..."
)
print(result) "cm"># {'verified': True, 'agent_id': 'onboarding-agent-v2', 'oversight': 'monitored'}
Parse and verify the X-MultiMail-Identity header on a received message. Use the MultiMail public key endpoint to validate the signature without storing credentials.
# In a Claude Desktop session with MultiMail MCP connected:
# Step 1 — provision the domain
Tool: configure_domain
Arguments:
domain: mail.yourcompany.com
dkim_key_type: ed25519
dmarc_policy: quarantine
# Step 2 — verify alignment after publishing DNS records
Tool: verify_domain_alignment
Arguments:
domain_id: dom_01abc123
# Step 3 — send an authenticated message
Tool: send_email
Arguments:
from: [email protected]
to: ["[email protected]"]
subject: Authentication setup confirmed
text: SPF, DKIM, DMARC, and identity signing are all active.
agent_id: onboarding-agent-v2
oversight_mode: monitored
# MultiMail signs the message, adds the X-MultiMail-Identity header,
# and returns authentication state in the response.
Configure domain authentication and send a verified email using the MultiMail MCP server in a Claude Desktop or Cursor workflow.
MultiMail generates correct SPF, DKIM, and DMARC record values for your domain and verifies alignment before your agent sends a single message. Misconfigured authentication is the most common cause of AI-sent email landing in spam.
The signed X-MultiMail-Identity header records which agent sent each message, under which oversight mode, and whether a human approved it. This is separate from DKIM — domain authentication proves the sender, identity signing proves the agent.
The EU AI Act requires disclosure and traceability for AI-generated content. MultiMail's identity headers and audit log provide the artifact trail auditors need: agent ID, model version, oversight level, and approval records per message.
Authenticated Received Chain (ARC) preserves the authentication state when messages are forwarded through mailing lists or other intermediaries. MultiMail seals ARC headers automatically so your agent's email survives forwarding without losing DMARC pass status.
Every domain verification, DKIM signing event, and identity signature is written to the MultiMail audit log. You can query by agent_id, domain, or time range to reconstruct exactly what was sent, when, and by which agent.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 50-tool MCP server. Formally verified in Lean 4.