# HG changeset patch # User jwe # Date 782702473 0 # Node ID f080467776945572b7fbf5261ebf395ee2441132 # Parent 28f9d2470e727e7965f66a7d93f62318f163caf6 [project @ 1994-10-21 01:21:13 by jwe] diff --git a/octave-bug.in b/octave-bug.in --- a/octave-bug.in +++ b/octave-bug.in @@ -73,7 +73,7 @@ cat > $TEMP << EOF To: $BUGADDR Subject: $SUBJECT - +-------- Bug report for Octave $VERSION configured for $MACHINE Description: @@ -144,6 +144,33 @@ echo "file not changed -- no bug report submitted" status=1 else + +# Try to extract the recipient address, in case the To: line in the +# message template has been changed. + + TMP_BUGADDR=`sed -e '/^--------[ \t]*$/q' $TEMP | sed -n -e 's/^To://p'` + if test -z "$TMP_BUGADDR" + then + echo "no valid \`To:' field found in header -- using $BUGADDR instead" + else + BUGADDR="$TMP_BUGADDR" + fi + +# Delete the `--------' separator in the message. + + awk 'BEGIN{ in_header = 1; } \ + /^--------[ \t]*$/ { + if (in_header) { + in_header = 0; + print ""; + next; + } + } { + print $0; + }' $TEMP > $TEMP.msg + +# Now try to mail it. + rmail $BUGADDR < $TEMP > /dev/null 2>&1 || \ mailx -s "$SUBJECT" $BUGADDR < $TEMP > /dev/null 2>&1 || \ Mail -s "$SUBJECT" $BUGADDR < $TEMP > /dev/null 2>&1 || \