Files
swift-nio-imap/Examples
Daniel Eggert 3cd39758d4 Use [UInt8] for small model fields
Small fields (mailbox names, atoms, quoted strings, envelope fields,
base64, URLs, the authentication challenge, catenateURL, ...) become
[UInt8]. The four raw-payload cases stay ByteBuffer until "Make payload
cases IMAPBuffer".

The grammar's string productions return [UInt8]. The parser still runs
on ParseBuffer, so its cursor methods copy out of the ByteBuffer for now.

Review focus: the model files' encoders and ModifiedUTF7 on arrays.

Updates IMAPTool and the IMAPCommands catenate-URL wrapper.

Public API breaks:
- ~38 public declarations ByteBuffer -> [UInt8].
- ModifiedUTF7.EncodingRoundtripError.buffer -> .bytes.
- Response.authenticationChallenge and ContinuationRequest.data are
  [UInt8]; an empty challenge is [].

Internal: writeBufferAsBase64 -> writeBytesAsBase64; the ByteBuffer
writeIMAPString overload is gone.
2026-11-24 09:47:33 +09:00
..

Examples

This directory contains example and tool projects built on top of swift-nio-imap. Each subdirectory is its own standalone Swift package that depends on the library in the repository root via a local path dependency (.package(path: "../..")).

Keeping them out of the root package means the library's own dependency graph stays smaller — consumers don't resolve example-only dependencies such as ArgumentParser. (Dependencies that the library products themselves use — for example swift-log, which IMAPCommands depends on — remain part of the root package's graph.)

Example What it is
IMAPTool Command-line IMAP debugging tool (imap-tool) built on the IMAPToolLib library product.
CLI A smaller command-line interface plus its supporting CLILib (with tests).
Proxy An IMAP proxy that logs the traffic flowing through it.
Fuzzer Fuzzing harness for the IMAP parser (NIOIMAPFuzzer).
PerformanceTester Parser and encoder benchmarks, built on ordo-one/benchmark.

Building and running

Each example builds independently. From the repository root:

swift build --package-path Examples/IMAPTool
swift run   --package-path Examples/IMAPTool imap-tool --help

Because they are separate packages, swift build / swift test at the repository root builds only the library targets — not these examples. CI builds them in the Build examples job; PerformanceTester has its own Build benchmarks job.