System: rn version 4.3 Patch #: 25 Priority: MEDIUM Subject: various Pnews and Rnmail upgrades. >From: lots of people Description: Several things: 1) Pnews wouldn't add .signature on moderated articles. You now get asked if you want to do it. 2) There was no way to specify an alternate editor from within Pnews or Rnmail. You may now say "e editor" to switch editors. 3) There was no way to save a permanent copy of the article or message. There is now support for AUTHORCOPY/MAILRECORD environment variables to do this. 4) When the disk gets full, inews can lie about the success of the posting, and up to now Pnews would happily delete the temporary file thinking all was well. The temporary file is now kept around in your DOTDIR until the next invocation of Pnews/Rnmail. Repeat-By: Fix: From rn, say "| patch -d DIR", where DIR is your rn source directory. Outside of rn, say "cd DIR; patch Patch #: 25 Index: Pnews.1 Prereq: 4.3 *** Pnews.1.old Thu Aug 1 14:25:25 1985 --- Pnews.1 Thu Aug 1 14:25:27 1985 *************** *** 1,4 ! ''' $Header: Pnews.1,v 4.3 85/05/01 11:33:50 lwall Exp $ ''' ''' $Log: Pnews.1,v $ ''' Revision 4.3 85/05/01 11:33:50 lwall --- 1,4 ----- ! ''' $Header: Pnews.1,v 4.3.1.2 85/08/01 14:22:48 lwall Exp $ ''' ''' $Log: Pnews.1,v $ ''' Revision 4.3.1.2 85/08/01 14:22:48 lwall *************** *** 1,6 ''' $Header: Pnews.1,v 4.3 85/05/01 11:33:50 lwall Exp $ ''' ''' $Log: Pnews.1,v $ ''' Revision 4.3 85/05/01 11:33:50 lwall ''' Baseline for release with 4.3bsd. ''' --- 1,12 ----- ''' $Header: Pnews.1,v 4.3.1.2 85/08/01 14:22:48 lwall Exp $ ''' ''' $Log: Pnews.1,v $ + ''' Revision 4.3.1.2 85/08/01 14:22:48 lwall + ''' Added AUTHORCOPY. + ''' + ''' Revision 4.3.1.1 85/05/10 11:30:30 lwall + ''' Branch for patches. + ''' ''' Revision 4.3 85/05/01 11:33:50 lwall ''' Baseline for release with 4.3bsd. ''' *************** *** 69,74 .I rn passes to Pnews. .SH ENVIRONMENT .IP DOTDIR 8 Where to find your dot files, if they aren't in your home directory. .Sp --- 75,85 ----- .I rn passes to Pnews. .SH ENVIRONMENT + .IP AUTHORCOPY 8 + If defined, contains the name of a file to which the finished article will + be appended. + .Sp + Default: article not saved .IP DOTDIR 8 Where to find your dot files, if they aren't in your home directory. This is primarily for accounts which are shared by more than one person. *************** *** 71,76 .SH ENVIRONMENT .IP DOTDIR 8 Where to find your dot files, if they aren't in your home directory. .Sp Default: $HOME .IP EDITOR 8 --- 82,88 ----- Default: article not saved .IP DOTDIR 8 Where to find your dot files, if they aren't in your home directory. + This is primarily for accounts which are shared by more than one person. .Sp Default: $HOME .IP EDITOR 8 *************** *** 105,111 .Sp Default: $EDITOR .SH FILES ! /tmp/article$$ .br ~/dead.article .SH SEE ALSO --- 117,123 ----- .Sp Default: $EDITOR .SH FILES ! $DOTDIR/.article .br ~/dead.article .SH SEE ALSO Index: Pnews.SH Prereq: 4.3.1.2 *** Pnews.SH.old Thu Aug 1 14:26:09 1985 --- Pnews.SH Thu Aug 1 14:26:13 1985 *************** *** 4,10 echo "Extracting Pnews (with variable substitutions)" $spitshell >Pnews <Pnews <>Pnews <<'!NO!SUBS!' ! if $test -f ${DOTDIR-${HOME-$LOGDIR}}/.pnewsexpert; then expertise=expert else $cat <<'EOM' --- 86,95 ----- !GROK!THIS! $spitshell >>Pnews <<'!NO!SUBS!' ! dotdir=${DOTDIR-${HOME-$LOGDIR}} ! tmpart=$dotdir/.article ! ! if $test -f $dotdir/.pnewsexpert; then expertise=expert else $cat <<'EOM' *************** *** 107,114 *) stpr=State ;; esac - tmpart=/tmp/article$$ - headerfile="" case $# in 0) ;; --- 113,118 ----- *) stpr=State ;; esac headerfile="" case $# in 0) ;; *************** *** 139,145 $cat < $headerfile > $tmpart ;; esac ! rescue="sleep 1; $cat $tmpart >>${HOME-$LOGDIR}/dead.article ; $echo saved in ${HOME-$LOGDIR}/dead.article ; $rm -f $tmpart; exit" trap "$rescue" 1 trap "$rescue" 2 --- 143,149 ----- $cat < $headerfile > $tmpart ;; esac ! rescue="sleep 1; $cat $tmpart >>${HOME-$LOGDIR}/dead.article ; $echo Article appended to ${HOME-$LOGDIR}/dead.article ; exit" trap "$rescue" 1 trap "$rescue" 2 *************** *** 256,262 edit) case $expertise in beginner) ! $cat ${DOTDIR-${HOME-$LOGDIR}}/.pnewsexpert $cat <<'EOMessage' A temporary file has been created for you to edit. Be sure to leave at least one blank line between the header and the body of your message. --- 260,266 ----- edit) case $expertise in beginner) ! $cat $dotdir/.pnewsexpert $cat <<'EOMessage' A temporary file has been created for you to edit. Be sure to leave at least one blank line between the header and the body of your message. *************** *** 313,319 $echo $n "Send, abort, edit, or list? $c" read ans ! case $ans in a*) state=rescue ;; --- 317,323 ----- $echo $n "Send, abort, edit, or list? $c" read ans ! case "$ans" in a*) state=rescue ;; *************** *** 318,323 state=rescue ;; e*) state=edit ;; l*) --- 322,331 ----- state=rescue ;; e*) + set $ans + case $# in + 2) VISUAL="$2" ;; + esac state=edit ;; l*) *************** *** 332,337 Type s to send the article, a to abort and append the article to dead.article, e to edit the article again, or l to list the article. EOH esac ;; --- 340,347 ----- Type s to send the article, a to abort and append the article to dead.article, e to edit the article again, or l to list the article. + + To invoke an alternate editor, type 'e editor'. EOH esac ;; *************** *** 358,363 ;; *) $echo Mailing to moderator $moderator case "$mailer" in *recmail) $echo To: $moderator | $cat - $tmpart | $mailer --- 368,389 ----- ;; *) $echo Mailing to moderator $moderator + case "$sign" in + n*) ;; + *) + if $test -f $dotdir/.signature; then + echo $n "Append .signature file? [y] $c" + read ans + case $ans in + ''|y*) + echo "-- " >> $tmpart + cat $dotdir/.signature >> $tmpart + ;; + esac + fi + sign=no + ;; + esac case "$mailer" in *recmail) $echo To: $moderator | $cat - $tmpart | $mailer *************** *** 400,407 ;; rescue) $cat $tmpart >> ${HOME-$LOGDIR}/dead.article ! $echo "Article saved to ${HOME-$LOGDIR}/dead.article" ! state=cleanup ;; cleanup) $rm -f $tmpart --- 426,434 ----- ;; 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 *************** *** 404,410 state=cleanup ;; cleanup) ! $rm -f $tmpart exit ;; esac --- 431,448 ----- exit ;; cleanup) ! case "${AUTHORCOPY-none}" in ! none) ! ;; ! *) if $cat $tmpart >> $AUTHORCOPY; then ! $echo "Article appended to $AUTHORCOPY" ! $echo "" >> $AUTHORCOPY ! $echo "" >> $AUTHORCOPY ! else ! $echo "Cannot append to $AUTHORCOPY" ! fi ! ;; ! esac exit ;; esac *************** *** 571,577 fullname=`$sed Rnmail <Rnmail <>Rnmail <<'!NO!SUBS!' - tmpart=/tmp/rnmail$$ dotdir=${DOTDIR-${HOME-$LOGDIR}} headerfile="" --- 60,65 ----- !GROK!THIS! $spitshell >>Rnmail <<'!NO!SUBS!' dotdir=${DOTDIR-${HOME-$LOGDIR}} tmpart=$dotdir/.letter *************** *** 59,64 $spitshell >>Rnmail <<'!NO!SUBS!' tmpart=/tmp/rnmail$$ dotdir=${DOTDIR-${HOME-$LOGDIR}} headerfile="" case $# in --- 61,67 ----- !GROK!THIS! $spitshell >>Rnmail <<'!NO!SUBS!' dotdir=${DOTDIR-${HOME-$LOGDIR}} + tmpart=$dotdir/.letter headerfile="" case $# in *************** *** 88,95 $cat <<'EOH' Type the net address of those people that you wish the message sent to. ! Note that you will be asked later for additional addresses of people to ! whom the message is not addressed but you wish to get copies. Separate multiple addresses with spaces. --- 91,97 ----- $cat <<'EOH' Type the net address of those people that you wish the message sent to. ! Additional recipients may be added on the Cc: line when you edit. Separate multiple addresses with spaces. *************** *** 173,179 while true ; do case $state in edit) ! rescue="sleep 1; $cat $tmpart >>${HOME-$LOGDIR}/dead.letter ; $echo saved in ${HOME-$LOGDIR}/dead.letter ; $rm -f $tmpart; exit" trap "$rescue" 1 trap : 2 case "${VISUAL-${EDITOR-}}" in --- 175,181 ----- while true ; do case $state in edit) ! rescue="sleep 1; $cat $tmpart >>${HOME-$LOGDIR}/dead.letter ; $echo Message appended to ${HOME-$LOGDIR}/dead.letter ; exit" trap "$rescue" 1 trap : 2 case "${VISUAL-${EDITOR-}}" in *************** *** 220,225 state=rescue ;; e*) state=edit ;; l*) --- 222,231 ----- state=rescue ;; e*) + set $ans + case $# in + 2) VISUAL="$2" ;; + esac state=edit ;; l*) *************** *** 234,239 Type s to send the message, a to abort and append the message to dead.letter, e to edit the message again, or l to list the message. EOH esac ;; --- 240,247 ----- Type s to send the message, a to abort and append the message to dead.letter, e to edit the message again, or l to list the message. + + To invoke an alternate editor, type 'e editor'. EOH esac ;; *************** *** 278,285 ;; rescue) $cat $tmpart >> ${HOME-$LOGDIR}/dead.letter ! $echo "Message saved to ${HOME-$LOGDIR}/dead.letter" ! state=cleanup ;; cleanup) $rm -f $tmpart --- 286,294 ----- ;; rescue) $cat $tmpart >> ${HOME-$LOGDIR}/dead.letter ! $echo "Message appended to ${HOME-$LOGDIR}/dead.letter" ! $echo "A copy may be temporarily found in $tmpart" ! exit ;; cleanup) case "${MAILRECORD-none}" in *************** *** 282,288 state=cleanup ;; cleanup) ! $rm -f $tmpart exit ;; esac --- 291,306 ----- exit ;; cleanup) ! case "${MAILRECORD-none}" in ! none) ! ;; ! *) if $cat $tmpart >> $MAILRECORD; then ! $echo "Article appended to $MAILRECORD" ! else ! $echo "Cannot append to $MAILRECORD" ! fi ! ;; ! esac exit ;; esac