Files
bongo/contrib/testing/README.md
T
Mario Fetka c29812475c
Debian Trixie package bundle / packages (push) Successful in 21m57s
Add comprehensive web and collector fixtures
2026-07-22 08:37:06 +02:00

2.5 KiB

Local mail protocol fixtures

These fixtures are intentionally bound to loopback and use non-standard ports. They are development tools, not production configuration.

Cyrus IMAP, POP3, and LMTP

Install net-mail/cyrus-imapd, then start the disposable fixture as root:

sudo ./contrib/testing/cyrus-fixture.py start

It creates no files outside /tmp/bongo-cyrus-fixture and listens on:

  • IMAP: 127.0.0.1:18143
  • POP3: 127.0.0.1:18110
  • LMTP: 127.0.0.1:18024

The source mailboxes are pop-source@cyrus.bongo.test and imap-source@cyrus.bongo.test, with the test-only password BongoCollector-Test-2026. Insert a complete RFC 5322 message through Cyrus' real LMTP delivery path:

sudo ./contrib/testing/cyrus-fixture.py inject message.eml

Seed three different messages in each source mailbox and exercise Bongo's real Collector POP3 and IMAP transport implementation:

./contrib/testing/cyrus-fixture.py verify-collector \
  --probe ./build/src/agents/collector/collector-vtestmail-transport-test \
  --count 3

The probe lists and fetches every message, checks its fixture marker, deletes it through the selected protocol, and verifies that the Cyrus source mailbox is empty. A live end-to-end run creates two Bongo external accounts: the POP3 source delivers into Bongo user test1, while the IMAP source delivers into a different Bongo user. Both use after_import, so Cyrus deletion happens only after the Bongo Store accepts the complete message.

The same LMTP listener is the forwarding target for the exact transport-domain mapping below. This accepts *@cyrus.bongo.test without making the test domain a local Bongo domain:

"lmtp_transports": ["cyrus.bongo.test=127.0.0.1:18024"]

The generated self-signed certificate at /tmp/bongo-cyrus-fixture/tls/server.crt is the fixture trust anchor. Set BONGO_COLLECTOR_CAINFO to that path for the Collector process during this test; normal installations continue to use the operating-system trust store.

Stop or remove all fixture state with:

sudo ./contrib/testing/cyrus-fixture.py stop
sudo ./contrib/testing/cyrus-fixture.py reset

Outbound SMTP capture

Use net-mail/xeams-devnullsmtp-bin from the Bongo Gentoo overlay:

xeams-devnullsmtp -p 2526 -d bongo.test -s /tmp/bongo-devnull-mail

Configure 127.0.0.1:2526 as Bongo's relay host before testing any non-local recipient. Xeams DevNullSMTP has no listen-address option, so isolate it with a firewall or network namespace; do not expose it on a production network.