mirror of
https://github.com/mailscope/kumomta.git
synced 2026-09-06 02:28:56 +00:00
This commit refactors listener_domains.lua to facilitate unit testing and adds a couple of basic test cases. The functional change here is that we were missing an explicit fallback step in the case where no listener or domain matches the provided values directly; we need to explicitly add a check against the `*` listener AND `*` domain for the final step. Previously, we would only look at the `*` listener for the final step. closes: #128
36 lines
1.2 KiB
Makefile
36 lines
1.2 KiB
Makefile
check:
|
|
cargo check
|
|
|
|
build:
|
|
cargo build $(BUILD_OPTS) -p kumod
|
|
cargo build $(BUILD_OPTS) -p tsa-daemon
|
|
cargo build $(BUILD_OPTS) -p kcli
|
|
cargo build $(BUILD_OPTS) -p validate-shaping
|
|
cargo build $(BUILD_OPTS) -p proxy-server
|
|
cargo build $(BUILD_OPTS) -p tailer
|
|
cargo build $(BUILD_OPTS) -p traffic-gen
|
|
|
|
# Check compilation with all possible feature combinations
|
|
# Requires: cargo install --locked cargo-feature-combinations
|
|
fc:
|
|
RUSTFLAGS="--cfg tokio_unstable -D warnings" cargo fc check --fail-fast
|
|
|
|
test: build
|
|
KUMOMTA_RUN_UNIT_TESTS=1 ./target/debug/kumod --user `id -un` --policy assets/policy-extras/queue.lua
|
|
KUMOMTA_RUN_UNIT_TESTS=1 ./target/debug/kumod --user `id -un` --policy assets/policy-extras/listener_domains.lua
|
|
./docs/update-openapi.sh
|
|
cargo nextest run
|
|
|
|
fmt:
|
|
cargo +nightly fmt
|
|
stylua --config-path stylua.toml .
|
|
black docs/generate-toc.py assets/ci/build-builder-images.py
|
|
|
|
sink: unsink
|
|
sudo iptables -t nat -A OUTPUT -p tcp \! -d 192.168.1.0/24 --dport 25 -j DNAT --to-destination 127.0.0.1:2026
|
|
sudo iptables -t nat -L -n
|
|
smtp-sink 127.0.0.1:2026 2000 || exit 0
|
|
|
|
unsink: # float?
|
|
while sudo iptables -t nat -D OUTPUT -p tcp \! -d 192.168.1.0/24 --dport 25 -j DNAT --to-destination 127.0.0.1:2026 ; do true ; done
|