What is smime.p7s?
An email arrived with an attachment called smime.p7s that will not open. It is not a file somebody meant to send you. It is the email's signature.
smime.p7s is the digital signature on an email signed with S/MIME. It holds a fingerprint of the message, the sender's signature over that fingerprint, and the sender's certificate. There is nothing in it to read and it is safe to ignore; the email is complete without it. What it is for is checking that the message has not been changed since it was sent, and whose certificate signed it. SIGNET does that check in your browser tab.
Why it shows up as an attachment
A signed email is sent as two parts: the message, with its own attachments, and the signature. A mail program that understands S/MIME, such as Outlook, Apple Mail or Thunderbird, reads the signature, checks it, and shows a small rosette or tick instead. A mail program that does not, which includes many webmail services and some phone apps, shows the second part as what it looks like from the outside: an attachment with a strange name. Forwarding the email, or saving and re-sending it from a program that does not know S/MIME, often leaves the smime.p7s behind as a loose file.
What is inside it
| Part | What it is |
|---|---|
| A digest of the message | A SHA-256 hash, usually, of the signed part of the email: its text and every attachment, byte for byte |
| The signing time | When the sender's computer says it signed it. Its own clock, so a claim rather than proof |
| The signature | Made over the digest and the time with the sender's private key, which never leaves their computer |
| Certificates | The sender's certificate, which ties their public key to their email address, and usually the certificate authority's certificate that issued it |
The file format is CMS, from RFC 5652, which is the successor to PKCS #7, hence the .p7s: a PKCS #7 signature.
smime.p7s and smime.p7m
With a .p7s the signature travels beside the message, so the message can be read without it. A .p7m has the message wrapped inside it. An email that arrives as a single attachment called smime.p7m is either signed that way, in which case the message can be taken out of it, or encrypted, in which case only the recipient's mail program, holding their private key, can open it. A document signed as a file, like contract.pdf.p7m, is the same wrapping around a PDF, and is the usual way signed documents are sent in Italy.
What a valid signature proves, and what it does not
- It proves the signed part has not changed. Not a word of the text, and not a byte of any attachment inside it.
- It proves it was signed with the key in the certificate. Whoever holds that certificate's private key signed it.
- It does not cover the From line. The sender, recipients, subject and date are outside the signed part. Someone with a genuine certificate for one address can sign an email that says it is from another, so the address in the certificate has to be compared with the From line. Mail programs are meant to warn when they differ.
- It does not by itself mean the certificate is trustworthy. That depends on who issued it, and whether your computer trusts that authority. Anyone can make a certificate for any address; what makes one mean something is an authority you trust having checked it.
Why a mail program says the signature is invalid
- The message was changed after it was signed. Often innocently: a mailing list or a company mail server adds a footer inside the signed part, or re-encodes it.
- The certificate had expired, or was not valid yet, when the signature says it was made.
- It was signed with SHA-1. Thunderbird has shown SHA-1 signatures as invalid since version 115.
- The issuing authority is not trusted on your computer, which is usual for a company's own certificate authority seen from outside the company.
- The certificate is not for email, or not for the address the email is from.
Checking it with OpenSSL
Save the whole email as an .eml, which every mail program can do, rather than the smime.p7s on its own: the signature is over the message, so the message is needed to check it. Then:
openssl cms -verify -noverify -in message.eml -out message.txt
-noverify checks the signature and that nothing has changed, and leaves out whether the certificate authority is trusted. Without it OpenSSL also builds the chain to a root it trusts, and says unable to get local issuer certificate when it cannot, which is not the same thing as a bad signature. A changed message gives content verify error. To see whose certificates are inside:
openssl smime -pk7out -in message.eml | openssl pkcs7 -print_certs -noout
A signed file comes out of its .p7m the same way:
openssl cms -verify -noverify -binary -inform DER -in contract.pdf.p7m -out contract.pdf
None of this compares the certificate's address with the From line; that has to be done by eye.
Without a command line
Drop the .eml on SIGNET. It checks the signature and the content the way OpenSSL does, compares the certificate's address with the From line, follows the certificates up to the root and names it, lists what the signature covers, and says in words what is wrong when something is. A .p7m opens the same way and the file inside it can be saved on its own. Nothing is uploaded, and it never asks for a private key.
Questions people ask about What is smime.p7s?
What is the smime.p7s attachment?
It is the digital signature on an email signed with S/MIME, with the sender's certificate. It is not a document and there is nothing in it to read. It exists so the email can be checked for changes and tied to the sender's certificate.
Is smime.p7s safe to open?
It is not a program and cannot run anything; it holds a signature and certificates. Opening it on its own shows nothing useful. Checking it means checking the whole email, which SIGNET does in a browser tab.
Can I delete smime.p7s?
The email is complete without it: the text and the real attachments are in the other part. Deleting it only removes the means of checking that the email was not changed and who signed it.
What is the difference between smime.p7s and smime.p7m?
A .p7s is the signature sent beside the message. A .p7m has the message wrapped inside it, either signed, so it can be taken out, or encrypted, so only the recipient's private key opens it.
How do I verify an S/MIME signature without Outlook?
Save the email as an .eml and run openssl cms -verify -noverify -in message.eml -out message.txt, or drop the .eml on SIGNET, which also compares the certificate's address with the From line.
Why does it say the signature is invalid?
Usually because the message was changed after signing, often by a server adding a footer; the certificate had expired when it was used; it was signed with SHA-1; or the certificate authority is not one your computer trusts.