Something went wrong. Try again.
Classic Unix mailbox files for Zig 0.16: an iterator to read, a predicate to delete, an atomic rewrite for every change.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445# SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us># SPDX-License-Identifier: MIT
# Does anything else agree about where these messages start and stop?## Deliberately a plain derivation rather than a virtual machine. The sibling# projects' interoperability tests boot a NixOS guest because what they are# testing is a daemon -- something that chroots, drops privileges and checks a# password against a real user database, none of which is reachable from a# build sandbox. An mbox is a file, and reading one is two programs and a# directory, so a guest here would cost a minute a run and prove nothing extra.## `tests/interop.py` says what is actually checked and why each fixture is# there. It is a file rather than a string in this expression because a script# inside a Nix `''` string is one level of quoting too many.
{ zig-mbox }:
{ lib, runCommand, procmail, python3,}:
runCommand "zig-mbox-interop" { nativeBuildInputs = [ zig-mbox # `formail -s`, the splitter every mail script on earth reaches for. procmail # Its `mailbox` module is the most widely installed implementation of # this format there is, and it disagrees with us on purpose in one place: # it does not undo the quoting it reads. python3 ]; meta = { description = "zig-mbox read and written by formail and Python's mailbox module"; inherit (python3.meta) platforms; }; } '' python3 ${./interop.py} ${lib.getExe zig-mbox} ${procmail}/bin/formail | tee $out ''