Dave Stone's former veterinarian won't release records ... oh, wrong kind
of missing cat data. Anyhow,
| ... the last echo
| line is the last thing appearing in the autoack response. No errors
| show up in the log file. Any suggestions?
|
| :0c
| * ^Subject:\/.*
| | ($FORMAIL -rt -I "Subject: Autoreply (was $MATCH)" \
| -A "X-Loop: $LOGNAME" \
| -I "Precedence: junk" \
| -A "X-Comment: Auto-acknowledgement" ; \
| cat $PMDIR/autoack.txt ; \
| echo " " ; \
| echo "------Original Message Follows------" ; \
| echo " "; \
| cat - ) | $SENDMAIL -oi -t
formail is eating up the stdin, leaving none for the second cat.
First, if the three lines to be inserted below $PMDIR/autoack.txt are always
the same, just append them to the $PMDIR/autoack.txt file instead of adding
three echo commands (and I'd suggest empty lines instead of the two lone
spaces). Second, I never understood the logic of assigning variables to the
names of programs instead of just setting PATH. Third, what Philip has al-
ready posted about handling subjectless mail was exactly what I was going
to say, and I think it should be included.
Here we go:
MATCH
:0c # ,,acknowledgement'' is Canadian spelling
* ! ^FROM_DAEMON
* $ ! ^X-Loop: $LOGNAME
* other conditions if any
* 1^0 ^Subject:\/.*
* 1^0
| formail -rkbt -I "Subject: Autoreply${MATCH+ (was $MATCH)}" \
-A "X-Loop: $LOGNAME" \
-I "Precedence: junk" \
-A "X-Comment: Auto-acknowledgement" | \
sed -e '1,/^$/ !b' -e "/^$/r $PMDIR/autoack.txt" | \
$SENDMAIL -oi -t