Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

41.2. cyrus-sasl-2.1.28

SASL authentication library — the mechanism loader mbsync authenticates through

Version 2.1.28, release 1
Shelf auth — Authentication, authorisation, accounts and directory services
Phase 30_foundation (Build Foundation), 81 of 127 in build order
Licence BSD-Attribution-HPND-disclaimer
Homepage https://www.cyrusimap.org/sasl/
Build time 0.3 SBU
Installed size 502.8 KiB in 69 files
Recipe ports/core/auth/cyrus-sasl/kpkgbuild

About

Cyrus SASL is the library a client program uses to authenticate to a server with SASL, the negotiation IMAP, SMTP, LDAP and VNC share. The library itself, libsasl2, knows no mechanism: it loads each one as a plugin from /usr/lib/sasl2, and the program asks it for whichever the server offers.

KDOS builds it as a mechanism loader for the client side. What it is here for is mail: mbsync from isync authenticates through it, and the XOAUTH2 mechanism a provider with no application passwords requires comes from the separate plugin cyrus-sasl-xoauth2, which installs into the same plugin directory. What that pair can and cannot sign in to is in mbsync has XOAUTH2 but not OAUTHBEARER. openldap, qemu’s VNC server, libvirt and spice link it as well. The build has no saslauthd client, no sasldb password store, no PAM check and no sample programs.

Why it is in KDOS

The comment above it in script/phases/30_foundation/packages.txt:

WHAT mbsync AUTHENTICATES THROUGH, with cyrus-sasl-xoauth2 in 41_system: the library ships no XOAUTH2 of its own. cyrus-sasl is the mechanism LOADER — client side only, with no saslauthd and no password store; the plugin is the mechanism a provider that has withdrawn application passwords requires. Without both, an account on such a provider can be read in aerc and sent through msmtp and cannot be mirrored into a local Maildir at all.

Sources

Dependencies

Depends on: openssl.

Required by (19): cyrus-sasl-xoauth2, gtk-vnc, isync, kdepim-runtime, kimap, kldap, ksmtp, libetpan, libkgapi, libksieve, libvirt, libvncserver, openldap, qca, qca-qt5, qemu, spice, spice-gtk, wlvncc.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/30_foundation/phase.env && kpkg install cyrus-sasl'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/auth/cyrus-sasl.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/auth/cyrus-sasl
echo '7ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c  cyrus-sasl-2.1.28.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/cyrus-sasl
SRC=$SRC_ROOT/cyrus-sasl-2.1.28
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf cyrus-sasl-2.1.28.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

export CFLAGS="$CFLAGS -std=gnu17 -include time.h"

./configure \
	--prefix=/usr \
	--sysconfdir=/etc \
	--with-plugindir=/usr/lib/sasl2 \
	--with-openssl \
	--with-dblib=none \
	--without-pam \
	--without-saslauthd \
	--without-authdaemond \
	--disable-sample \
	--disable-gssapi \
	--disable-krb4 \
	--disable-otp \
	--disable-srp \
	--disable-ntlm \
	--disable-digest \
	--disable-cram \
	--disable-sql \
	--disable-ldapdb \
	--enable-plain \
	--enable-login \
	--enable-scram \
	--enable-shared \
	--disable-static

make -j1
make DESTDIR=$PKG install
install -Dm644 utils/pluginviewer.8 -t "$PKG/usr/share/man/man8"

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/cyrus-sasl, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf cyrus-sasl-2.1.28-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/cyrus-sasl, and runs the triggers its paths call for.

Contents

Installed programs: pluginviewer.

Installed libraries: libsasl2.so.

Installed directories: /usr/include/sasl, /usr/share/licenses/cyrus-sasl.

Short descriptions

pluginviewer list loadable SASL plugins and their properties
libsasl2.pc Cyrus SASL implementation

Notes

With --with-dblib=none, upstream’s utils/Makefile.am installs no manual pages at all, not even the one for pluginviewer, which is built regardless. build.sh installs pluginviewer.8 itself; pluginviewer -c lists the client mechanisms the library can load, which is the quickest way to see whether the XOAUTH2 plugin is in place.

The ANONYMOUS mechanism, libanonymous.so, is installed too: upstream builds it by default, and build.sh does not pass --disable-anon.