• v0.46.1 8cc358a757

    v0.46.1 Stable

    joeyr released this 2026-08-25 16:34:05 -05:00 | 70 commits to main since this release

    The alias index no longer costs a user-visible pause. It was 8.1 seconds on
    the first get_message_security after a restart, paid by whoever asked first.
    Now it is ~1 second of work, and it happens before anyone asks.

    Fixed

    • The index asks the server for the relayed mail instead of reading the
      archive.
      It swept all 4,602 messages because the alias is only visible in
      headers — but the relay is visible to IMAP SEARCH, and
      origin.resolve returns relayed only when the From domain is a trusted
      relay. So SEARCH FROM folded over TRUSTED_RELAYS matches exactly the
      messages the sweep could learn from, and excludes only what it would have
      discarded.

      Verified rather than assumed — both built on one connection, same moment:

      messages read time index
      full sweep 4,602 7.5s 82 aliases, 102 pairs
      SEARCH FROM 307 1.0s 82 aliases, 102 pairs

      Byte-identical. resolve still runs on every hit and is not redundant with
      the search: SEARCH matched the relay's name, resolve is what verifies its
      signature, and a message failing that must not enter the index.

      An intermediate version walked the archive newest-first and stopped after two
      batches taught nothing — aliased mail is recent, all 258 relayed messages sit
      inside the newest 1,000. It worked, and it is gone: it still read 2,000
      messages for a 7.3s build, and it needed a heuristic about how far back to
      walk that the search does not.

    • The build runs at startup, in the background. warm_alias_index() is
      called from __main__ after preflight, against the client that lives as long
      as the process — not from __init__, where preflight and the tests would each
      trigger their own. The build takes a lock, so a request arriving mid-build
      waits for the one already running rather than starting a second.

      A zero MAIL_ALIAS_INDEX_TTL still switches the whole thing off, and now
      starts no thread either.

    Downloads