Open and save attachments

Mbox Viewer lists the attachments of a message in the reading pane, between the header and the body. Each file has an Open button and a Save… button. Opening writes a temporary copy and hands it to the default application of your system, while saving writes the file where you choose. The .mbox file is never modified in either case.

Where are the attachments of a message?

In the message list, a paperclip icon marks every message with at least one attachment. Hover over it to read the number of attachments.

In the reading pane, the attachment list sits under the header fields with a title such as "2 attachments". Each line shows an icon for an image or another file, the file name and its size. A file without a name appears as "Attachment 1", "Attachment 2" and so on.

An image that the HTML body displays through a cid: reference is shown in place in the body and left out of the list. Every other part stays in the list so that nothing is hidden. That includes a PDF that Apple Mail marked as inline.

How do I open an attachment?

Click the Open button (the arrow icon) next to the file. Mbox Viewer then works through these steps:

  1. It decodes the file from the mbox and writes a copy to the temporary folder.
  2. It marks the copy as downloaded from the Internet, like a mail client does. macOS gets the quarantine attribute and Windows gets the Mark-of-the-Web.
  3. It opens the copy with the default application for that file type.

If you open the same attachment again, Mbox Viewer reuses the copy it already wrote.

System Temporary folder
macOS mbox-viewer-attachments in the system temporary folder
Windows %TEMP%\mbox-viewer-attachments\
Linux $XDG_RUNTIME_DIR/com.mboxviewer.viewer/attachments/, a folder that only your account can read

Mbox Viewer deletes this folder each time it starts, so do not keep files there. Use Save… for a file you want to keep.

Which attachments does Mbox Viewer refuse to open?

Mbox Viewer checks the final extension of each file before it opens the file.

Risk Examples of extensions What happens on Open
Blocked exe, msi, bat, cmd, ps1, vbs, js, jar, lnk, scr, sh, command, app, pkg, dmg, iso, py The app refuses with the message "For security reasons, … cannot be opened directly: save it first."
Confirm zip, 7z, rar, cab, docm, xlsm, pptm, html, htm, svg, mht, cer, crt, one A dialog titled "Open attachment?" warns that the file may contain macros, scripts or executable files. Click Open or Cancel.
Safe Every other extension (pdf, jpg, png, docx, xlsx, txt and so on) The file opens at once.

The blocked list holds 118 extensions. It covers executables, scripts, shortcuts, installers, Office add-ins and mountable disk images. Disk images are blocked because they are a classic way to bypass the quarantine. The full lists are in src-tauri/src/state.rs in the source code.

How do I save an attachment?

  1. Click Save… (the download icon) next to the file.
  2. The "Save attachment" dialog opens in your Downloads folder with the file name filled in.
  3. Pick a folder and click Save. A notification shows the name of the saved file.

Saving works for every file type. The types that Open refuses can be saved too. The saved file is also marked as downloaded. Mbox Viewer cleans the proposed name so that an email cannot steer the dialog:

  • path parts such as ../ are removed;
  • the characters < > : " / \ | ? * and control characters are replaced with _;
  • the name is limited to 200 bytes and keeps its extension;
  • Windows reserved names such as CON or COM1 get a _ prefix;
  • a part without a name gets a name like attachment-1.pdf, and the extension matches its type.

How do I find messages with attachments?

The search language has two operators for attachments.

Query What it finds
has:attachment Every message with at least one attachment
filename:pdf Messages with an attachment whose extension or name includes the word pdf
filename:invoice Messages with an attachment whose name contains the word invoice
has:attachment larger:5M Messages that have an attachment and weigh more than 5 MiB in total (headers, body and encoded attachments)

In the advanced search form, opened with the chevron of the search bar, the Has attachment checkbox adds has:attachment for you. Plain search words also match attachment names. Mbox Viewer does not index the content of the files, so a word that appears only inside a PDF will not match.

What about very large messages?

Mbox Viewer parses the first 64 MiB of a message to show it. Attachments are listed over the whole message when it is 256 MiB or smaller, and from its first 64 MiB when it is larger. For a message over 64 MiB, the reading pane shows a banner that warns that the body may be incomplete.

Can an AI agent read or save attachments?

An agent connected through the MCP server sees the list of attachments of a message with their names and sizes. It never receives their content in an answer. The save_attachment tool can write one attachment into the Export directory for attachments that you choose in Settings. The tool answers export_dir_not_set when no directory is set. See Set up Claude Desktop to connect an agent.

Frequently asked questions

How do I save an attachment from an mbox file?

Open the message and click Save… next to the file in the attachment list. A save dialog opens in your Downloads folder with the file name already filled in. Mbox Viewer confirms with a notification such as "invoice.pdf saved".

How do I find every message that has an attachment?

Search for has:attachment. You can combine it with other operators, for example has:attachment from:sophie, or tick Has attachment in the advanced search form.

How do I find a PDF or a file with a given name?

Use the filename: operator. filename:pdf finds the extension and filename:invoice finds a word in the name. Plain search words also match attachment names.

Does Mbox Viewer search inside the attachments?

No. Mbox Viewer indexes the names of the attachments and leaves their content out. A word that appears only inside a PDF or a spreadsheet will not match.

Why does Mbox Viewer refuse to open an attachment?

Mbox Viewer refuses to open executable files, scripts, installers and disk images directly, because opening them could run code. Click Save… to write the file to disk, then decide what to do with it.

Why does Mbox Viewer ask before opening a zip file?

Archives, Office documents with macros and HTML files can contain active content, so Mbox Viewer asks for confirmation first. The dialog "Open attachment?" lets you click Open or Cancel.

Where does Mbox Viewer put the attachments I open?

Mbox Viewer writes them to a mbox-viewer-attachments folder in the system temporary folder. On Windows that is %TEMP%\mbox-viewer-attachments\. On Linux the app uses $XDG_RUNTIME_DIR/com.mboxviewer.viewer/attachments/, which only your account can read. The app deletes this folder the next time it starts.

Why is an image in the body missing from the attachment list?

An image that the HTML body displays through a cid: reference is shown in the body and left out of the list. Any other part stays in the list. A PDF that the sender marked as inline is listed too.

Can an AI agent save attachments through the MCP server?

Yes, if you allow it. The save_attachment tool writes into the Export directory for attachments that you choose in Settings, and only there. Without that directory, the tool answers export_dir_not_set.