Create, bind and deliver each message code safely
-
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
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
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
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
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
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.