EMLX
message/x-emlx
Magic Bytes
Offset: 2
0A 52 65 6C 61 79 2D 56 65 72 73 69 6F 6E 3A
EMLX is a proprietary email storage format developed and maintained by Apple Inc. for the macOS Mail application. It serves as the native structure for individual message storage, allowing the Spotlight search engine to index content for rapid system-wide retrieval. Although similar to the standard EML format, it incorporates an XML metadata footer and is considered low-risk because it primarily functions as a plain text container.
Validation Code
How to validate .emlx files in Python
Python
def is_emlx(file_path: str) -> bool:
"""
Check if file is a valid EMLX by magic bytes.
Signature offset: 2 bytes
"""
signature = bytes([0x0A, 0x52, 0x65, 0x6C, 0x61, 0x79, 0x2D, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3A])
with open(file_path, "rb") as f:
f.seek(2)
return f.read(15) == signature
How to validate .emlx files in Node.js
Node.js
function isEMLX(buffer: Buffer): boolean {
// Signature offset: 2 bytes
const signature = Buffer.from([0x0A, 0x52, 0x65, 0x6C, 0x61, 0x79, 0x2D, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3A]);
if (buffer.length < 17) return false;
return buffer.subarray(2, 17).equals(signature);
}
Go
func IsEMLX(data []byte) bool {
// Signature offset: 2 bytes
signature := []byte{0x0A, 0x52, 0x65, 0x6C, 0x61, 0x79, 0x2D, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3A}
if len(data) < 17 {
return false
}
return bytes.Equal(data[2:17], signature)
}
API Endpoint
GET
/api/v1/emlx
curl https://filesignature.org/api/v1/emlx