-#!/bin/sh
+#!/bin/bash
+
+set -e
+set -o pipefail
TMPFILE=$TMP/reply.$$
(
formail -rt -I "Reply-To: $NOACK" \
-I "X-Webstump-Event: ack" \
- -I 'Bcc: %OURUSER%+%ABBREV%-internal-log+mailout' \
+ $MAILOUT_RECVACK_FORMAIL_ARGS \
< $TMPFILE
cat <<_EOB_
Hello,
-This is an automatic acknowledgement that your message has been RECEIVED
+This is an automatic acknowledgement that your message has been received
by the robomoderation program for newsgroup $NEWSGROUP.
This message has been queued and will be reviewed by the moderators
about your article has been made.
If you do not want to receive automatic acknowledgments in the future,
-simply reply to this message, QUOTING ITS TEXT IN FULL.
+simply reply to this message, quoting its text in full.
For details of the moderation arrangements see
%GROUPURL%
_EOB_
- sed 's/^/> /; s/%OURUSER%+[-+/0-9a-z]*@%DOMAIN%/%OURUSER%+?@%DOMAIN%/' \
+ sanitise_and_quote_email \
< $TMPFILE
+
) | sendmail -t -f $MUNGED_ADDRESS
rm $TMPFILE