The Content-Disposition email header

Says whether a part should be shown inline or offered as an attachment, and gives its filename.

Format headerUpdated November 12, 2026
Quick answerSays whether a part should be shown inline or offered as an attachment, and gives its filename. Set by the sender; the filename can be misleading.
CategoryFormat
Set byThe sender's mail app
Trust levelInformational

Example

Content-Disposition: attachment; filename="invoice.pdf"

How to read it

  • Check the real file extension: invoice.pdf.exe is an executable, not a PDF.

Can you trust it?

Set by the sender; the filename can be misleading. To check an email you are unsure about, paste its full headers into the email header analyzer, or receive it in a temporary inbox where the Email X-ray checks it for you.

How to view email headers

  • Gmail: open the message, click the three dots, then Show original.
  • Outlook: open the message, then File, Properties, Internet headers (desktop), or the three dots, View, View message details (web).
  • Apple Mail: View, Message, All Headers.
  • Yahoo Mail: the three dots, then View raw message.

Where Content-Disposition sits in a real message

Every email has a header block at the top, then a blank line, then the body. Your mail app hides most of the header block and shows only a few fields. Here is a short, realistic header block with the Content-Disposition line highlighted:

Return-Path: <bounce@mail.example.com>
Received: from mail.example.com (mail.example.com [192.0.2.10]) by mx.yourprovider.com
Authentication-Results: mx.yourprovider.com; spf=pass; dkim=pass; dmarc=pass
From: "Example Store" <news@example.com>
Content-Disposition: attachment; filename="invoice.pdf"
Subject: Your order has shipped
Date: Thu, 12 Nov 2026 09:14:03 -0500

Servers add their lines at the top as the message travels, so the newest information is first and the sender's original fields are lower down. When you read a header block, start at the top with the lines your own provider added, then work down.

About format headers

Format headers describe how the body is built: plain text, HTML, attachments and the character set. They matter most when a message looks broken, and they can reveal hidden parts such as an attachment disguised with a misleading name.

Checking Content-Disposition on a suspicious email

  1. Treat it as a helpful hint, not as proof. It is usually set by software along the way and is rarely checked.
  2. Use it together with Received and Authentication-Results to build a picture of where the message came from.
  3. Values that do not fit the claimed sender, such as a cheap bulk-mail tool on a message from a large bank, are worth a closer look.

Notes for developers

  • Header names are case-insensitive, so Content-Disposition, content-disposition and CONTENT-DISPOSITION are the same field.
  • Long values can be folded across several lines. A line that starts with a space or tab continues the previous header (RFC 5322 section 2.2.3).
  • Non-ASCII text in header values is sent as encoded words such as =?UTF-8?B?...?= (RFC 2047). Decode them before you display or compare values.
  • Some fields may appear more than once. Received, for example, appears once per hop. Decide whether your code needs the first, the last or all of them.
  • Never use this header to make a security decision unless your own server added or verified it.

Other format headers

HeaderWhat it does
MIME-VersionDeclares that the message uses MIME formatting, which allows attachments, HTML and non-English text.
Content-TypeSays what kind of content the message or part contains, such as text/plain, text/html or multipart/mixed, plus the character set.
Content-Transfer-EncodingSays how a part was encoded for safe transport: 7bit, 8bit, quoted-printable or base64.

A scenario: the attachment that is not what it says

A message shows an attachment called "invoice.pdf", but the Content-Type for that part is application/x-msdownload and the full filename is "invoice.pdf.exe". Format headers reveal what a part really is, which is why mail filters and the Email X-ray look at them instead of trusting the visible name.

Quick checklist

  • Check Content-Type for each attachment.
  • Be wary of double extensions such as .pdf.exe.
  • Confirm charset when text looks garbled.

Content-Disposition in raw, parsed and displayed form

ViewWhat you see
Raw sourceContent-Disposition: attachment; filename="invoice.pdf"
Parsed by a mail libraryA field named content-disposition with its decoded value
Shown by most mail appsHidden unless you open the full source

Related guides

Related headers

  • Content-Type: Says what kind of content the message or part contains, such as text/plain, text/html or multipart/mixed, plus the character set.

FAQ

What is the Content-Disposition header?

Says whether a part should be shown inline or offered as an attachment, and gives its filename.

Who sets the Content-Disposition header?

The sender's mail app.

Can the Content-Disposition header be faked?

Set by the sender; the filename can be misleading.

Is the Content-Disposition header required?

No. Content-Disposition is optional. Many messages do not include it, and its absence is not a problem on its own.

Why is Content-Disposition missing from my email?

Mail apps hide most headers. Open the full source (Show original in Gmail, View message details in Outlook) to see every header. If Content-Disposition is still not there, the sending software simply did not add it.

What is a multipart message?

A message with several parts, such as plain text, HTML and attachments, separated by boundaries.

Why does an email show as plain text only?

The HTML part is missing or your app is set to prefer plain text.

Install TempMailify

Add TempMailify to your device for one-tap access, like a regular app.