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

110.2. isync-1.5.1

mbsync — synchronises IMAP mailboxes with a local Maildir, XOAUTH2 included

Version 1.5.1, release 3
Shelf mail — Email clients, fetch and send tools, mail libraries, and feed readers
Phase 41_system (System), 731 of 1047 in build order
Licence GPL-2.0-or-later WITH LicenseRef-isync-GPL-exception
Homepage https://isync.sourceforge.io/
Build time 0.2 SBU
Installed size 366.5 KiB in 12 files
Recipe ports/core/mail/isync/kpkgbuild

About

isync is mbsync, which makes an IMAP mailbox and a local Maildir, ~/Mail, equal in both directions. It moves messages and does nothing else: notmuch indexes what it fetches, and msmtp sends. notmuch new runs it from the pre-new hook in /etc/skel/.config/notmuch/default/hooks and then indexes what it left, so one command fetches and files. The templates in /etc/skel, .mbsyncrc and notmuch’s config, name the same Maildir root, ~/Mail.

Why it is in KDOS

The comment above it in script/phases/41_system/packages.d/mail.txt:

THE WRITER notmuch indexes after. mbsync makes an IMAP mailbox and ~/Mail equal in both directions and indexes nothing, which is why notmuch new runs it from a pre-new hook and then indexes what it left: one command fetches and files, and nothing has to remember the order. XOAUTH2 is reached through cyrus-sasl and cyrus-sasl-xoauth2; OAUTHBEARER is not, and is aerc's.

Sources

Dependencies

Depends on: openssl, zlib, pkgconf, perl, cyrus-sasl, cyrus-sasl-xoauth2.

Required by: no port names it.

Patches

build.sh applies these; kpkg applies nothing by itself.

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/41_system/phase.env && kpkg install isync'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/mail/isync.

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/mail/isync
echo '28cc90288036aa5b6f5307bfc7178a397799003b96f7fd6e4bd2478265bb22fa  isync-1.5.1.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/isync
SRC=$SRC_ROOT/isync-1.5.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf isync-1.5.1.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:

patch -p1 -i "$PORT_SRC/openssl4.patch"

./configure ac_cv_berkdb4=no \
	--prefix=/usr \
	--sysconfdir=/etc \
	--with-ssl \
	--with-zlib \
	--with-sasl
make
make DESTDIR=$PKG install

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/isync, 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 isync-1.5.1-3.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/isync, and runs the triggers its paths call for.

Contents

Installed programs: mbsync, mbsync-get-cert.

Installed directories: /usr/share/doc/isync, /usr/share/licenses/isync.

Short descriptions

mbsync synchronize IMAP4 and Maildir mailboxes

Notes

perl is a build dependency, not a convenience: configure stops with “perl not found” without it, and src/drv_proxy_gen.pl generates drv_proxy.inc at build time, which the release does not carry.