imapctl

Crates.ioimapctl
lib.rsimapctl
version0.1.0
created_at2025-12-01 17:50:10.433312+00
updated_at2025-12-01 17:50:10.433312+00
descriptionScriptable IMAP client for the shell
homepage
repositoryhttps://app.radicle.xyz/nodes/seed.radicle.garden/rad:zjy7BiSYaEFtM9ohHwSfJGbyPQKp
max_upload_size
id1960187
size123,044
(koenw)

documentation

README

imapctl

Scriptable IMAP client for the shell.

Where it makes sense, commands read their input from stdin making it possible to compose commands with pipes.

Installation

Nix flakes

Nix can take care of the toolchains for you ;)

nix run git+https://seed.radicle.garden/zjy7BiSYaEFtM9ohHwSfJGbyPQKp.git
# and building ofc
nix build git+https://seed.radicle.garden/zjy7BiSYaEFtM9ohHwSfJGbyPQKp.git

Docker

nix build '#docker'
docker load < result

# To run:
docker run -ti imapctl

Usage

Use imapctl --help for more help.

Examples

Authenticate using environmental variables

export IMAPCTL_HOST=imap.example.com
export IMAPCTL_USERNAME=you@example.com
export IMAPCTL_PASSWD_CMD="pass show hosts/imap.example.com/you@example.com"

The other examples will assume these environmental variables to be set. Alternatively, you can pass the --host, --username and --passwd-cmd parameters.

List ID's for all messages in the INBOX mailbox

imapctl search all

List ID's for all messages in the bla mailbox

imapctl search --mailbox bla all

List From and Subject for all message in the bla mailbox

imapctl search --mailbox bla all |imapctl fetch

List Date, From and Subject for the INBOX

imapctl search all |imapctl fetch --format '{{date}} - {{from}} {{ subject }}'

Copy/Sync messages from one mailbox (INBOX) to another (bla)

for msg in $(imapctl search all); do
    (imapctl fetch $msg --format '{{body}}' |imapctl append --mailbox bla)
done
Commit count: 0

cargo fmt