This project reimplements the tools from Hannah Schroeter's original bsmtp 1.02 Debian package in Go. The original package identified its homepage as www.gnuu.de; its maintainer was Hannah Schroeter hannah@mamba.pond.sub.org. The original package contained a UUCP-backed batched SMTP spooler, receivers, queue viewers, and transport helpers. This is not an interactive SMTP network server. See LICENSE for the original copyright and license.
The Go implementation queues messages by UUCP host, emits BSMTP batches, hands batches to uux, receives plain or compressed batches through a local sendmail-compatible MTA, and displays queued envelopes. It replaces the original C, Perl, and shell programs with one Go executable and command-name symlinks.
| Installed command | Purpose |
|---|---|
/usr/sbin/bsmtp -f SENDER HOST RECIPIENT ... |
Append a message from stdin to the host's queue. |
/usr/sbin/batcher METHOD HOST |
Send a queued batch and clear it after successful handoff. |
/usr/bin/bqueue, /usr/bin/_bqueue |
Show readable or raw queued envelopes. |
/usr/bin/bsmtp, /usr/bin/rsmtp, /usr/sbin/rsmtp |
Receive a plain BSMTP batch through the local MTA. |
/usr/bin/rcsmtp, rgsmtp, cbsmtp, crsmtp |
Receive a compressed batch. |
/usr/sbin/transmitter.METHOD HOST |
Send a batch to uux, with optional compression. |
Note: /usr/sbin/bsmtp queues messages, while /usr/bin/bsmtp receives them. Use the full path if this distinction matters. The shared executable can also be called directly: bsmtp-go enqueue, bsmtp-go receive, bsmtp-go batcher, etc.
Transport methods: n-rsmtp sends plain data to HOST!rsmtp; g-rcsmtp and g-rgsmtp send gzip data to the corresponding remote command; c-rcsmtp and c-cbsmtp use Unix .Z compression. The remote UUCP system must allow the selected command. Enqueue preserves message bytes and appends .\n; callers must provide a final newline and SMTP dot-stuffing (the supplied sendmail mailer definition uses the historical X flag).
Install the generated binary package with sudo apt install ./dist/bsmtp_<version>_amd64.deb. The package installs /etc/bsmtp/bsmtp.json as a conffile, the sendmail mailer definition under /usr/share/sendmail/mailer/, and a /var/spool/bsmtp queue owned by uucp with mode 0770. Depending on the transport, uucp, a sendmail-compatible MTA, and ncompress are needed. There is no setuid binary; root enqueue calls drop privileges to the configured queue user.
Configuration keys are spool, queue_user, sendmail, uux, compress, uncompress, transmitter_dir, and hostname; see packaging/bsmtp.json. An empty hostname uses the OS hostname, adding .UUCP if it has no dot. BSMTP_CONFIG=/absolute/path.json selects an alternate configuration. Queue files are locked during transmission and truncated only after the transmitter succeeds; acceptance into the local UUCP queue does not guarantee remote delivery. Retries after failures can duplicate messages.
Requirements: Go 1.27.x, GNU make, Python 3, dpkg-deb, and dpkg-source. No external Go modules or root privileges are required. On an amd64 Linux host:
make test # Go race tests and go vet
make deb # binary Debian package in dist/
python3 tests/package_smoke.py
make source # Debian source package (.dsc and two .tar.xz files)The package version is in VERSION and debian/changelog. Update both for a release, then tag it v<version> (for example v2.0.0-1). The GitHub Actions workflow checks the tag against the version, tests and builds on pushes and pull requests, uploads the binary and source packages as workflow artifacts, and attaches them to the GitHub release for version tags. Source packages contain the Go sources, tests, configuration and packaging scripts; generated binaries, the historical .deb, unpacked original executables, and conversion-analysis artifacts are excluded.
Compared with the original 1.02 package, this port repairs broken absolute symlinks, provides configurable executable paths, rejects unsafe queue paths and envelope arguments, validates gzip input before delivery, and streams large messages. The included smoke test exercises the installed command links with local MTA and UUCP fixtures rather than live mail delivery.