Skip to main content

    smime.p7s: Why Your Signed Email Arrives as an Attachment

    smime.p7s is the signature on an S/MIME email, not a document. What a real signing test shows, why some apps list it, and what a sender can change.

    MS
    My-SSL
    ·
    12 min read
    ·
    Published October 9, 2026
    ·
    Last updated October 9, 2026

    The short answer

    smime.p7s is the detached digital signature on an S/MIME-signed email: a small file holding the signature and the sender's certificates, not a document, not encrypted content and not a delivery error. Mail apps that process S/MIME read it and show a signature indicator, while apps that don't list it as an attachment, and the sender cannot choose which one a recipient gets. Switching to opaque signing (smime.p7m) to hide it makes things worse, because the message body and every real attachment then move inside the container too.

    The same S/MIME-signed message as displayed by a mail client that verifies signatures and by one that does notTwo panels, one above the other showing the same delivered message. The first panel, headed a client that verifies S/MIME, shows a signature indicator above a readable message body and no extra file, because the client reads the signature part and removes it from view. The second panel, headed a client that does not, shows the same readable message body with no signature indicator and, highlighted in gold, an attachment chip labelled smime.p7s, because the client shows the signature part as an ordinary attachment. A band across the bottom states that the message and the signature are identical in both cases and that what differs is the software reading it.One signed message, two inboxesA client that verifies S/MIMESigned — identity verifiedbody readable, no extra fileit reads the signature partand takes it out of viewA client that does notno signature indicatorsmime.p7sit shows the signature partas an ordinary attachmentSame message. Same signature.Nothing went wrong in transit.What differs is the softwaredoing the reading.
    The message arrives intact in both cases; only the reading software differs, so a smime.p7s complaint is rarely a delivery fault.

    What is the smime.p7s file?

    The smime.p7s file is the detached signature block from an S/MIME-signed message. It holds two things: the signature value computed over the message, and the sender's certificate, usually with the certificates that issued it. It does not hold the message, and nothing in it is encrypted. In our test below the file came to 2,970 bytes for a one-line email with a small PDF attached, and opening it in a text editor shows base64 rather than prose.

    The name is a convention rather than an accident. The S/MIME specification, RFC 8551, recommends file names for its parts so that receiving software and people can recognise them, which is how signed mail from every sender ends up carrying a part with the same name. The .p7s extension points at PKCS#7, the container format underneath, and the s marks it as a signature. Its sibling, .p7m, holds a whole message, and the difference between the two matters more than the names suggest.

    Because the file carries the sender's certificate, a client that processes it also learns how to encrypt mail back to that sender. That is why the usual advice for starting an encrypted exchange is to send each other a signed message first.

    What does a signed message actually contain? We tested it

    A clear-signed S/MIME message is a two-part MIME envelope: your message as it would have been sent unsigned, followed by a signature part that is labelled as an attachment named smime.p7s. We built one on October 9, 2026 with OpenSSL 3.0.13, signing a short email with a PDF attached, using a throwaway test certificate authority rather than a publicly trusted one, and kept the real output (sender and recipient addresses omitted, most of the base64 cut).

    $ openssl cms -sign -in withattach.txt -signer user.crt -inkey user.key \
        -certfile ca.crt ... -subject "Invoice" -out clear.eml
    
    MIME-Version: 1.0
    Content-Type: multipart/signed; protocol="application/pkcs7-signature";
      micalg="sha-256"; boundary="----0F0EA41D20F5F296BD1B1C7896BA67F3"
    
    This is an S/MIME signed message
    
    ------0F0EA41D20F5F296BD1B1C7896BA67F3
    Content-Type: multipart/mixed; boundary="b1"
      ... the text of the message, then invoice.pdf ...
    
    ------0F0EA41D20F5F296BD1B1C7896BA67F3
    Content-Type: application/pkcs7-signature; name="smime.p7s"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename="smime.p7s"
    
    MIILlgYJKoZIhvcNAQcCoIILhzCCC4MCAQExDTALBglghkgBZQMEAgEw...

    Four things in that output explain most smime.p7s questions:

    • The signature is marked as an attachment on purpose. Its header says Content-Disposition: attachment with the file name smime.p7s, so software that cannot verify it still has a harmless place to put it.
    • It is small. The decoded smime.p7s was 2,970 bytes with our test root certificate included and 1,903 bytes when we signed without it, using 3072-bit RSA keys. The size depends on the certificates inside it, not on the length of the email.
    • Your attachment is one level down. The PDF sits inside the first part, under multipart/mixed, not beside the signature.
    • The media type has an older spelling. OpenSSL's newer cms command wrote application/pkcs7-signature, the type RFC 8551 specifies, while its older smime command, run on the same input, wrote application/x-pkcs7-signature. You will see both in the wild; they label the same kind of part.

    Both messages verified with openssl cms -verify. Then we appended one line to the signed body, the kind of footer a mail gateway adds, and verification of the clear-signed copy failed. The same line appended to the opaque-signed copy left its verification intact. That difference is covered below.

    Why does it show up as an attachment?

    The smime.p7s file shows up as an attachment because the signature is a MIME part in its own right, labelled as an attachment, and a mail app that does not process S/MIME treats it like any other file: it lists it. The message was built correctly and arrived intact. What differs is whether the receiving software recognises the signature type as something to verify or something to offer for download.

    Support questions about this usually arrive framed as a delivery problem: the signature "broke", the certificate is "not working", the message "arrived wrong". None of that is happening. The same message opened in a client that verifies S/MIME shows a signature indicator and no extra file, which is usually the fastest way to settle the question. If the recipient is on Outlook and sees a warning rather than a badge, that is a different fault with its own cause, covered in why Outlook says your S/MIME certificate is not trusted.

    smime.p7s or smime.p7m: which are you sending?

    A smime.p7s file means the message was clear-signed: it travels as multipart/signed, with a readable body and a detached signature beside it. A smime.p7m file means it was opaque-signed: the body, the formatting and every attachment are sealed inside one PKCS#7 container sent as application/pkcs7-mime. RFC 8551 defines both, says the multipart/signed form is generally preferred for sending, and requires receiving agents to handle both.

    The message structure of a clear-signed email compared with an opaque-signed email, and what each one leaves readableTwo message structures, one above the other. The first structure, highlighted in gold and headed clear-signed, is a multipart slash signed container holding two parts: the message itself as text, and an application slash pkcs7-signature part delivered under the file name smime.p7s. Its consequence panel states that the body and attachments stay readable everywhere and only the signature may appear as a file. The second structure, headed opaque-signed, is a single application slash pkcs7-mime container delivered as smime.p7m, with the message, the attachments and the signature all sealed inside it. Its consequence panel states that a client which cannot unwrap the container shows nothing but the container itself. A band across the bottom states that RFC 8551 prefers multipart slash signed for sending and that receiving software has to understand both.The signature travels in one of two shapesClear-signed — multipart/signedmultipart/signedyour message, as textpkcs7-signaturearrives named smime.p7sBody and attachments stayreadable everywhere.Only the signature mayshow up as a file.Opaque-signed — pkcs7-mimeapplication/pkcs7-mimeyour messageyour attachmentsthe signaturearrives named smime.p7mA client that cannot unwrapit shows nothing else.The body and the files aresealed inside the container.RFC 8551 prefers multipart/signedfor sending.Receiving software has tounderstand both.
    The choice looks like a preference setting. It decides whether a recipient with the wrong mail client sees your message or sees a sealed box.

    Our test shows the difference plainly. The opaque-signed copy of the same email had exactly one MIME part, named smime.p7m, and the name invoice.pdf did not appear anywhere in the raw message. The PDF only reappeared after openssl cms -verify unwrapped the container. A mail app that cannot unwrap it would typically show an empty message with one file attached.

    Opaque signing does have a real argument behind it. Because the content is encoded inside the signed container, systems that append disclaimers or rewrite line endings on the way through are far less likely to alter what was signed: in our test, the appended footer broke the clear-signed copy and not the opaque one. If your mail crosses gateways like that, opaque signing is how the signature survives the trip.

    So the sensible order is: clear signing by default, opaque signing only when you know your recipients can handle it and you have a specific gateway problem to solve. Choosing opaque signing to make smime.p7s go away turns a cosmetic complaint into a real one.

    Which clients verify, and which just attach

    Whether a recipient sees a signature indicator or a smime.p7s file depends on whether their mail app processes S/MIME, and for webmail, on whether an administrator has set it up. As of October 2026, the vendors' own documentation describes the main clients like this.

    ClientVerifies S/MIME?What the vendor documents
    Classic Outlook for WindowsYesClear-text signing is selected by default.
    New Outlook for WindowsYesStoring correspondents' S/MIME certificates in Contacts rolled out from late May to mid-June 2026.
    Outlook on the web (Microsoft 365)Once an admin sets it upValidates against a virtual certificate collection the administrator uploads; Edge and Chrome also need an admin-deployed S/MIME extension.
    Apple Mail (macOS, iOS, iPadOS)YesPer-message S/MIME is built in; you need a certificate for each address you sign from.
    Gmail on web, Android and iOSOnly with hosted S/MIMEGoogle says these apps won't show S/MIME attachments.
    Google Workspace with hosted S/MIMEYesFrontline Plus, Enterprise Plus and Education Fundamentals, Standard and Plus; an administrator turns it on.

    Gmail deserves a caveat rather than a flat answer. Google's FAQ says both that a recipient whose client doesn't support S/MIME receives the certificate as a smime.p7s attachment, and that Gmail on web, Android and iOS won't show S/MIME attachments. Which of those a particular person sees depends on their app and account. Either way, unless the organisation has hosted S/MIME turned on, don't read the absence of a warning as a verified signature.

    That point is easy to skate past. An unverified signature part proves nothing. Anybody can attach a file called smime.p7s to a message, and in a client that is not checking it, it looks exactly like a real one.

    Why do mail robots lose the real attachments?

    Scripts and automation tools that pull attachments out of a mailbox often report that the attachments of signed mail were "replaced by smime.p7s". They were not replaced. Signing wraps the original message one level deeper, and a program that reads only the top-level parts of the message finds exactly two: an unnamed multipart/mixed part and the signature.

    The part tree of a clear-signed email with an attachment, compared with what a program sees if it reads only the top levelFirst panel, headed reading only the top level: two boxes, one for a multipart/mixed part with no file name and one for a part named smime.p7s, so the only named file the program finds is the signature. Second panel, headed reading the whole tree: multipart/signed at the top, branching into multipart/mixed and smime.p7s; multipart/mixed branches again into the text of the message and, highlighted in gold, invoice.pdf. A band across the bottom states that the invoice is one level down, not missing.Same message, two ways of reading itReading only the top levelmultipart/mixed (no name)smime.p7sthe only named file foundis the signatureReading the whole treemultipart/signedmultipart/mixedsmime.p7stextinvoice.pdfthe attachment is still there,one level downSigning wraps your messageone level deeper.Parsers that stop at the top levelonly find the signature.
    Drawn from the test message below: a script that walked only the top level found smime.p7s and nothing else, while a full walk found the PDF.

    We checked this against the test message with Python 3.11's standard email module. Listing only the top-level parts returned the unnamed container and smime.p7s; walking the whole tree returned invoice.pdf and smime.p7s. The fix in any tool is the same: walk the MIME tree recursively, and skip parts of type application/pkcs7-signature or application/x-pkcs7-signature unless you mean to verify them. An opaque-signed message (smime.p7m) is a different case: the files are inside the container and have to be unwrapped first.

    What can you change as the sender?

    As the sender, you cannot make smime.p7s disappear for a recipient whose mail app does not verify S/MIME, and no certificate or setting changes that. What you can do is keep the fallback harmless and avoid generating the complaint where the signature adds nothing. Four decisions carry most of the practical weight, and all of them are made before the message leaves.

    Which parts of the smime.p7s outcome a sender controls and which parts the recipient's mail client decidesTwo panels, one above the other. The first panel, highlighted in gold and headed you control, lists four things a sender can change: clear signing rather than opaque signing, whether machine-generated bulk mail is signed at all, the address written on the certificate, and including the issuing certificates inside the signature. The second panel, headed the recipient decides, lists four things outside the sender's reach: whether their client verifies S/MIME at all, whether it hides or displays the signature part, whether it trusts the issuing authority, and what their mail gateway rewrites on the way in. A band across the bottom states that every change which actually helps sits in the first panel.Where the fix livesYou controlclear signing, not opaquewhether you sign bulk mailthe address on the certificatesending your issuing chainall set before the message leavesThe recipient decideswhether their client verifieswhether it shows the p7swhether it trusts your issuerwhat their gateway rewritesnone of it visible from your outboxEvery change that actually helpssits in the first panel.The second is set by softwareyou will never see.
    Worth drawing before you promise a colleague you can make the attachment go away: that part is decided by the recipient's software.

    Keep clear signing on. In classic Outlook, Microsoft says the option "Send clear text signed message when sending signed messages" is selected by default. Administrators can pin it with the Office policy "Send all signed messages as clear signed messages", which sets a ClearSign value under HKCU\Software\Policies\Microsoft\Office\16.0\outlook\security. If someone switched clear signing off to tidy up the attachment, that change is a likely cause of reports of empty messages carrying a single smime.p7m file.

    Don't sign machine-generated bulk mail. Invoices, notifications and newsletters gain little from a signature that most of their recipients are not equipped to check, and every recipient on a client without S/MIME support gets an unexplained file. Sign correspondence between people, where the identity claim means something.

    Sign from the address on the certificate. RFC 8550 says sending agents should make the From or Sender address match an email address in the signer's certificate, and that receiving agents must check that match when the certificate contains addresses. Signing from an alias that is not on the certificate invites a mismatch warning at the far end.

    Include your issuing certificates. The signature can carry the certificates between yours and the root, which the recipient's software uses to check the chain. In our test, adding our test CA certificate grew smime.p7s from 1,903 to 2,970 bytes, so that one certificate added about a kilobyte. If you are choosing a certificate for a team rather than fixing one you already have, the validation type and which addresses it covers matter more than the brand; our S/MIME certificates for business email page sets out which validation type covers an individual mailbox and which adds the organisation's name.

    You received a smime.p7s file: what should you do?

    In most cases, nothing. A clear-signed message is fully readable without a certificate of your own, without extra software, and without opening the attachment. You need a certificate only to sign your own mail or to send encrypted replies. The file is there because your mail app did not process it, and ignoring it costs you only the verification you were not getting anyway.

    If the verification matters, use a client that does it. Open the same mailbox in a desktop client with S/MIME support and the signature indicator appears, because the message always contained everything needed to check it. For a Google Workspace domain where this comes up often, hosted S/MIME moves verification to Google's side; it is limited to Frontline Plus, Enterprise Plus and the Education Fundamentals, Standard and Plus editions, and an administrator has to turn it on.

    Two things not to do. Don't treat the attachment as proof of anything: in a client that is not verifying, it can be attached by anyone, so a message that looks signed deserves the same scepticism as any other. And don't ask the sender to switch to opaque signing so their mail looks "properly signed". That trades a harmless extra file for an empty message with the real attachments locked inside it. For what the signature would have proved had anything checked it, see what a digital signature actually proves.

    Frequently Asked Questions

    Answers to common questions about certificates and our services.

    What is the smime.p7s attachment in an email?

    It is the detached digital signature on an S/MIME-signed message, not a document the sender meant to attach. The file holds the signature value and the sender's certificates; in our test it was 2,970 bytes. Mail apps that process S/MIME read it and show a signature indicator instead, while apps that don't list it with the other attachments.

    Is smime.p7s safe to open, or is it a virus?

    The part holds a signature and certificates in PKCS#7 format, not a program, and nothing in it is encrypted. It is also not proof of anything on its own: if your mail app is not verifying S/MIME, nobody checked it, and anyone can attach a file with that name. Treat a signed-looking message from an unexpected sender with the same caution as any other.

    Why does Gmail show smime.p7s instead of a verified signature?

    Gmail verifies S/MIME through hosted S/MIME, which Google offers on Frontline Plus, Enterprise Plus and the Education Fundamentals, Standard and Plus editions, and which an administrator has to turn on. Google's FAQ says that when a recipient's client doesn't support S/MIME, the message includes the certificate as a smime.p7s attachment, and that Gmail on web, Android and iOS won't show S/MIME attachments.

    How do I stop sending smime.p7s attachments?

    You can't while you are signing mail: the signature has to travel with the message, and the recipient's software decides whether to show it as a badge or a file. What you control is keeping clear signing on so the body stays readable, and not signing bulk or automated mail where the signature adds nothing.

    What is the difference between smime.p7s and smime.p7m?

    smime.p7s is a detached signature beside a readable message, sent as multipart/signed. smime.p7m is a PKCS#7 container holding the whole message, sent as application/pkcs7-mime. RFC 8551 says the multipart/signed form is generally preferred for sending and that receiving agents must handle both. A client without S/MIME support still shows a clear-signed message normally, but shows an opaque-signed one as a single file.

    Why did the attachments disappear from a signed email I received?

    Usually because the message was opaque-signed. With application/pkcs7-mime, the body and every attachment sit inside the smime.p7m container, and your mail app has to unwrap it before they exist. In our test the attachment's name did not appear anywhere in the raw message until the container was unwrapped. Ask the sender to switch to clear signing.

    Still Have Questions?

    Contact our support team with questions about certificates, installation, or technical issues.

    Signing mail your recipients can check

    The attachment is a rendering quirk. Whether the identity behind the signature stands up depends on what the certificate authority verified before issuing the certificate. Compare the S/MIME validation types we offer and what each one confirms about the sender.