Repository navigation
tmpmail 0.3.5 fixes the command-line tool and the shared core: cleaner sender text, read --html with the Firefox snap, inline images from mail.tm, image addresses listed as links, and long mail cut by the provider without a word. It also brings the fixes of a full security review of the code, and waits through provider rate limits.
Fixed
-
Stronger cleaning of the sender's words. Terminal escape sequences are now removed whole (
ESC[31mREDprinted as[31mREDbefore; nowRED), and besides control characters and bidi overrides, the other invisible format characters go too (U+061C, zero-width spaces, word joiners, the BOM). Zero-width joiners and the tags of emoji flags stay, so emoji still draw as one. A stray ESC goes alone, without the letter after it. This isrender::cleanandrender::clean_line, used byls,read,watch, the TUI and the desktop app. -
read --htmlworks with the Firefox snap on KDE. With the Firefox snap, Firefox showed "Access to the file was denied": the copy was written under~/.local/state/tmpmail/view/, and a snap can't read hidden folders in your home (GNOME got around it by handing the file over through the document portal; KDE doesn't). When the browser that opens the copy is a snap (by--browser,$BROWSER, or the desktop's default for HTML files), tmpmail now writes it to~/snap/NAME/common/tmpmail-view/, which the snap can always read, still private (0600in a0700folder) and deleted after a day. A snap that has never run has no such folder yet, and tmpmail creates none for it: the copy then goes to the state folder and is handed to the snap withgio launchand its desktop file, which passes it through the document portal, with a warning to start the browser once and run the command again if it still refuses the copy. Withoutgioor the snap's desktop file the copy is opened from the state folder as before, and the warning says so (and why) instead of naming the portal. The TUI'sodoes the same. -
Inline images show in
read --html. The copy keptcid:references, which a browser can't load, so inline images (logos, pictures in the text) showed as their alt text. They are now put in the copy asdata:URLs: the attachment the provider lists under that name, else the part with thatContent-IDin the raw message, where the provider has one (mail.tm, mail.gw, DropMail, Maildrop). mail.tm and mail.gw rewrite an inline image'scid:address in the HTML they hand out toattachment:ID, the id of the attachment they list for it, which no browser knows: tmpmail now reads an image'ssrc="attachment:ID"as the message's own image attachment with that id (only that scheme, only that message's attachments, under the same limits), and--json readshows it ascid:ID. The raw message of mail.tm also leaves out the line break after each part's opening boundary, which the MIME reader now accepts (a boundary followed at once by aContent-header and its colon; nothing else is loosened). Raster images only, up to 10 MiB each. The TUI'soputs them in its copy too, fetched on a thread of their own (the status line says "loading the message's inline images...", and says when some couldn't be loaded), so neither the screen nor the inbox checks wait on them. -
Image addresses aren't links. A mail's remote images (
<img src>,srcset,background=, CSSurl(...)) were listed bylinks, and could be "the best link" ofwait --linkor the first link of the TUI'sL/Oand the desktop app: a mail with images and no link at all offered a Google logo. An address the HTML only loads is now left out, also when the text part repeats it, unless the mail also links to it. -
Long mail from mail.tm isn't cut short. mail.tm and mail.gw cut a message's text and HTML at 100 KiB, mid-line and without a word, so
readshowed part of a long mail, and a code or link past the cut wasn't found. A body that long is now checked against the raw source, which is whole, and the source's is used. If the source can't be read, the text ends with a note that it may be cut and thatread --rawhas all of it. -
waitwaits through a rate limit. With the desktop app or the TUI checking the same mail.tm inbox,wait --linkexited 3 with "rate limited, try again later" when its first listing was refused.wait,otp --waitandwatchnow say so once and keep waiting: they ask again after the provider'sRetry-After(at most 2 minutes), else after one or two poll intervals, until their own timeout (exit 2), and push wake-ups wait too. Mail that arrives while the first listing is refused counts as new by its date. The desktop app's and the TUI's checks hold back after a rate limit the same way, so they don't keep the provider refusing awaiton the same inbox. -
In-page links in
read --htmlfind their target.href="#section"was kept, but the sanitizer dropped theidand<a name>it points at, so only#topworked. They are kept now, prefixed withmail-so a mail can't reuse a name of the page's own, and the mail's#links are rewritten to match (#stays, and so does#topunless the mail has its owntop). The same sanitizer (render::sanitize_mail_html) serves the desktop app. -
Headers labelled ISO-8859-1 are read as Windows-1252, as browsers do (tempmail.lol's encoded names and subjects): curly quotes and dashes in mislabelled mail show instead of being dropped as control characters.
Security fixes
From a full security review of the code at 0.3.4 (2026-11-01). None was critical or high.
-
A "link" must be a real web address (medium). A mail could put
href="http\..\..\Windows\System32\calc.exe"orhref="http/../Downloads/verify.html"in a message: the link check only looked at the first four letters, the word "verify" ranked it first, andlinks --openor the TUI'sOhanded it to the system opener, which took it for a file path (GNOME'sgio openresolves it against the current folder; Explorer starts an executable it is given). A link is now read as a browser reads it (character references decoded, line breaks dropped, spaces and invisible characters escaped) and must then be a whole absolutehttp://orhttps://URL with a host, without backslashes;links --openandOrefuse anything else whatever the list holds. So the TUI'sLno longer copies a link with a line break in it, which would run as a second command when pasted in a shell. A link written with&instead of&now works, and an invisible mark right after a link in right-to-left text ends it. The MCP server'sget_linksand the desktop app take the same list. -
A snap can't make
read --htmldelete or write files elsewhere (medium). The copies for a snap browser go to~/snap/NAME/common/tmpmail-view/, which the snap may write in. tmpmail checked that no folder on the way was a link and then worked by path, so a snap swapping its folder for a link at the right moment could make tmpmail delete a file of the same name in another folder (a race the review won in a few views), or create the copy where the link pointed. The folder is now opened one level at a time inside the one before it, refusing links, and the copy is written, listed and deleted inside the open folder only, so a link put there afterwards leads nowhere. If a folder on the way is a link, the copy goes to the state folder with a warning. Copies are now namedtmpmail-ID.html, and in a snap's folder only such files (and theID.htmlcopies of the first builds that wrote there) are pruned, in every snap'stmpmail-viewfolder through the same open-folder walk, so an earlier browser's copies go too. -
Dependencies with published advisories updated (medium). rustls 0.23.46 and rustls-webpki 0.103.16 (a certificate chain through the distrusted emSign intermediates, whose keys are public, was accepted where the system still trusts their roots; an unauthenticated ServerHello could downgrade later connections' key exchange), ammonia 4.2.4 (CSS
urlmatched case-sensitively; not reachable with tmpmail's settings), tokio 1.53.3, rustix 1.1.6 (its extended-attribute functions, which tmpmail doesn't call, could mark unwritten bytes as read). A newauditworkflow checksCargo.lockagainst the RustSec database on every push and every week; the advisories without a fix within semver are listed indeny.tomlwith their reasons (lru 0.12 through ratatui 0.29, and unmaintained helper crates). -
Inline images are capped per message (medium, in the desktop app; the same in
read --html). A mail with one 9 MB image and a thousand<img src="cid:big.png@N">tags made the app download the image a thousand times and keep a copy for each name (about 9 GB). Images are now kept by the attachment they resolve to, so any number of names for one attachment fetch it once; at most 64 distinctcid:names are looked up per message, and at most 25 MiB of images are shown for it (64 is far more inline images than real mail carries; 25 MiB is the usual limit of a whole mail at the big mail services).read --htmlfetches each attachment once too, and its copy holds at most 25 MiB of images however often the mail repeats one. -
The release workflow is locked down (medium).
release.yml, which builds the CLI's archives and pushes the Homebrew formula, used actions by tag (anddtolnay/rust-toolchainby branch) while holding write, attestation and tap-token rights; a moved tag upstream could have attested or published a different binary. Every action in every workflow is now pinned by commit SHA, checkouts keep no credentials, the jobs that compile have a read-only token, and the attestations (of each archive and ofSHA256SUMS) are made in the release job, which compiles nothing. The Homebrew tap token is given to thegit pushalone. A manual run of the workflow, even on a tag, now only builds (before, it published the release and pushed the formula). Theci,guiandprovidersworkflows get a read-only token; only the provider check's report job may write issues. -
savenever writes through a planted link, and names are safe everywhere.savechecked that a name was free and then wrote it, following links: another user who can write in the-ofolder could plant a dangling link named like an expected attachment and have its bytes written wherever it pointed. Each file is now created new (O_EXCL, andO_NOFOLLOWon Unix), moving on toname (1).extwhen the name is taken. Names now also lose a leading-(whichrm *ortar *would read as an option) and trailing dots and spaces; Windows device names (CON,NUL,COM1.pdf...) get a_in front, so the bytes don't go to the console or vanish intoNUL; and a long name is cut at 240 bytes keeping its extension (before, 200 characters, which could pass the file system's 255 bytes and fail). The desktop app's drag-out files are created new the same way. -
A stricter HTML sanitizer. Relative,
//hostand\\hostlinks and images are dropped: mail has no base address, and from thefile:page ofread --htmlsuch a link resolves to another machine (on Windows an SMB connection that can leak the user's password hash).data:URLs stay only as an image's raster picture, never as a link (a page of the sender's) or an SVG. Inline styles keep only an allowlist of look-and-layout properties in every mode (colors, fonts, spacing, borders, sizes, table and flex layout; notposition,inset,z-index,transform,scale,zoom,opacity..., and no negative margins), with comments removed and a declaration holding a CSS escape dropped, so a link can't be laid over the whole mail to catch any click. The file view's style filter now reads CSS escapes before looking forurl((u\72l(was missed; the page's CSP still blocked it) and also blocksimage-set(,@importandexpression(; with--images, a style may load only web URLs and inline raster images. In-page#links still work. -
--jsonoutput carries no raw terminal controls. serde_json escaped only U+0000–U+001F, sotmpmail --json reador--json watchon a terminal wrote a subject's 8-bit CSI or OSC controls (U+009B, U+009D: clear the screen, write the clipboard on some terminals) and bidi overrides as they were. Every control character, bidi control and invisible format character is now written as a\uXXXXescape, always (the values a parser reads are unchanged); the MCP server's replies too.domainsnow cleans the names a provider sends before printing them, as every other provider string already was. -
Hostile mail can't stall tmpmail. A sender could make
read, the TUI,wait --otp/--link, the MCP server or the desktop app work for seconds to minutes: 100 000 nested<div>took 40 s to sanitize; 560 KB of distinct numbers 10 s to search for a code, 1.4 MB of distinct links 8 s; a header of 40 000 MIME parameters 4 s; a subject of combining marks froze the TUI's footer. HTML past 4 MiB or nested deeper than 1000 elements (measured by the HTML parser itself, 16 KiB at a time, stopping once past the limit: a first, hand-written count took elements the parser closes on its own, such as a second<a>or SVG's<path/>, as open, so shallow mail was shown as text, and missed nesting the parser does build, such as<span><div></span>repeated) is now shown as its plain text, under a note saying why; codes and links are looked for in the first 1 MiB of text (4 MiB of HTML), cut at a space, with hash sets; a header's first 256 parameters are read (andboundary,charset,name,filenamepast them); and the footer is fitted in one pass. Tests time each case at the reviewers' sizes. -
Limits on what a provider sends, and where credentials go. A provider's answer (or a man in the middle's) could be any size: a multi-GB body or an endless push-stream line grew until the system killed tmpmail. raw messages and attachments are now read up to 64 MiB (above the providers' own message limits), JSON answers up to 80 MiB (mail.tm and Maildrop send raw messages as JSON), error bodies up to 64 KiB, and mail.tm's push stream refuses a line over 1 MiB; past a limit the request fails with a clear error instead of reading on. A provider that stops sending in the middle of an answer is reported as "request timed out", as a provider that never answers is (it showed reqwest's own "operation timed out"). A download address that mail.tm or DropMail lists for an attachment or a raw message is now used only when it is on the provider's own site (same scheme, port and host, or a host under it), so the account's token (mail.tm) or the session (DropMail) never goes to another host.
-
Private files are written whole and exactly 0600 (info).
state.jsonand DropMail's token cache are now written to a new temporary file next to them (created withO_EXCLandO_NOFOLLOW, mode set to0600whatever the umask) that then replaces the old one: a token cache that existed with a wider mode no longer keeps it, and a link put in its place is replaced, not followed. -
The MCP server hands mail to agents more carefully. Mail is a prompt-injection channel: every string in a tool result now loses terminal escapes, control, bidi and invisible characters, Unicode tag characters included (the "ASCII smuggling" carrier, invisible to a person reading the transcript); fields over 64 KiB and lists over 200 items are cut (
"truncated": true); the results that hold mail carry"untrusted_content": trueand a second text block noting that the mail fields are data, not instructions; andcreate_inboxsays inpublic_notewhen the inbox is public (Maildrop). The JSON-RPC loop no longer dies on a line that isn't UTF-8 (it answers-32700and goes on), answers a batch with an array of replies (it got none before; atools/callin a batch gets-32600), caps a line at 1 MiB and the calls running at once at 16 (a cancelled call counts until its thread has ended), and refuses a second call with the id of one still running (a cancelled call's id may be used again). -
Saved attachments are marked as downloaded. On Windows
savenow writes aZone.Identifierstream (zone 3) next to each file, and on macOS setscom.apple.quarantine, as browsers do, so SmartScreen, Office's Protected View and Gatekeeper treat a file from a mail as from the internet. No new dependency. -
Install and verification instructions. The README's GitHub Actions snippet now downloads
SHA256SUMStoo and checks the archive against it before unpacking; the attestation commands add--signer-workflow(so a file attested by the desktop app's workflow doesn't pass for a CLI file, and the reverse);cargo install --lockedbuilds with the vettedCargo.lock. The desktop app'spackageManagernames pnpm with its hash (corepack checks the pnpm it downloads), and the app's builds in CI runtauri buildwith--locked.
For library users
Watcher::set_configkeeps the poller (and its push streams) when the poll interval, push and timeout are unchanged.extract::linksno longer returns what the HTML only loads (images,url(...)). New:extract::push_new.render::cleanandrender::clean_lineremove more (see above); their signatures are unchanged.- New:
provider::inline_images(a raw message's inline images byContent-ID),provider::inline_attachment(the listed attachment acid:most likely means),provider::cid_of_url,provider::image_type(the raster type an inline part may be shown as; never SVG),provider::MAX_INLINE_IMAGE,render::cid_imagesandrender::safe_html_document_inline(safe_html_documentwithcid:images replaced). - New:
extract::is_web_link, the rule above;extract::linksreturns only such links. - New:
provider::MAX_INLINE_CIDSandprovider::MAX_INLINE_TOTAL, the limits above. render::safe_filenamealso refuses Windows device names, a leading-and trailing dots and spaces, and caps names at 240 bytes.- New:
render::escape_json_invisible, which escapes those characters in JSON text. - New:
render::percent_decode, the%XXdecoder the desktop app shares. - New:
render::html_too_large,render::MAX_HTML,render::MAX_HTML_DEPTHandrender::HTML_TOO_LARGE; past the limits,render::html_to_textand the sanitizer return the body's text without tags, after that note. - New:
render::percent_encodeis public. - New:
store::mark_from_internet.