huhu/bin/read-mail-wrapper.sh
Thomas Hochstein 8db4fa83e0 Add wrapper script for read-mail.pl
Drop procmail, use Exim filter as .forward.

Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-01-31 23:37:03 +01:00

17 lines
456 B
Bash
Executable file

#!/bin/sh
#
# This script is a wrapper for read-mail.pl to set up the environment.
#
# Usage: ${HUHU_DIR}/bin/read-mail-wrapper.sh de.alt.test.moderated
export "LANG=C"
export "LC_CTYPE=C"
set -o nounset
set -o errexit
export HUHU_DIR="/home/huhu"
export PERL5LIB="${PERL5LIB:+$PERL5LIB:}${HUHU_DIR}"
USER_DIR=$( echo "$1" | sed 's#[-.]#/#g' )
CONFIG="/home/${USER_DIR}/etc/public.conf"
cat - | "${HUHU_DIR}/bin/read-mail.pl" "-config=${CONFIG}" -stdin