#!@zsh@/bin/zsh

NOTMUCH_TCP=${NOTMUCH_TCP:-2010}
HOST=${HOST:-$(@nettools@/bin/hostname -s)}
NOTMUCH_HOST=${NOTMUCH_HOST:-odin.asgard.yggdrasil}

cd ~/.notmuch-tcp

@socat@/bin/socat STDIO,ignoreeof openssl:${NOTMUCH_HOST}:${NOTMUCH_TCP},verify=1,cafile=ca.pem,certificate=${HOST}.pem,key=${HOST}.key <<(print "${(@q)@}"; inp=$(cat 2>&- || echo ""); printf "%d\n" $(@coreutils@/bin/wc -c <<<"${inp}"); @coreutils@/bin/cat <<<"${inp}")