New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
DeliverabilityUpdated 26 Oct 2026

Email Attachments and Spam Filters: Which File Types Get Blocked and Safer Ways to Share Files

Which attachment types spam filters and gateways block or flag, how size, archives and macros matter, why links to cloud files are often safer, and practical rules for senders of invoices, reports and bulk mail.

HM
Written by Hannah Mitchell
Product Manager, Onboarding
Reviewed by Aarav Mehta
  • Published8 Dec 2025
  • Read time6 min
  • Length1,169 words
Share this guide

Attachments are the oldest way to deliver malware by email, and mail systems treat them accordingly. A message with the wrong kind of file may be rejected outright by the gateway, quarantined for review, stripped of the file or simply sent to spam. The rules differ from one organisation to the next, so a PDF invoice that reaches one customer may be held by the security gateway of another. This guide explains which kinds of attachment attract suspicion, how filters examine files, what factors of size and format matter, when a link to a file is a better choice than an attachment and how to set practical rules for the people and systems that send documents. It is aimed at businesses that send invoices, statements, contracts and reports, as well as marketers who consider adding a PDF to a campaign.

Blocked oftenExecutables, scripts, shortcuts, disk images, macro-enabled Office files, some archives
Treated with careZip and other archives, password-protected files, HTML files, large files
Usually acceptedPlain PDF, images, ordinary Office documents, small CSV and text files
AlternativeA link to a file on your own site or a reputable service, with access control

How attachments are checked

Receiving systems apply several layers. First comes the file type policy: many organisations block or quarantine certain extensions and MIME types regardless of content. Second is anti-virus scanning, which inspects the file and the archives inside it. Third is sandboxing, where the gateway opens the file in a controlled environment to see what it does. Fourth, content filters weigh the combination: a message with a short body, a generic subject and a zip file from an unknown sender looks like malware delivery. Lastly the reputation of the sender affects how much leniency a file receives. A trusted sender with a history of invoices is treated differently from a new domain with the same attachment. Compare how content filters judge a message.

File types and how they are treated

TypeExamplesTypical treatment
Executables and installers.exe, .msi, .scr, .com, .bat, .cmd, .ps1, .jarBlocked by nearly every gateway
Scripts and shortcuts.js, .vbs, .wsf, .lnk, .htaBlocked
Disk images and containers.iso, .img, .dmg, .vhdBlocked or quarantined
Macro-enabled Office files.docm, .xlsm, .pptm, older .doc/.xls with macrosOften blocked or stripped
Archives.zip, .rar, .7z, .gzScanned; password-protected archives often quarantined because they cannot be inspected
HTML and web files.html, .htm, .svgFrequently blocked because of phishing forms and scripts
Documents.pdf, .docx, .xlsx, .pptx, .txt, .csvUsually allowed; scanned; links inside are checked
Images.jpg, .png, .gifUsually allowed; large images in a short message look odd
Calendar and contacts.ics, .vcfAllowed, but check content from unknown senders

Changing the extension does not help. Gateways identify files by content and by the declared MIME type, and a mismatch between them is a flag. Attaching an executable renamed to ".txt" will usually make things worse. See MIME attachments and content types.

Why zip files and passwords cause trouble

Attackers wrap malware in archives and add a password, quoted in the message body, so that scanners cannot look inside. Defenders responded by treating password-protected archives as suspicious. A legitimate sender who protects a confidential report with a password therefore risks quarantine. If a document is sensitive, do not rely on a password-protected zip. Use a secure portal or an encrypted-mail feature, and send the recipient a notification with a link. See email encryption options.

Size matters

Large attachments increase the chance of trouble: many servers limit total message size to between 10 and 50 megabytes, base64 encoding adds about a third to the file size, and large files take longer to scan, which delays delivery. A message that exceeds the receiver's limit bounces, usually with a 552 error. Keep attachments small, compress images and avoid sending files that are only slightly under a known limit. See attachment size limits, MIME size limits and 552 errors.

ConsiderationAttachmentLink to a file
Spam and security filteringScanned by every gateway; may be blockedNo file to block; the URL domain is checked
Message sizeIncreases size and bounce riskTiny message
Access controlAnyone who receives the message has the fileCan require sign-in, expire or be revoked
UpdatesOld copy stays in the inboxAlways the latest version
Offline accessAvailable offlineNeeds a connection, unless downloaded
TrackingNot possible without tracking linksDownload events can be recorded
Phishing perceptionFamiliar for invoicesRecipients are warned against unexpected links

For transactional documents such as invoices and receipts, a small PDF attached to the message is expected and works well. For large reports, contracts or anything confidential, a link to a secure page is safer. If you use links, host them on your own domain or a reputable service, do not use public shorteners (see URL shorteners in email) and make the link text honest.

Rules for senders

  1. Use common formats: PDF for documents, CSV for data, PNG or JPEG for images. Avoid macro-enabled files and archives unless the recipient expects them.
  2. Keep it small: aim for under 5 MB per message when you can.
  3. Name files clearly: "Invoice-4821.pdf" is better than "document.pdf" or random characters. Avoid double extensions such as "invoice.pdf.exe" and spaces or special characters that break some systems.
  4. Write a real body: a message with a sentence of context and a signature looks more legitimate than a bare attachment.
  5. Send from an authenticated domain: SPF, DKIM and DMARC should pass. See authenticate your sending domain.
  6. Do not attach to bulk marketing unless necessary. Link to the file on your site instead; a campaign with attachments multiplies size and risk.
  7. Scan outgoing files for malware yourself; a message infected by your own systems damages your reputation.
  8. Tell recipients what to expect, for example by mentioning the file name and type in the body.
  9. Set the MIME type correctly, and let your mail library generate the headers.

For recipients and administrators

If your organisation blocks attachment types, publish the policy so that partners can adapt, and make quarantine reports available to users. Offer a way to request release of a file. Allow-list trusted partners selectively, not by whole domain if you can avoid it. Remember that blocking by extension alone is not enough: attackers adapt, so combine type policy with scanning and sandboxing. See phishing email: how to spot it for guidance to give users.

When an attachment does not arrive

  • Ask the recipient to check spam and quarantine folders and any security gateway report.
  • Send the same message without the attachment, with a link, to see whether the file is the cause.
  • Look at the bounce or delivery log for a code and text that mention policy, virus or size. See reading a bounce code.
  • Test your message with the spam checker.
  • Try a different format, for instance a PDF instead of a zip.

Attachments will remain a normal part of business email. The way to make them arrive is to behave like a trustworthy sender: use common formats, keep them small, authenticate your domain and prefer secure links for anything large or sensitive.

Send documents reliably Authenticated delivery with message logs to see what happened to every message.

See the email API

References and further reading

Frequently asked questions

Which attachment types are blocked most often?

Executables, scripts, shortcuts, disk images, macro-enabled Office files and often HTML files. Archives with passwords are frequently quarantined.

Is a PDF attachment safe for deliverability?

Usually yes. A small, plainly named PDF from an authenticated sender is accepted by most systems.

Should I send a password-protected zip?

Avoid it. Scanners cannot inspect it and many gateways quarantine it. Use a secure portal link instead.

When is a link better than an attachment?

For large, confidential or frequently updated files, and in bulk marketing mail.

Does renaming the extension help?

No. Gateways check file content and MIME type, and a mismatch makes the message look worse.

Topics#attachments#spam filters#file types#security#invoices
Was this guide helpful?Your answer helps us improve our documentation.

Start sending in minutes.

Create an account, add your domain and send your first email.

Get started Talk to sales