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.
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
| Type | Examples | Typical treatment |
|---|---|---|
| Executables and installers | .exe, .msi, .scr, .com, .bat, .cmd, .ps1, .jar | Blocked by nearly every gateway |
| Scripts and shortcuts | .js, .vbs, .wsf, .lnk, .hta | Blocked |
| Disk images and containers | .iso, .img, .dmg, .vhd | Blocked or quarantined |
| Macro-enabled Office files | .docm, .xlsm, .pptm, older .doc/.xls with macros | Often blocked or stripped |
| Archives | .zip, .rar, .7z, .gz | Scanned; password-protected archives often quarantined because they cannot be inspected |
| HTML and web files | .html, .htm, .svg | Frequently blocked because of phishing forms and scripts |
| Documents | .pdf, .docx, .xlsx, .pptx, .txt, .csv | Usually allowed; scanned; links inside are checked |
| Images | .jpg, .png, .gif | Usually allowed; large images in a short message look odd |
| Calendar and contacts | .ics, .vcf | Allowed, 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.
Attachment or link?
| Consideration | Attachment | Link to a file |
|---|---|---|
| Spam and security filtering | Scanned by every gateway; may be blocked | No file to block; the URL domain is checked |
| Message size | Increases size and bounce risk | Tiny message |
| Access control | Anyone who receives the message has the file | Can require sign-in, expire or be revoked |
| Updates | Old copy stays in the inbox | Always the latest version |
| Offline access | Available offline | Needs a connection, unless downloaded |
| Tracking | Not possible without tracking links | Download events can be recorded |
| Phishing perception | Familiar for invoices | Recipients 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
- 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.
- Keep it small: aim for under 5 MB per message when you can.
- 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.
- Write a real body: a message with a sentence of context and a signature looks more legitimate than a bare attachment.
- Send from an authenticated domain: SPF, DKIM and DMARC should pass. See authenticate your sending domain.
- Do not attach to bulk marketing unless necessary. Link to the file on your site instead; a campaign with attachments multiplies size and risk.
- Scan outgoing files for malware yourself; a message infected by your own systems damages your reputation.
- Tell recipients what to expect, for example by mentioning the file name and type in the body.
- 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.
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.