Email attachment
View on WikipediaAn email attachment is a computer file sent along with an email message. One or more files can be attached to any email message, and be sent along with it to the recipient. This is typically used as a simple method to share documents and images.
History, and technical detail
[edit]Originally, ARPANET, UUCP, and Internet SMTP email allowed 7-bit ASCII text only. Text files were emailed by including them in the message body. In the mid 1980s text files could be grouped with UNIX tools such as bundle[1][2] and shar (shell archive)[3] and included in email message bodies, allowing them to be unpacked on remote UNIX systems with a single shell command.
The COMSYS/MSGDMS system at MIT offered "Enclosures" beginning by 1976.[4][5] Users inside COMSYS could receive the enclosure file directly. Messages sent to users out of the COMSYS world sent the enclosure as part of the message body, which was useful only for text files.
Attaching non-text files was first accomplished in 1980 by manually encoding 8-bit files using Mary Ann Horton's uuencode, and later using BinHex or xxencode[6] and pasting the resulting text into the body of the message. When the "Attachment" user interface first appeared on PCs in cc:Mail around 1985,[7] it used the uuencode format for SMTP transmission, as did Microsoft Mail later.
Modern email systems use the MIME standard, making email attachments more utilitarian and seamless. This was developed by Nathaniel Borenstein and collaborator Ned Freed,[8][9] with the standard being officially released as RFC2045 in 1996.
With MIME, a message and all its attachments are encapsulated in a single multipart message, with base64 encoding used to convert binary into 7-bit ASCII text; or, on some modern mail servers, optionally full 8-bit support via the 8BITMIME extension.
Size limits
[edit]Email standards such as MIME do not specify any file size limits, but in practice, email users will find that they cannot successfully send very large files across the Internet.
This is because of a number of potential limits:
- Mail systems often arbitrarily limit the size their users are allowed to submit.[10]
- A message will often pass through several mail transfer agents to reach the recipient. Each of these has to store the message before forwarding it on, and may therefore also impose size limits.
- The recipient mail system may reject incoming emails with attachments over a certain size.
The result is that while large attachments may succeed internally within a company or organization, they may not when sending across the Internet.
As an example, when Google's Gmail service increased its arbitrary limit to 25MB it warned that: "you may not be able to send larger attachments to contacts who use other email services with smaller attachment limits".[11][12]
Also note that all these size limits are based, not on the original file size, but the MIME-encoded copy. The common Base64 encoding adds about 37% to the original file size, meaning that an original 20MB file could exceed a 25MB file attachment limit.[13] A 10MB email size limit would require that the size of the attachment files is actually limited to about 7MB.
Users should be cautious with certain file formats when received as email attachments, such as .zip and .tgz files, because they can contain harmful viruses and potential software. .iso files can also be used to spread malware and .exe is an executable file that can become active on a computer as soon as it is opened.
Malware
[edit]A lot of malware is distributed via email attachments with some even considering such to be the main vector for cyberattacks on businesses.[14][15][16] Users are advised to be extremely cautious with attachments and to not open any attachments that are not from a trusted source and expected − even if the sender is in their address book as their account might have been taken over or misused.[14][17][18] While many email servers scan attachments for malware and block dangerous filetypes, this should not be relied upon − especially as such cannot detect zero-day exploits.[19]
Dangerous file types
[edit]Email users are typically warned that unexpected email with attachments should always be considered suspicious and dangerous, particularly if not known to be sent by a trusted source. However, in practice this advice is not enough – "known trusted sources" were the senders of executable programs creating mischief and mayhem as early as 1987 with the mainframe-based Christmas Tree EXEC.
Since the ILOVEYOU and Anna Kournikova worms of 2000 and 2001, email systems have increasingly added layers of protection to prevent potential malware. Now, many block certain types of attachments.[20][21]
References
[edit]- ^ The UNIX Programming Environment, Kernighan and Pike, 1984, p.97
- ^ "Unix tricks and traps". AUUGN. 15 (4): 87. August 1994.
- ^ Modern versions of shar can deal with binaries, via uuencoding them, but this was not initially the case.
- ^ "Jack Haverty, email to Header-People, 8 November 1976"
- ^ "Feinler, Vittal: Email Innovation Timeline, 1 July 2022"
- ^ "How do I use UUencode/BinHex/MIME support?", winzip.com.
- ^ InfoWorld Media Group, Inc. (June 3, 1985). InfoWorld. InfoWorld Media Group, Inc. p. 41.
- ^ Father of the email attachment, Patrick Kingsley, The Guardian, 26 March 2012
- ^ "The MIME guys: How two Internet gurus changed e-mail forever " Archived 2012-01-25 at the Wayback Machine, February 01, 2011, Jon Brodkin, Network World
- ^ "Setting Message Size Limits in Exchange 2010 and Exchange 2007";
- ^ "Google updates file size limits for Gmail and YouTube", geek.com Archived 2011-12-19 at the Wayback Machine.
- ^ "Maximum attachment size", mail.google,com.
- ^ "Raw vs. Encoded Email Message Size — What's the Difference?".
- ^ a b Martin, Jim. "Here's what you need to do to protect your PC from ransomware and NotPetya". Tech Advisor. Retrieved 29 June 2017.
- ^ "Truth on zero-day attacks". PCR. Retrieved 29 June 2017.
- ^ Aycock, John (2006). Computer Viruses and Malware. Springer. ISBN 9780387341880. Retrieved 29 June 2017.
- ^ Miller, Michael R. (2009). Microsoft Security Essentials User Manual (Digital Short Cut). Pearson Education. ISBN 9780768695298. Retrieved 29 June 2017.
- ^ Vermaat, Misty E. (2014). Enhanced Discovering Computers, Essentials. Cengage Learning. ISBN 9781285845531. Retrieved 29 June 2017.
- ^ "How To Spot A Dangerous Email Attachment". MakeUseOf. Retrieved 29 June 2017.
- ^ "Some file types are blocked", mail.google.com.
- ^ "You may receive an "Outlook blocked access to the following potentially unsafe attachments" message in Outlook", microsoft.com.
Email attachment
View on GrokipediaFundamentals
Definition and Purpose
An email attachment is a separate computer file sent alongside an email message, distinct from the inline text or images within the message body itself.[8] This allows users to include diverse content types, such as documents, photographs, spreadsheets, or executable programs, by embedding or linking the file to the email for transmission to the recipient.[9] Unlike the original plain text limitations of early email protocols, attachments enable the sharing of binary and non-textual data directly within a single message.[1] The primary purpose of email attachments arose from the need to extend email's utility beyond ASCII text, facilitating the exchange of multimedia files, application data, and other resources that could not otherwise be conveyed in standard messages.[1] By incorporating these files, attachments provide a self-contained method for communication, eliminating the dependence on external links or file-sharing services and allowing recipients to access the content offline once downloaded.[9] This enhances email's role as a versatile tool for personal and professional interactions, where brevity in text can be supplemented with detailed supplementary materials. Common everyday applications include sharing job resumes in PDF format during applications, distributing family photos in JPEG files among contacts, or sending financial reports as Excel spreadsheets in business correspondence.[8] For example, a professional might attach a Word document outlining a project proposal, enabling the recipient to review and edit the full details without navigating to a separate website.[9] Such uses underscore how attachments augment email's core functionality, promoting efficient and comprehensive information exchange. Email attachments are differentiated from embedded content, like inline images that display directly in the message body for seamless viewing, as attachments appear as distinct, downloadable entities that require user action to open.[8] This separation preserves the email's readability while accommodating larger or interactive files that might otherwise disrupt the flow. The capability is enabled by technologies such as the MIME standard, which structures multipart messages to handle these additions.[1]Types of Attachments
Email attachments encompass a variety of file formats, broadly classified into categories such as documents, images, archives, executables, and multimedia, each offering unique properties that influence their suitability for transmission via email. These formats are defined by their MIME types, which ensure proper handling by email clients, and their inherent characteristics like compression efficiency, cross-platform compatibility, and typical file sizes help determine their practicality for sharing.[10] DocumentsDocument formats like PDF and DOCX are staples for sharing text-based content. The Portable Document Format (PDF) excels in portability, enabling consistent viewing and printing across devices and operating systems without requiring the original authoring software, making it ideal for professional and legal communications. PDFs incorporate built-in compression to maintain quality while reducing file sizes, often resulting in attachments ranging from 100 KB for simple text to several MB for complex layouts with images. Additionally, PDFs support security features such as password protection and redaction, enhancing their suitability for sensitive information. In contrast, DOCX (Microsoft Word Open XML) provides excellent compatibility within the Microsoft Office ecosystem and supports editing, but it may exhibit formatting inconsistencies on non-Windows platforms or without compatible software, with file sizes typically smaller than legacy DOC files due to XML-based compression. DOCX files are generally under 1 MB for standard reports but can grow with embedded media.[11][10] Images
Image attachments commonly use JPEG and PNG formats, valued for visual communication in emails. JPEG employs lossy compression, significantly reducing file sizes—often to under 1 MB for high-resolution photos—while maintaining acceptable quality for photographs, though it may introduce artifacts in repeated saves. This makes JPEG highly suitable for email due to faster transmission and broad compatibility across all major platforms and devices. PNG, on the other hand, uses lossless compression, preserving exact image quality and supporting transparency, which is advantageous for graphics or logos, but results in larger files, typically 2-5 times the size of equivalent JPEGs, potentially impacting email load times on slower connections. Both formats enjoy universal support in email clients and browsers.[10] Archives
Archive formats such as ZIP and RAR enable bundling multiple files into a single attachment, streamlining sharing of collections. ZIP offers moderate compression levels, reducing overall size by 20-70% depending on content (e.g., text files compress better than already-compressed media), and provides strong cross-platform compatibility since it's natively supported on Windows, macOS, and Linux without proprietary software. Pros of ZIP include efficient emailing of multiple files, password protection for security, and ease of creation, though cons involve limited compression for certain file types like videos and potential total loss if the archive corrupts. RAR achieves higher compression ratios than ZIP—up to 10-30% better for mixed content—making it preferable for larger bundles, but it requires licensed software like WinRAR for full functionality, limiting compatibility on unlicensed systems. RAR files suit email for space savings but may face extraction issues on diverse recipients' devices.[12][13] Executables
Executable files, such as EXE for Windows applications, allow sharing of software but pose significant security risks, including potential malware delivery upon execution, leading many email providers to block or scan them rigorously. EXE files lack inherent compression and vary widely in size from a few KB for simple scripts to hundreds of MB for full programs, with compatibility restricted primarily to Windows environments. Their use in attachments is generally discouraged outside trusted contexts due to these vulnerabilities.[7][10] Multimedia
Multimedia attachments include MP4 for videos and MP3 for audio, facilitating rich content sharing. MP4 uses efficient compression codecs like H.264, balancing quality and size to keep files manageable (e.g., 5-50 MB for short clips), and offers excellent compatibility across devices via HTML5 support, though longer videos can exceed email size limits. MP3 applies perceptual coding for audio compression, drastically reducing sizes—often to 1-10 MB per track—while retaining near-CD quality, making it ideal for music or voice notes with universal playback compatibility. Both formats prioritize bandwidth efficiency for email but may require preview capabilities in clients to avoid full downloads.[10] As an emerging alternative to traditional file uploads, cloud-linked attachments—such as shares from Google Drive—allow users to embed access links in emails instead of attaching files directly, bypassing size constraints and enabling real-time collaboration without downloading large payloads. This method, supported in services like Gmail, maintains file integrity and version control while reducing storage demands on email servers.[6]
Technical Implementation
MIME Standard
The Multipurpose Internet Mail Extensions (MIME) standard extends the Simple Mail Transfer Protocol (SMTP) and other email protocols by defining mechanisms to include non-ASCII text and binary data in email messages, addressing limitations in the original RFC 822 format that restricted content to 7-bit US-ASCII.[2] Introduced in RFC 1341 in June 1992, MIME enables the specification and description of diverse message body formats, such as text in multiple character sets, images, audio, and other media types, thereby supporting attachments as integral parts of email.[2] Key components of MIME include specialized headers that describe the content of message parts, such as Content-Type, which identifies the media type and subtype (e.g., text/plain or image/jpeg),[1] and Content-Disposition, which specifies whether the content is intended for inline display or as a downloadable attachment.[14] MIME also supports multipart messages, where the Content-Type header is set to a multipart subtype like multipart/mixed to indicate multiple body parts within a single message, allowing attachments to be bundled with the email body. These parts are delimited by boundary markers—unique strings defined in the Content-Type header (e.g., boundary="----=_NextPart_000_0010_01DABCDE")—which separate the message into distinct sections without ambiguity during transmission. In a MIME-structured email with attachments, the message begins with a MIME-Version header (typically "1.0") to declare compliance, followed by a top-level Content-Type of multipart/mixed and a boundary declaration; each subsequent part includes its own headers, such as Content-Type for the attachment's media type and Content-Disposition: attachment; filename="example.pdf" to prompt the recipient's client to treat it as a file download rather than inline content.[1][14] For inline attachments, like embedded images, the Content-Disposition can be set to inline,[14] enabling rendering within the email body while still using MIME's multipart framework. The standard evolved from its initial proposal in RFC 1341 to MIME version 1.0, formalized in a series of RFCs (2045–2049) published in November 1996, which obsoleted earlier versions and refined the protocol for robust handling of international character sets through parameters like charset in Content-Type (e.g., charset="utf-8") and binary data via extensible media types.[1] This version 1.0 established MIME as the de facto foundation for modern email attachments, ensuring interoperability across diverse email systems and clients.[1]Encoding and Transmission
Email attachments, being binary data in many cases, require encoding into a text-safe format for reliable transmission over protocols like SMTP that traditionally handle only 7-bit ASCII text. The most common encoding scheme is Base64, defined in the MIME standard, which converts every three bytes of binary data into four ASCII characters using a 64-character alphabet (A-Z, a-z, 0-9, +, /) with padding via "=" if necessary.[15] This process increases the attachment size by approximately 33%, as the 24 bits from three bytes become 32 bits represented by four 8-bit characters, though line lengths are limited to 76 characters for readability.[15] Base64 is preferred for non-text attachments like images or executables because it preserves the exact binary content without alteration.[15] For attachments that are mostly text but contain occasional binary elements, such as emails with embedded non-ASCII characters, Quoted-Printable encoding is used. This scheme represents printable ASCII characters unchanged while encoding non-printable octets or high-bit characters as "=XX" where XX is the hexadecimal value, allowing the majority of the data to remain human-readable.[16] It adds minimal overhead for text-heavy files but can expand binary-dense content significantly, and it enforces line breaks with soft line breaks via "=" to avoid hard wraps.[16] A legacy alternative, UUEncode, originated in Unix systems for sending binary files via text-only mail and encodes data into 60-character lines using printable ASCII, but it is rarely used today due to inefficiencies and lack of standardization in MIME.[17] Once encoded, attachments are packaged into the email message body using MIME multipart structures, where boundaries—unique strings specified in the Content-Type header—delimit the message parts to prevent overlap and enable error-free parsing.[18] The entire MIME-formatted message, including the encoded attachment, is then transmitted over SMTP via the DATA command, which sends the content as a stream terminated by a single period on a line by itself; the SMTP envelope (defined by MAIL FROM and RCPT TO commands) handles routing separately from the message content.[19] For large attachments, the encoding itself involves chunking the binary data into manageable groups (e.g., 3-byte blocks for Base64), and MIME supports splitting oversized messages into multiple parts if needed, though standard SMTP does not stream attachments in real-time chunks without extensions like BDAT.[15] Error-checking relies on the MIME boundaries and SMTP response codes (e.g., 250 for successful delivery), ensuring the receiver can identify and extract parts correctly.[20] In retrieval protocols, POP3 uses the RETR command to download the full MIME-encoded message, including attachments, as a single octet stream that the client must decode locally.[21] IMAP, in contrast, allows more granular access via the FETCH command with BODY[section] specifiers to retrieve specific encoded parts without downloading the entire message, supporting partial fetches for large attachments.[22] Webmail services like Gmail adhere to the same MIME encoding standards during transmission but handle decoding server-side or via JavaScript in the browser, differing from desktop clients (e.g., Outlook or Thunderbird) that often perform decoding natively upon retrieval, potentially leading to variations in how non-standard encodings are processed. Encoding mismatches commonly cause attachment corruption, such as when a binary file is sent without Base64 (e.g., using 8-bit encoding over a 7-bit SMTP relay), resulting in altered bytes or garbled content upon decoding.[23] For instance, a PDF encoded in Quoted-Printable instead of Base64 may appear truncated or unopenable in some clients due to improper handling of escape sequences.[23] Recovery typically involves re-sending with correct encoding, using tools like base64 decoders on the raw message source, or extracting via email client utilities that ignore mismatched headers.[24]Historical Development
Early Email Attachments
In the pre-MIME era of the 1970s and 1980s, email attachments were rudimentary, relying on ad-hoc methods to transmit files over text-only networks like ARPANET and UUCP. Early systems treated files as encoded text blocks to bypass the limitations of ASCII-based protocols, which could not natively handle binary data. For instance, the Unix-to-Unix Copy Protocol (UUCP) used uuencode, developed in 1980 by Mary Ann Horton at UC Berkeley, to convert binary files into printable ASCII characters for inclusion in email messages as inline text.[25][26] As early as 1970, Doug Engelbart's NLS system at SRI allowed users to send files or parts of files across the ARPANET, laying groundwork for later attachment features.[26] Initial implementations emerged from ARPANET experiments in the 1970s, where users manually appended files as plain text to messages. In 1971, Ray Tomlinson developed an early email system on ARPANET using tools like SNDMSG and CPYnet, which appended text messages to remote mailbox files, limited to ASCII due to the absence of encoding mechanisms.[27] Building on earlier precursors like the 1970 NLS system, by 1976 formal mechanisms for enclosures were added to ARPANET email via systems like COMSYS/MSGDMS, enabling basic file sharing, though still primarily constrained to text formats.[26] For non-Unix platforms, BinHex was introduced in 1981 by Tim Mann as a hexadecimal encoding tool for the TRS-80 computer, later ported to Macintosh in 1984 by William Davis to facilitate binary file sharing via email on Apple networks.[28] These early approaches faced significant challenges due to the lack of standardization, resulting in widespread incompatibility across systems. Binary files often corrupted during transmission over 7-bit ASCII channels, and manual encoding processes were error-prone, limiting adoption to technical users familiar with command-line tools.[27][25] A key milestone came in 1985 with the release of BinHex 4.0 by Yves Lempereur, which introduced a more robust 6-bit encoding format (.hqx) specifically for Macintosh files, bridging the gap between text-only email and practical file sharing by simplifying binary transmission.[28][26] Similarly, uuencode became a de facto standard in Unix environments by the mid-1980s, influencing commercial systems like cc:Mail. These innovations highlighted the need for a universal solution, leading to the development of the MIME standard in the early 1990s.[25]Evolution and Standardization
The adoption of the Multipurpose Internet Mail Extensions (MIME) standard marked a pivotal advancement in email attachments, formalized in RFC 1341 published in June 1992. This specification extended the Simple Mail Transfer Protocol (SMTP) to support non-textual content, including binary files, images, and audio, by allowing multiple parts within a single message body. Prior to MIME, attachments were limited to text-based encodings that often corrupted binary data; MIME's structured format ensured reliable transmission of diverse file types. Email clients such as Eudora and Pine rapidly implemented MIME in the early to mid-1990s, with widespread use enabling true binary attachments and transforming email from a text-only medium to a versatile communication tool. By 1996, MIME had become a de facto standard, as revised in RFC 2045-2049, facilitating interoperability across diverse systems. In the 2000s, email attachment capabilities evolved further with enhancements in security, formatting, and accessibility. S/MIME (Secure/Multipurpose Internet Mail Extensions), initially specified in RFC 1847 (1995) and refined in RFC 2311 (1998) and subsequent versions, gained traction for encrypting and digitally signing attachments, addressing rising concerns over data privacy in business communications. Its adoption accelerated in enterprise environments during the decade, integrating with clients like Microsoft Outlook to protect sensitive files from interception. Concurrently, HTML email integration via MIME subtypes (e.g., text/html defined in RFC 2854, 2000) allowed attachments to complement rich message bodies, such as embedding images or linking documents, while mobile email support emerged with devices like BlackBerry Enterprise Server (2002), which enabled attachment viewing and management on handheld devices, broadening access beyond desktops. From the 2010s onward, email attachments adapted to cloud computing and bandwidth constraints, shifting toward link-based sharing to circumvent traditional size limitations. Webmail providers played a key role in standardization; for instance, Gmail's launch on April 1, 2004, introduced 1 GB of storage—vastly exceeding competitors—and supported attachments up to 10 MB initially, popularizing generous quotas and influencing industry norms. Protocol updates, including IMAP extensions like the PARTIAL command in RFC 3501 (2003), allowed clients to fetch only portions of messages or attachments, optimizing for mobile and low-bandwidth scenarios. This era saw widespread use of cloud integrations, such as Outlook's linkage with OneDrive (introduced around 2011) and Gmail's with Google Drive (2012), where users share secure links to large files stored remotely rather than embedding them directly, reducing transmission overhead and enhancing collaboration.Constraints and Limitations
Size and Storage Limits
Email attachment size limits vary across providers, protocols, and configurations, primarily to manage server resources and ensure reliable delivery. Major consumer email services like Gmail enforce a 25 MB limit per message (as of 2025), including all attachments, body text, and encoding overhead.[29] Similarly, Outlook.com and personal Microsoft accounts cap attachments at 25 MB total per email (as of 2025).[5] On-premises enterprise Exchange servers default to 10 MB, while Exchange Online in Microsoft 365 environments defaults to 35 MB; both can be configured up to 150 MB.[30] These provider-specific thresholds reflect a balance between user convenience and infrastructure demands, with enterprise setups often imposing stricter limits to control storage costs in corporate networks.[31] Protocols underlying email transmission and storage also contribute to effective size constraints. SMTP, the standard for sending messages, lacks a universal size cap in its specification but is practically limited by relay servers, which commonly reject messages exceeding 10 MB to 25 MB to prevent overload.[30] IMAP, used for retrieving and storing emails, imposes per-message limits tied to server policies rather than the protocol itself, often aligning with SMTP bounds but allowing mailbox-wide storage up to 50 GB primary (100 GB with archive) or more depending on the provider and licensing (as of 2025).[32] Transmission encoding, such as Base64 used in MIME, can inflate file sizes by about 33%, further reducing the practical attachment capacity within these limits.[33] Several factors influence these size and storage limits, including available server storage capacity, network bandwidth constraints, and anti-spam mechanisms that flag oversized messages as potential threats.[34] Exceeding limits typically results in delivery failures, such as bounced emails or automatic stripping of attachments by intermediate servers.[35] Most attachments in practice remain small, with typical sizes ranging from 2-5 MB, allowing the majority of exchanges to proceed without issues.[35] To circumvent size restrictions, users often compress files using tools like ZIP to reduce payload before attachment, potentially shrinking sizes by 50% or more for compressible formats.[31] Alternatively, uploading files to external hosting services such as Google Drive or OneDrive and sharing access links via email bypasses attachment limits entirely, enabling transmission of files up to gigabytes in size while maintaining compatibility across providers.[36]Protocol-Specific Restrictions
Email attachments are subject to various restrictions imposed by underlying protocols and client implementations, which can affect how attachments are handled, transmitted, and retrieved. The Simple Mail Transfer Protocol (SMTP), defined in RFC 5321, does not specify limits on the number of attachments or MIME parts in a multipart message, allowing theoretically unlimited attachments as long as the overall message size complies with server policies. However, practical implementations in email servers and relays often enforce caps to prevent abuse and manage resources; for example, Microsoft Exchange defaults to a maximum of 250 MIME parts per message (as of 2025), which includes attachments in multipart/mixed structures, though this can be configured lower, such as to 100 in some environments.[30] Retrieval protocols like Post Office Protocol version 3 (POP3) and Internet Message Access Protocol (IMAP) differ significantly in attachment handling, impacting user experience and storage. Under POP3 (RFC 1939), the entire email message, including all attachments, is downloaded to the client upon retrieval, potentially leading to immediate storage overflow on devices with limited space if attachments are numerous or large. In contrast, IMAP (RFC 3501) synchronizes only message headers and bodies initially, enabling selective downloading of attachments on demand, which mitigates storage risks and supports better multi-device access.[37] Client-side software introduces additional constraints, often tailored to platform limitations. Web-based email interfaces, such as Outlook on the web, support up to 250 attachments per message in Microsoft 365 environments, with file sizes limited by the total message size (default 35 MB).[30] Mobile applications enforce stricter rules to optimize battery life and data usage; for instance, the default Android email client historically limited attachments indirectly through size thresholds around 5 MB, while apps like Outlook for iOS restrict effective attachment handling to smaller sets to avoid performance degradation.[38] Compatibility challenges arise with legacy protocols and clients that predate or incompletely support the MIME standard (RFC 2045), potentially blocking certain attachment types or necessitating manual intervention. Older systems relying on uuencode for binary file encoding, common before MIME's widespread adoption in the 1990s, may display modern MIME-encoded attachments as raw, garbled text, requiring users to manually decode them using tools like uudecode if the client lacks MIME parsing. Inconsistent MIME support across some legacy clients can also result in attachments being stripped or misinterpreted, such as inline images failing to render properly.[39]Security Considerations
Malware Risks
Email attachments serve as a primary vector for malware distribution, often exploiting user trust and software vulnerabilities to initiate infections. Attackers embed malicious code in files such as macro-enabled documents, which, when opened, can automatically execute scripts to download and install viruses, trojans, or ransomware without further user interaction. Social engineering tactics, like disguising attachments as legitimate invoices or urgent updates, trick recipients into enabling macros or running executables, thereby delivering payloads that compromise systems. For instance, the Emotet trojan, one of the most prolific malware families, spread widely through spam emails containing infected Word or Excel files that exploited macro vulnerabilities to propagate further infections.[40][41][42] According to the 2024 Verizon Data Breach Investigations Report, phishing (often delivered via email) was involved in 36% of breaches, underscoring attachments' role in major campaigns.[43] The 2025 Verizon DBIR further notes ransomware linked to 75% of system-intrusion breaches, with email remaining a key vector.[44] Kaspersky detected over 125 million attempts to access malicious email attachments in 2024 alone, highlighting the scale of this threat.[45] These statistics reflect email's dominance in malware propagation, with ransomware variants like those in phishing attacks seeing a 22.6% increase in delivery via attachments from late 2024 onward.[46] Malware in attachments often bypasses initial security scans through obfuscation techniques, such as packing code to evade signature-based detection or using polymorphic variants that alter their structure with each infection. Zero-day exploits targeting unpatched software further enable infections by leveraging undisclosed vulnerabilities before patches are available. These processes allow malware to establish persistence, exfiltrate data, or encrypt files for ransom.[47][48] The broader impacts of attachment-delivered malware include widespread data breaches and substantial financial losses, with the average cost of a breach reaching $4.88 million in 2024 according to IBM's Cost of a Data Breach Report.[49] Ransomware attacks originating from such vectors contributed to reported losses of approximately $12.5 million via the FBI's Internet Crime Complaint Center in 2024, though experts note significant underreporting.[50] Over time, threats have evolved with phishing kits that automate the creation and distribution of emails embedding malicious attachments, amplifying the reach and sophistication of attacks.[51]Dangerous File Types
Certain file types attached to emails pose significant risks due to their inherent capabilities to execute code or harbor malicious payloads, making them prime vectors for malware distribution. High-risk categories include executable files such as .exe and .bat, which contain machine code that runs directly on the operating system when opened, potentially installing viruses or trojans without user intervention. Script files like .js (JavaScript) and .vbs (VBScript) are similarly dangerous, as they can automate harmful actions, such as downloading additional malware or modifying system settings, upon execution in environments like Windows. Microsoft Office files with embedded macros, including .docm and .xlsm formats, enable VBA scripts that can auto-run to deliver ransomware or spyware, exploiting the trust users place in familiar document types.[52][48][52][53][54][55] Medium-risk file types encompass archives like .zip, which can conceal high-risk executables or scripts within nested structures, evading initial scans and deploying payloads only after extraction. PDFs also fall into this category when they include embedded JavaScript, allowing attackers to trigger exploits or redirect to malicious sites upon viewing, as the format's interactivity can bypass basic security checks.[56][57][48][58] The primary dangers stem from these files' ability to execute arbitrary code immediately upon opening, often without prompting, combined with the frequent lack of sandboxing in default email clients and viewers, which permits direct access to the host system. Historical exploits illustrate this vulnerability; for instance, CVE-2017-0199 targeted HTA (.hta) files in email attachments, enabling remote code execution through Microsoft Office parsers to deliver malware like FormBook. To mitigate delivery, major email providers automatically filter high-risk types: Gmail blocks .exe attachments to prevent virus spread, while services like Yahoo Mail similarly restrict executables and scripts.[59][60][61][62]Security filtering of .html and .htm attachments
While many email providers handle .html and .htm files as standard document attachments without automatic blocking (e.g., Gmail treats them similarly to other non-executable files), enterprise email security gateways and services often apply stricter policies due to their frequent abuse in phishing campaigns. Standalone HTML attachments can contain fake login pages that mimic legitimate websites (e.g., banking or Microsoft services), capturing user credentials when opened in a browser. Attackers use techniques like JavaScript obfuscation or HTML smuggling (embedding base64-encoded payloads that decode into malware upon user interaction) to evade detection by antivirus scanners that focus on traditional executables. As a result, organizations commonly configure rules to:- Block emails with .html/.htm attachments outright.
- Quarantine them for review.
- Strip the attachment and replace it with a notification (e.g., "Attachment removed for security reasons").
- Microsoft 365 (Exchange Online) transport rules or common attachments filtering to block .htm/.html.
- Google Workspace attachment compliance rules to restrict custom file types like htm, html.
- Third-party gateways (Barracuda, Mimecast, etc.) often quarantine or strip such files.