forked from KokaKiwi/boitalettres
1.3 KiB
1.3 KiB
Just Enough Doc
Run simple
example
This example is meant to show basic service-based IMAP server with boitalettres library.
$ export RUST_LOG="info,simple=trace,boitalettres=trace"
$ export RUSTFLAGS="--cfg tokio_unstable"
$ cargo run --example simple
- Test it manually
Theoretically, IMAP server expected end of lines with \r\n
but implementations are more liberal.
To check with \r\n
, use the socat
command line.
The nc
command line will send only \n
when run on Linux, our current implementation supports it.
$ socat readline tcp4:127.0.0.1:4567,crnl
$ nc 127.0.0.1 4567
If you want to trace this simple
example with the tokio-console
utility, run:
$ RUSTFLAGS="tokio_unstable" cargo run --example simple --features "tokio/tracing"
$ python scripts/test_imap.py
Notes
- The library use the
tracing
library for logging, a basic setup is shown in thesimple
example with thetracing-subscriber
crate.
References
imap-codec
: IMAP protocol model+encoder/decodertower
: Service-based request handling library