If you work with Italian clients or suppliers, sooner or later an email arrives with an attachment called something like IT01234567890_00001.xml.p7m. Double-clicking it on a Mac usually does nothing useful, and on an iPhone the Mail app just shows a grey icon. This is normal: a .p7m file is not a broken PDF, it is a signed envelope. Here is what is inside it and how to read it on Apple devices without installing desktop signing software.

What a .p7m file actually is

P7M is the file extension used for CAdES digital signatures (the PKCS#7 / CMS format). The original document, which can be a PDF, a Word file or, very often, a FatturaPA XML e-invoice, is wrapped together with the signer's certificate and the signature itself. Italy made this format part of everyday business: electronic invoices exchanged through the SdI (Sistema di Interscambio) and documents sent by PEC (certified email) are commonly signed this way.

Because the content is wrapped, renaming the file from .p7m to .pdf or .xml rarely works. The reader has to open the envelope, check the signature and then show the document that was signed.

Option 1: open it in the browser (Mac, iPhone, iPad)

The quickest route on Apple devices is a browser-based viewer, because it works the same in Safari and Chrome and needs no installation. On a Mac:

  1. Save the attachment to your Downloads folder from Mail, Outlook or your webmail.
  2. Open a P7M viewer in Safari and drop the file onto the page.
  3. Check who signed it and whether the certificate is valid, then read the document or download the original PDF.

On an iPhone or iPad, press and hold the attachment in Mail and choose Save to Files. Then open the viewer in Safari, tap Choose files and pick the document from the Files app. If the file came through WhatsApp, open it in the chat, tap Share and save it to Files the same way.

Full disclosure: I work on Apri File P7M, a free browser viewer that does exactly this. Reading happens in the browser, there is no account, and opening a file, checking signatures and reading the e-invoice with its lines and VAT summary costs nothing. There is a step-by-step version of this guide for Mac users at open a P7M file on a Mac.

Option 2: signing software from a certification authority

Italian trust service providers distribute free desktop tools (DikeGoSign, ArubaSign and similar) that verify and extract signed files. They are reliable and worth having if you also need to sign documents with a smart card or a remote signature. The downside is that they are desktop installs, they are built around the Italian signing workflow, and they are not available on an iPhone.

Option 3: the command line

If you are comfortable with Terminal, OpenSSL can unwrap the envelope:

openssl smime -verify -noverify -in invoice.xml.p7m -inform DER -out invoice.xml

This gives you the raw XML. It is useful for automation, but a FatturaPA XML file is not pleasant to read by eye: you still need a >

Reading an Italian e-invoice once it is open

A FatturaPA invoice has a predictable structure, which helps when you check it:

  • CedentePrestatore: the supplier, with VAT number (Partita IVA) and address.
  • CessionarioCommittente: the customer, which should be you.
  • DettaglioLinee: the individual lines, quantities and unit prices.
  • DatiRiepilogo: the VAT summary per rate, which is what your accountant cares about.
  • DatiPagamento: payment terms and the IBAN to pay.

Before paying, compare the IBAN with one you already trust. Signed invoices prove who signed the file, not that the bank details are the ones you expected.

Common problems

Mail shows an .eml file instead of a .p7m. This happens with PEC messages: the whole message is wrapped. Download the message from your provider's webmail, where the .p7m attachment is available as it is.

The file is called .p7m.p7m. It was signed twice, for example by the issuer and then by an intermediary. A good viewer unwraps both layers.

"Certificate expired" warning. The signature can still be valid if it was applied while the certificate was valid. What matters is the signing time.

Summary

A .p7m file is a signed container, not a damaged document. On a Mac or an iPhone the simplest route is a browser viewer; signing software from an Italian CA is the right choice if you also sign documents; and OpenSSL is there if you want to script it. Whatever you use, check the signer and the payment details before you act on the invoice.