#!/bin/sh
#
# hdrs.sh -- rip out email addresses from list postings
# and construct a reply-to that includes querant,
# list, and everybody else in to, from, and cc who isn't
# a list subscriber.
#
# Create a /var/lib/mailman/tmp/ directory with write
# permissions to the list user.
#
# Copyright 2001 Specialized Systems Consultants.  All
# rights reserved.  No warranties are made.  You
# are licensed to use this software under the terms or
# the GNU General Public License.
#
# Sun Nov 18 22:48:21 PST 2001 dhw

(
TMP=/var/lib/mailman/tmp/hdrs$$

# Message to tmpfile
cat >$TMP

# Mailman needs that "From " header
grep '^From ' $TMP | head -1

# Rebuild message headers to standard out
/usr/lib/mailman/localbin/hdrs.py <$TMP

# Message body, less old linux-questions-only boilerplate,
# to standard out
sed '1,/^[      ]*$/d
/^>>* +-+/d
' $TMP

rm -f $TMP
) | /usr/lib/mailman/mail/wrapper post linux-questions-only

