#!/bin/sh set -eu if find /tmp/dovecot-hack -mmin -1 | grep -q /; then exit 1 fi # HACK because vnd.dovecot.filter needs the filter to soak up all input before # it will even start reading its output. TMPFILE=$(tempfile -p spamc) cleanup() { rm -f $TMPFILE; trap - EXIT; } trap cleanup EXIT cat > "$TMPFILE" spamc "$@" < "$TMPFILE" cleanup