About the implementation and examples

Engineering notes draw on author-supplied MailTrace development reports through 13 October 2026. They describe the documented revision, including local work, rather than independently verified live deployment. Experiment designs and architecture proposals describe work to evaluate. Examples are educational, use synthetic data and are not copied production code.

Separate eligibility limits from relevance judgements

The supplied implementation update reports defaults of 25 MiB per file, 100 PDF pages and 40 megapixels. Those are processing limits, not proof that an accepted file is useful or that a small file is irrelevant. The update also states that small files remain eligible.

A possible classifier could use MIME type, dimensions, inline disposition, repeated content hashes and surrounding email context. These signals need labelled examples and careful evaluation. A frequently repeated file might be a standard but important form; a filename containing “logo” is suggestive rather than decisive.

Make a suggestion reversible

The code below is a deliberately simple heuristic for selecting possible signature assets for review. It is not MailTrace’s classifier, and its thresholds are illustrative. It never deletes or excludes a file.

python · A synthetic review suggestion, with no automatic exclusion.
def suggest_asset_review(item):
    signals = [
        item.get("inline", False),
        item.get("repeated_hash_count", 0) >= 5,
        item.get("name", "").lower().startswith("logo"),
    ]
    return "review_possible_signature" if sum(signals) >= 2 else "keep_eligible"

assert suggest_asset_review({"name": "scan.png", "bytes": 800}) == "keep_eligible"
assert suggest_asset_review({"name": "logo.png", "inline": True}) == "review_possible_signature"

Treat false exclusion as a first-class error

Build a labelled set containing logos, tiny screenshots, scanned pages, icons and repeated substantive documents. Measure how often useful evidence is incorrectly suggested for exclusion, not just how many signature assets are found. Keep a random audit sample of accepted items as well as flagged ones.

If a model improves the rule baseline, integrate it into the existing reversible exclusion workflow. Show the reason, preserve the original file and allow restoration. The goal is a cleaner working view while maintaining access to evidence, rather than a classifier that makes irreversible relevance decisions on the user’s behalf.

Browse the complete MailTrace series →