Skip to content

Fix IMAP feed links by replacing mailto: with HTML pages#71

Merged
TBosak merged 2 commits into
deployfrom
main
Apr 29, 2026
Merged

Fix IMAP feed links by replacing mailto: with HTML pages#71
TBosak merged 2 commits into
deployfrom
main

Conversation

@TBosak

@TBosak TBosak commented Apr 29, 2026

Copy link
Copy Markdown
Owner

No description provided.

bps and others added 2 commits April 28, 2026 11:21
Email feed items had `<link>mailto:<message-id></link>`, which Capacitor /
WebView-based RSS readers (e.g. Cubic, Current, FocusReader) reject as
"URL is not allowed" or "unsupported or unsafe URL". Browsers and the
Miniflux web UI happily handled it, hiding the issue.

Instead, write a self-contained HTML page per email under
public/feeds/<feedId>/<sha256-of-msgid>.html (already served by Hono's
static handler) and use that as the item's <link>:

- Absolute URL when SERVER_URL is configured, relative otherwise.
- <guid> stays the Message-ID (unchanged), so reader read-state is
  preserved across the upgrade.
- Per-item HTML body is sanitized (drops script/style/iframe/object/
  embed/form/base/meta/svg/etc., strips on* event handlers and
  javascript:/vbscript:/non-image-data: URLs) and the page sets a strict
  Content-Security-Policy meta tag and referrer no-referrer.
- Stale per-item HTML files are pruned, but only AFTER the new feed XML
  has been written, via a deferred commit() callback returned from
  buildRSSFromEmailFolder. This avoids leaving the on-disk XML pointing
  at files we just deleted if the XML write fails.
- feedId is validated as a safe path component (defense-in-depth; in
  practice it is always a uuidv4 from the main process).
Fix IMAP feed <link>: replace mailto: with per-item HTML page
@TBosak
TBosak merged commit cfea60c into deploy Apr 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants