MBOX
application/mbox
Magic Bytes
Offset: 0
46 72 6F 6D 20
MBOX is a generic file format family originally developed for Unix systems to organize and store collections of electronic mail messages within a single file. It is extensively used by applications such as Mozilla Thunderbird and Apple Mail for archiving correspondence, migrating data between providers, and performing local backups. Although the format consists of benign plain text, users should remain cautious as the contained messages may still include malicious attachments or links.
Validation Code
How to validate .mbox files in Python
Python
def is_mbox(file_path: str) -> bool:
"""Check if file is a valid MBOX by magic bytes."""
signature = bytes([0x46, 0x72, 0x6F, 0x6D, 0x20])
with open(file_path, "rb") as f:
return f.read(5) == signature
How to validate .mbox files in Node.js
Node.js
function isMBOX(buffer: Buffer): boolean {
const signature = Buffer.from([0x46, 0x72, 0x6F, 0x6D, 0x20]);
return buffer.subarray(0, 5).equals(signature);
}
Go
func IsMBOX(data []byte) bool {
signature := []byte{0x46, 0x72, 0x6F, 0x6D, 0x20}
if len(data) < 5 {
return false
}
return bytes.Equal(data[:5], signature)
}
API Endpoint
GET
/api/v1/mbox
curl https://filesignature.org/api/v1/mbox