NeoMutt uses a key/value store, e.g. lmdb, as a cache for email headers.
This repo contains some test tools to work with these stores.
Dump the contents of an LMDB store.
build:
gcc lmdb-dump.c -o lmdb-dump -llmdb
run:
./lmdb-dump store-file
output:
Opening store-file
key: /home/flatcap/mail/1679930513.M731552P185191.flatcap.org,S=5071,W=5169
data length: 999
key: /home/flatcap/mail/1679932108.M761797P185751.flatcap.org,S=5055,W=5153
data length: 1008
...
54569 records
Cull a percentage of the contents of an LMDB store.
build:
gcc lmdb-cull.c -o lmdb-cull -llmdb
run:
# Delete a random 30% of the records
./lmdb-cull store-file 30
output:
Opening store-file
Culling 30%
54569 records
16321 culled