#!/bin/sh # script for easier injection of messages into the NM db # (please set pipe_split; unset pipe_decode in mutt) TMP=`mktemp -t nm.XXXXXX` cat > $TMP if [ "$1" ] ; then TAG=`echo "$1" | sed -e 's/@/=/'` else TAG=`perl -lne 'if (/^Subject: .*?([\w.-]+\@[\w.-]+)/i) { $a = $1; $a =~ s/@/=/; print $a; exit 0; }' < $TMP` fi if [ "$TAG" ] ; then < $TMP formail -I"Delivered-To:" | /usr/sbin/sendmail nm-"$TAG"@nm.debian.org else echo "No tag found" 1>&2 EXIT=1 fi rm -f $TMP exit $EXIT