tttm

git clone https://orangeshoelaces.net/git/tttm.git

Readme

tttm - mail retrieval agent.

Fetches mail from IMAP4rev1 inbox and delivers each message via
standard input to anohter program. Transfered mail gets expunged
from server afterwards.

See manual for details.

Works on OpenBSD. Likely to behave just as fine on other BSDs,
Linuxes and other POSIX-friendly operating systems.

Needs a decent C compiler (uses some of C11 feats) with standard
library.