How-To

Transactional Email Service With S/MIME Signing: Options

Most transactional email services don't sign mail with S/MIME; they send what you give them. The workable pattern is to sign the message yourself or at a gateway, then pass the finished raw MIME through a provider that doesn't rewrite it, such as Amazon SES over SMTP, with tracking off.

Sohail HussainSohail Hussain11 min read

Short answer

  • Mandrill (Mailchimp Transactional) is not known to sign mail with your S/MIME certificate, so signed traffic needs a different path. Amazon SES documents server-side S/MIME signing with a certificate you manage in AWS Certificate Manager.
  • If you can't use that, sign the message yourself and send the raw MIME through SES SMTP, or put a signing gateway such as CipherMail in front of your relay.
  • Send a test and check the signature in a real mail client before you rely on it.

Your contract says outbound email must be S/MIME-signed. Mandrill has no signing option, and searches for a "transactional email service with S/MIME signing" mostly return encryption gateways or nothing. People in community threads have described the same dead end: no provider advertised signing with your own certificate. That is no longer quite true, and where it still is true, there is a reliable workaround.

Why a transactional API can't just add a signature

S/MIME signing (defined in RFC 8551) computes a signature over the message content and its MIME structure, using the private key of a certificate issued for the sender's address. With a detached signature the message becomes multipart/signed: the original content is the first part, and the signature, typically smime.p7s, is the second. Change one byte of the signed part afterward and verification fails.

That is the structural problem. A transactional API takes JSON (subject, HTML, recipients) and builds the MIME message itself. Many providers then modify it in transit, for example with open and click tracking, link rewriting, footers or re-encoding. Any change made after your signature was computed breaks it. A provider could sign last, after its own changes, but that requires holding your private key, which many security teams refuse to allow.

Amazon's documentation describes exactly that design for SES: Amazon SES signs the message server-side at send time. SES applies open and click tracking, template rendering and subscription link insertion before it signs, so those features stay compatible with S/MIME signing. I could not confirm a comparable feature at Mandrill or other providers from official documentation, so ask each vendor directly before you plan around it.

S/MIME does not replace DKIM. DKIM proves the domain authorized the message; S/MIME proves the holder of a certificate for that specific address sent it. When both are enabled, SES applies the S/MIME signature before the DKIM signature, which keeps the DKIM signature intact. Keep SPF, DKIM and DMARC in place either way.

Fix 1: let Amazon SES sign for you

This is the least code. SES can apply an S/MIME signature automatically, without you signing before submission, and you manage the certificate in AWS Certificate Manager (ACM).

Check the certificate first

AWS lists these requirements in its S/MIME documentation for SES:

  • The certificate must be in ACM in the same AWS Region where you send.
  • The email identity must be verified, by domain (TXT record) or by email address.
  • The certificate's Subject Alternative Name must include an RFC822Name that matches the From address: an address under the domain for a domain identity, an exact match for an address identity.
  • The key must be RSA 2048, 3072 or 4096, or EC P-256, P-384 or P-521.
  • The certificate must be currently valid.

If your contract needs recipients to trust the signature, buy the certificate from a public CA. A private CA only works if recipients install and trust your root.

Turn on signing

  1. Import or request the S/MIME certificate in ACM, in the Region you send from.
  2. Associate it with your verified SES identity. The SES API v2 has an operation for this, AssociateEmailIdentityCertificate; the certificate is an X.509 certificate managed in ACM and identified by its ARN. If the identity is a domain, you must give a FromAddress that belongs to that domain or a subdomain.
  3. In the SES console, go to Configuration > Configuration sets and choose the set you want.
  4. On the Overview tab, in General details, choose Edit. Under Secure email, select Enable S/MIME signing, then choose Save changes. These are the steps AWS documents.
  5. Send your mail through that configuration set. Over SMTP, add the header X-SES-CONFIGURATION-SET: my-config-set to each message.
  6. Use Send test email on the identity detail page. When the configuration set has S/MIME signing enabled, the test message is S/MIME signed.

From the CLI, AWS gives this example, and the signature format defaults to DETACHED, the only supported value.

aws sesv2 update-configuration-set \
    --configuration-set-name my-config-set \
    --message-security-options '{"SigningScheme":{"Smime":{}}}'

No active certificate means rejected mail

AWS says that if signing is enabled on the configuration set and the sending identity has no ACTIVE certificate for the From address, SES rejects the message and returns an error. Track the certificate expiry date and renew early.

Fix 2: sign in your own code and send raw MIME

Use this when the certificate can't live in ACM, or you need control over exactly what is signed. The provider is then only the pipe, and it must deliver your bytes untouched. The flow:

  1. Build the inner MIME part: HTML and plain-text bodies with their Content-Type headers. Use base64 or quoted-printable transfer encoding, not 8bit, so no relay can alter it.
  2. Sign that part with your certificate, key and intermediates, producing a multipart/signed entity.
  3. Put the outer headers (From, To, Subject, Date, Message-ID) in front of the signed bytes.
  4. Send the result over SMTP, or through the raw-message call of your provider's API.
  5. Turn off open and click tracking for this traffic, and do not also enable SES-side signing on the same configuration set, or the message gets signed twice.

A Python sketch using the cryptography library. The S/MIME output already contains MIME-Version and Content-Type, so don't add those headers again:

import smtplib
from cryptography import x509
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.serialization import pkcs7

cert = x509.load_pem_x509_certificate(open("cert.pem", "rb").read())
key = serialization.load_pem_private_key(open("key.pem", "rb").read(), password=None)
chain = x509.load_pem_x509_certificate(open("intermediate.pem", "rb").read())

# inner.mime is the complete MIME part to sign, headers included
inner = open("inner.mime", "rb").read()

signed = (
    pkcs7.PKCS7SignatureBuilder()
    .set_data(inner)
    .add_signer(cert, key, hashes.SHA256())
    .add_certificate(chain)
    .sign(serialization.Encoding.SMIME, [pkcs7.PKCS7Options.DetachedSignature])
)

headers = (
    b"From: billing@example.com\r\n"
    b"To: client@example.net\r\n"
    b"Subject: Contract 4471\r\n"
    b"Date: Mon, 30 Nov 2026 10:00:00 +0000\r\n"
    b"Message-ID: <4471.001@example.com>\r\n"
)

with smtplib.SMTP("email-smtp.us-east-1.amazonaws.com", 587) as s:
    s.starttls()
    s.login("SES_SMTP_USERNAME", "SES_SMTP_PASSWORD")
    s.sendmail("billing@example.com", ["client@example.net"], headers + signed)

Treat this as a starting point and test it with your own certificate. Concatenate the bytes as shown. Don't parse the signed output into a message object and re-serialize it, because that can change line endings or boundaries and break the signature.

Two SES details trip people up. The SMTP username and password are dedicated SES SMTP credentials, not your normal AWS access keys. And the From address or domain must be a verified identity in the Region you send from.

For a one-off check without code, openssl cms -sign or openssl smime -sign produces the same kind of message.

Sign last, send untouched

Whatever sits between your signing step and the recipient must not edit the body. That includes tracking, footers, disclaimers added by a relay, and re-encoding.

Fix 3: use a signing gateway

If several applications send mail, signing in each one scatters copies of the private key. A gateway centralizes it: apps send plain SMTP to the gateway, which signs with the right certificate and relays to SES or another smarthost. CipherMail is one such S/MIME and PGP gateway, and it is the tool usually suggested for this problem. Commercial secure-mail gateways exist too; ask each vendor specifically about outbound signing with certificates you supply.

The trade-offs are plain. You get one place to manage keys and renewals. You also get another server to patch and monitor, a single point of failure for outbound mail, and configuration work to map each sender address to its certificate. I'd consider a gateway at three or more sending systems, or when a security team wants keys off application servers. For one app, Fix 1 or Fix 2 is less to maintain.

Which option fits

OptionWho holds the keyTrackingBest for
SES signs (Fix 1)You, in ACMCompatible, per AWS docsApps already on SES, least code
Sign in app, raw send (Fix 2)Your app serverMust be offCertificate can't go in ACM
Signing gateway (Fix 3)The gatewayDepends on the setupMany apps, central key control
Mandrill as-isNot supported as far as I can findNot applicableNot an option for S/MIME

Table reflects documentation as of November 2026; vendors change features, so confirm before committing.

Check that the signature survives

Send a test to a mailbox in Outlook, Apple Mail or Thunderbird and look for the signed-message indicator. Then open the raw source, or paste the headers into the email header analyzer. A signed message has a Content-Type: multipart/signed header with a protocol of application/pkcs7-signature and a micalg parameter naming the digest algorithm, such as sha-256. You should also see a smime.p7s part.

If the client reports an invalid signature, the usual causes are:

  • Body changed after signing. Tracking, footers, re-encoding or link rewriting in a manual setup. Turn them off for this stream.
  • Address mismatch. The certificate's email address differs from From.
  • Missing intermediates. Include the chain in the signature.
  • Expired or revoked certificate. Check the dates.
  • Valid but "untrusted". The recipient doesn't trust your CA. That is a certificate choice, not a sending bug.

Checklist before you go live

  • The certificate's email address matches the exact From address.
  • Signing happens once only (SES-side or in your code, not both).
  • A test message shows as signed in at least two clients.
  • A renewal reminder exists for the certificate expiry date.
  • SPF, DKIM and DMARC still pass.

If nothing works

Contact AWS Support for SES problems, the vendor of your gateway or certificate authority for those parts, and Mailchimp Transactional support to ask whether any signing or raw-message option exists on your Mandrill account. Include the exact error text, timestamp, SES message ID, Region, configuration set name, the certificate ARN and SAN, and the raw source of a failing test message.

Subject: S/MIME signing not applied or invalid on outbound mail

Hello,

We send mail from billing@example.com through Amazon SES in us-east-1.
S/MIME signing is enabled on configuration set "my-config-set" and the
certificate (ARN: {certificate-arn}) is associated with the verified identity.

Problem: test messages sent at {timestamp-utc} (SES message ID {message-id})
arrive {unsigned / with an invalid signature}. The raw source is attached.

Already checked: certificate SAN matches From, certificate is ACTIVE and
not expired, tracking settings reviewed.

Please confirm whether the message was signed at send time and what
could invalidate the signature.

If the contract only says "digitally signed email" and never names S/MIME, ask whether a signed PDF or an e-signature service satisfies it. That could remove the requirement entirely.

Common questions

Does Mandrill support S/MIME signing?

Not as far as I can find, and the original report said the same. Confirm with Mailchimp Transactional support, since vendors add features without much announcement.

Can I use DKIM instead of S/MIME?

Not if the contract names S/MIME. They prove different things, so run both.

Do I need the recipient's certificate?

Not for signing. Encrypting a message to a recipient needs their public certificate, which is a separate project.

Will click tracking break the signature on SES?

Not when SES does the signing, because AWS says it applies tracking before it signs. It will break a signature you computed yourself before sending, so turn tracking off in that setup. AWS also documents the behavior in its page on enabling S/MIME signing on a configuration set.

strategymandrill-mailchimp
Share this article
Sohail Hussain

Sohail Hussain

Founder & CEO at Mailneo

Building Mailneo — AI-powered email marketing for growing businesses.

Related Articles

Ready to supercharge your email marketing?

Start sending smarter emails with AI-powered campaigns. No credit card required.

Get Started Free