← All installation guides High Security Email Integrations

Set up High Security email on Python EmailMessage and SMTP

Create the Python EmailMessage identity, request its VEM code, add the returned header and MIME footers, then submit the finished message through SMTP.

PY
Recommended methodServer-side per-message API
Trusted-server integration

Create, bind and deliver each message code safely

  1. 1

    Protect the key

    Load the VerifySeal key from a server environment variable or secret store. Keep it out of source code, notebooks, browser applications and generated email content.

  2. 2

    Create a standards-based Message-ID

    Use email.utils.make_msgid with a sender-controlled domain and assign the returned value to the Message-ID header before requesting a code. Persist it with the queue record for retries.

  3. 3

    Call the VerifySeal API

    Use a server HTTP client with TLS verification, an Authorization Bearer header, JSON body and short timeout. Check the response status before reading message_code.

  4. 4

    Add header and MIME footers

    Add the returned X-VerifySeal-Code value as a header. Append text_footer to the plain part and html_footer to the HTML alternative before serializing the EmailMessage.

  5. 5

    Submit only the final message

    Send the completed EmailMessage with smtplib or your delivery library. DKIM must be applied only after the Message-ID, header and both bodies are final.

  6. 6

    Test source and retries

    Inspect an externally received source and verify the public code. Retry one queued job and confirm it reuses the same Message-ID, idempotency key and code.

Open Python EmailMessage and SMTP examples ↗
High Security still requires domain authentication

A VEM code does not replace SPF, DKIM or DMARC

The sender domain must continue to publish a valid SPF record, the selected DKIM key and a DMARC policy. VerifySeal automatically rechecks these records according to the administrator schedule. For High Security messages, DKIM must cover the final Message-ID, VEM header and completed body.

  • SPF authorizes sending services
  • DKIM verifies the signed message domain
  • DMARC publishes the domain policy
Testing checklist

Confirm the installation is working

01

Message-ID

The exact final Message-ID is created before the API request and matches the sent email.

02

VEM code

The returned header and footer are present and the public verification link opens.

03

DKIM last

The receiving service reports an aligned DKIM and DMARC pass after all content was inserted.

04

Revocation

Revoking the test code immediately changes its public status.

Platform notes
  • The Python standard library provides EmailMessage, make_msgid and SMTP submission primitives; the HTTP request needs your chosen server-side HTTP library.
  • Do not create a new Message-ID during SMTP retry handling.