The Security Risk
Apple’s native Mail app on macOS is designed for seamless usability. If you receive an email containing a known file type (like a standard PDF document or a JPEG image), the Mail app will often attempt to render and display that attachment directly inline within the body of the email. While this allows you to read a newsletter quickly, it poses a significant security and privacy risk. Automatically rendering attachments means your computer is processing code sent by an unknown sender before you have explicitly chosen to open the file. Furthermore, if you receive a highly confidential financial document, you might not want it plastered across your screen the moment you click the email subject line.
Enforcing Icon View
To enhance your security and privacy and stop the macOS Mail app from automatically opening and displaying email attachments inline, you must force the application to treat all attachments as standard, clickable icons.
Unfortunately, Apple has removed the simple, global preference toggle to disable inline attachments in modern versions of macOS. You must change the behavior on a per-attachment basis. When you receive an email with an inline image or PDF, right-click (or Control-click) directly on the displayed attachment. From the context menu, select View as Icon. The attachment will immediately shrink down to a standard file icon. Alternatively, open the Terminal app and type the following command to enforce this behavior globally (though it may reset after OS updates): defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes followed by pressing Enter. Restart the Mail app for the changes to take effect.