Seeking feedback: Local-first MCP server for email sanitization (what all edge cases am I missing?)

Hey everyone,

I’ve been working on a local-first, open-source Python tool (InBox Wall) to sanitize email HTML before feeding it to a local AI agent via MCP. The goal is to prevent hidden CSS/Unicode prompt injections without sending data to the cloud.

Current approach:

  • Fetches via read-only IMAP (all processing is local).
  • Uses css-inline + BeautifulSoup to compute effective styles and strip hidden text.
  • Quarantines threats in a separate local SQLite DB (dual-database isolation).
  • Exposes a standard MCP tool for AI agents to safely read sanitized emails.

Known limitations:
It does NOT scan attachments, analyze URLs, or use OCR. It’s strictly a defense-in-depth layer for HTML bodies.

Where I need your help:
I want to make sure this is as robust as possible. For those of you building local MCP workflows or dealing with email parsing:

  1. Are there any HTML/CSS parsing edge cases I’m missing?
  2. Is the dual-database isolation approach overkill, or is it the right move for local security?
  3. What else would you add to make this genuinely useful for your local AI setup?

Try it out:

:globe_with_meridians: Live Demo - InBox Wall - Live Demo
(No installation required, runs entirely in your browser with sample data)
:laptop: GitHub Repository - GitHub - Annora998/inboxwall: Local-first, read-only AI email security. Sanitizes hidden CSS tricks, Unicode obfuscation, and prompt injection attacks before AI sees them. · GitHub

Would really appreciate any brutal, honest technical feedback. Thanks!

Read inboxwall/engine/style_utils.py at 781f6c4; didn’t run it, so treat these as things to test:

  1. Three checks look dead. parse_style stores only the value under the property key, but L72, L90 and L100 search for the property name inside that value (height\s*:\s*0 on style_dict.get(“height”), same for text-indent and font-size). So height:0, text-indent:-9999px, and font-size:0% never fire there. font-size:0 and 0px are still caught by the fullmatch at L101-105, but % is not.
  2. max-height:0 with overflow:hidden isn’t checked at all. That is the usual preheader hiding trick.
  3. The clip check wants rect(0,0,0,0) with no spaces, so rect(0 0 0 0) gets through, and clip-path isn’t checked.
  4. White-on-white needs exact literals, so rgb(255, 255, 255) with spaces is missed, and same-colour text on a non-white background is missed. Also, only the style attribute is parsed, so and are ignored unless css_inline converts them. I didn’t check that part.

For 1, matching the value directly (re.fullmatch(r"0(px|%|em)?", value)) should be enough.

Thanks a lot for this.

I just pushed a fix for all of these. For the dead checks, I updated the logic to match the value directly, which fixed the height, text-indent, and font-size issues. I also added the max-height + overflow: hidden check for the preheader trick.

The clip regex now handles spaces, and I added clip-path too. For the colors, I just strip out the spaces before checking them, so things like rgb(255, 255, 255) get caught now.

Here is the updated file: https://github.com/Annora998/inboxwall/blob/main/inboxwall/engine/style_utils.py

Really appreciate the help!