Article View: concordia.test
Article #1237Re: How do I FollowUp and Reply via e-mail simultaneously using strn ?
From: NV
Date: Tue, 27 Jan 1998 00:00
Date: Tue, 27 Jan 1998 00:00
354 lines
8197 bytes
8197 bytes
Hi Anne,
Thank you again for your persistance.
>Anne Bennett <anne@alcor.concordia.ca> writes:
>NV, in your copy of Pnews, search down to the string "yes)", then go
>down a bit to "case "$mailer" in", and in particular the case "*)",
>which is the one that will be triggered if you have a cc line. Right
>before the line "$sed "$headerstrip" $tmpart | $mailer $@", put in a
>line "echo Mailing to cc list: $@"; that way, you should be able to
>see the attempt, at least, and if you don't you'll know that your "cc"
>line was not even detected. (Are you sure there's a space between
>"cc:" and the address?)
OK, I think we have a problem here. The second search string appears
only once, and that is ABOVE the first search string. I am using a
Pnews that you pointed me to earlier this (academic) year. It contains
comments saying that it has been heavily modified by you. To save
further misunderstandings, I'll append it to the bottom of this message.
Any mods I've made should be commented with my name.
(NV thunks himself on the head. I should know better and give you more
detailed info. I keep forgetting that admins aren't omniscient)
NV (file follows)
#!/bin/sh
# Heavily modified Pnews
#
# Anne Bennett 91/10/18: removed the code saying "Are you sure?"
#
# syntax: Pnews -h headerfile or
# Pnews -h headerfile oldarticle or
# Pnews newsgroup title or just
# Pnews
# System dependencies
mailer="/usr/lib/sendmail"
# if you change this to something that does signatures, take out signature code
# Anne Bennett 91/10/18 replaced lots of code with a hard-coded site name def
sitename="alcor.concordia.ca"
# where recordings, distributions and moderators are kept
lib="/usr/local/lib/rn"
# where important rn things are kept
rnlib="/usr/local/lib/rn"
# your organization name
# Nick Varacalli 97/20/09 Personalized orgname
orgname="None."
# what pager you use--if you have kernal paging use cat
pager="${PAGER-/usr/ucb/more}"
# how you derive full names, bsd, usg, or other
nametype="bsd"
# default editor
# Nick Varacalli 97/20/09 Changed editor from vi to vim
defeditor="/usr/ucb/vim"
# how not to echo with newline
n="-n"
c=""
# The following are some prototypical distribution groups. If you do not
# use them all set the unused ones to a non-null string such as 'none'.
loc="local"
city="mtl"
state="qc"
cntry="can"
cont="na"
test=/bin/test
sed=/bin/sed
echo=/bin/echo
cat=/bin/cat
egrep=/bin/egrep
grep=/bin/grep
rm=/bin/rm
tr=/bin/tr
inews=/local/paths/inews
nidump=
ypmatch=
dotdir=${DOTDIR-${HOME-$LOGDIR}}
tmpart=$dotdir/.article
# Anne Bennett 91/10/18: removed all code which checks "expertise"
# ==== PARSE ARGS TO GET HEARDEFILE, ETC.
headerfile=""
case $# in
0) ;;
*) case $1 in
-h)
headerfile="$2"
shift
shift
case $# in
0)
oldart=""
;;
*)
oldart="$1"
shift
;;
esac
;;
esac
;;
esac
# ==== GRAB HEADER AND, IF APPLICABLE, QUOTED TEXT.
case $headerfile in
'')
. $rnlib/Pnews.header
;;
*)
$cat < $headerfile > $tmpart
;;
esac
# ==== ADD SIGNATURE
# Anne Bennett 93/01/07: add signature now
# note changed named of sig file to avoid inews interference
# Nick Varaclli 97/20/09: prefers not to add sig now
cat $dotdir/.mysignature >> $tmpart
# ==== WHAT TO DO IN CASE OF CONTROL-C
rescue="sleep 1; $cat $tmpart >>${HOME-$LOGDIR}/dead.article ; $echo Article appended to ${HOME-$LOGDIR}/dead.article ; exit"
trap "$rescue" 1
trap "$rescue" 2
# ==== RECORDINGS WITH RESPECT TO CERTAIN NEWSGROUPS
$echo ""
#: play recorded message
set X `$sed < $tmpart -n -e '/^Newsgroups: /{' -e p -e q -e '}'`
shift
case $# in
0|1)
;;
*)
shift
if $test -s ${lib}/recording ; then
ng=`$echo $1 | $sed "s/,.*//"`
_rec1=${lib}/`$sed -n "/^$ng/s/^.* //p" ${lib}/recording`
_tmp=`$echo $ng |$sed "s/\..*//"`
_rec2=${lib}/`$cat -s ${lib}/recording|$grep ${_tmp}.all|$sed "s/^.* //"`
if $test -f ${_rec1} ; then
$cat -s ${_rec1}
fi
if $test -f ${_rec2} ; then
$cat -s ${_rec2}
fi
fi
;;
esac
set X `$sed < $tmpart -n -e '/^Distribution: /{' -e p -e q -e '}' -e '/^$/q'`
shift
case $# in
0|1)
set X `$sed < $tmpart -n -e '/^Newsgroups: /{' -e p -e q -e '}'`
shift
case $# in
0|1)
set "x misc.whatever"
;;
esac
;;
*)
set $1 $2.whatever
;;
esac
shift
#: play recorded message
#if $test -s ${lib}/recording ; then
# ng=`$echo $1 | $sed "s/,.*//"`
# _rec1=${lib}/`$sed -n "/^$ng/s/^.* //p" ${lib}/recording`
# _tmp=`$echo $ng |$sed "s/\..*//"`
# _rec2=${lib}/`$cat -s ${lib}/recording|$grep ${_tmp}.all|$sed "s/^.* //"`
# if $test -f ${_rec1} ; then
# $cat -s ${_rec1}
# fi
# if $test -f ${_rec2} ; then
# $cat -s ${_rec2}
# fi
#fi
# ==== EDIT THE MESSAGE
state=edit
file=h
$echo ""
while true ; do
case $state in
edit)
case "${VISUAL-${EDITOR-}}" in
'')
tmp=h
;;
*)
tmp=''
;;
esac
while $test "$tmp" = h ; do
$echo $n "Editor [${VISUAL-${EDITOR-$defeditor}}]: $c"
read tmp
case $tmp in
'')
;;
*)
VISUAL=$tmp
export VISUAL
;;
esac
done
trap : 2
${VISUAL-${EDITOR-$defeditor}} $tmpart $oldart
trap "$rescue" 2
state=ask
;;
ask)
$echo ""
$echo $n "Send, quit, edit, or list? $c"
read ans
case "$ans" in
a*)
state=rescue
;;
q*)
state=rescue
;;
e*)
set $ans
case $# in
2) VISUAL="$2" ;;
esac
state=edit
;;
l*)
$pager $tmpart
state=ask
;;
s*)
state=send
;;
esac
;;
send)
set X `$sed < $tmpart -n -e '/^Newsgroups: /{' -e p -e q -e '}'`
shift
case $# in
2)
state=cleanup
if $test -f $lib/moderators; then
tryinews=no
shift
case "$1" in
*,*) set `$echo $1 | tr ',' ' '`;;
esac
for newsgroup in $*; do
# the following screwy sed should prevent Eunice from hanging on no match
moderator=`$sed <$lib/moderators \
-e "/^$newsgroup[ ]/!s/.*//" \
-e "s/^$newsgroup[ ]//"`
case ${moderator}X in
X) tryinews=yes
;;
*)
$echo Mailing to moderator $moderator
case "$mailer" in
*recmail)
$echo To: $moderator | $cat - $tmpart | $mailer
;;
*)
$mailer $moderator < $tmpart
;;
esac
case $? in
0) ;;
*)
$echo Unable to mail to moderator $moderator
state=rescue
;;
esac
;;
esac
done
else
tryinews=yes
fi
case "$tryinews" in
yes)
if $sed '1,/^[ ]*$/{/^[A-Z][-A-Za-z0-9]*:[ ]*$/d;}' $tmpart |
$inews -h ; then
: null
else
state=rescue
fi
;;
esac
;;
*)
$echo ""
$echo "Malformed Newsgroups line."
$echo ""
sleep 1
state=edit
;;
esac
;;
rescue)
$cat $tmpart >> ${HOME-$LOGDIR}/dead.article
$echo "Article appended to ${HOME-$LOGDIR}/dead.article"
$echo "A copy may be temporarily found in $tmpart"
exit
;;
cleanup)
case "${AUTHORCOPY-none}" in
none)
;;
*) if $echo From $USER `date` >> $AUTHORCOPY; then
$cat $tmpart >> $AUTHORCOPY
$echo "Article appended to $AUTHORCOPY"
$echo "" >> $AUTHORCOPY
$echo "" >> $AUTHORCOPY
else
$echo "Cannot append to $AUTHORCOPY"
fi
;;
esac
exit
;;
esac
done
Technical Details
Message-ID:
<6ajjoc$vtn$1@newsflash.concordia.ca>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<69c1vt$cfg$1@newsflash.concordia.ca> <6aii2e$e3c$1@newsflash.concordia.ca> <6aiife$fjj$1@newsflash.concordia.ca> <6aij0h$l9s$1@newsflash.concordia.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f5cd,a46748e9e9347cb8 X-Google-Attributes: gid10f5cd,public From: n_varaca@alcor.concordia.ca (NV) Subject: Re: How do I FollowUp and Reply via e-mail simultaneously using strn ? Date: 1998/01/27 Message-ID: <6ajjoc$vtn$1@newsflash.concordia.ca> X-Deja-AN: 319552686 References: <69c1vt$cfg$1@newsflash.concordia.ca> <6aii2e$e3c$1@newsflash.concordia.ca> <6aiife$fjj$1@newsflash.concordia.ca> <6aij0h$l9s$1@newsflash.concordia.ca> Organization: None. NNTP-Posting-User: n_varaca Newsgroups: concordia.test