MBOX (.mbox)
.mbox file signature | application/mbox
Magic Bytes
Offset 0
46 72 6F 6D 20
Sources: Apache Tika
Extension
.mbox
MIME Type
application/mbox
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .mbox files in 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
function isMBOX(buffer: Buffer): boolean {
const signature = Buffer.from([0x46, 0x72, 0x6F, 0x6D, 0x20]);
return buffer.subarray(0, 5).equals(signature);
}
How to validate .mbox files in 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
/api/v1/mbox
curl https://filesignature.org/api/v1/mbox
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .mbox file?
A .mbox file is a MBOX file.
What are the magic bytes for .mbox files?
The magic bytes for MBOX files are 46 72 6F 6D 20 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .mbox file?
To validate a .mbox file, read the first bytes of the file and compare them against the known magic bytes (46 72 6F 6D 20) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .mbox files?
The primary MIME type for .mbox files is application/mbox.
Is it safe to open .mbox files?
MBOX (.mbox) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.