[news.misc] permanent solution to double .signatures

jef@unisoft.UUCP (02/03/87)

It seems that a lot of people send out articles with two copies of their
.signature appended.  The cause of this seems fairly obvious to me.  Pnews
and Rnmail handle .signatures differently - Pnews (actually inews) always
appends the .signature, but Rnmail asks first.  Some small percentage of
people will always be confused by this.  Whenever one of these confused
people wants to send out an article with a slightly changed signature,
he or she will figure "Oh, I can just read the normal signature into my
editor buffer, make the change, post the article with the signature already
appended, and then when Pnews asks me whether I want to append my .signature,
I'll just say no."  Uh-huh.

Well, the first time this happened to me (yes, I admit it, I'm confused),
I decided to fix it.  Besides, I never liked the whole idea of automatically
appending .signature - when I post an article, I want to see *exactly*
what's going out to the net.  So I made some trivial changes to Pnews and
Rnmail, and now they append my signature before they go into the editor,
where I can change it or delete it as I wish.  While I was at it, I also
made signature-generation the responsibility of a script.  The default
script simply cats your .newsignature (name changed so that inews doesn't
fuck with it), but users are free to make their own versions of Gensig that
do more complicated things, such as selecting a random phrase from a file
(that's what mine does).

I've been using this stuff for a few weeks now, and I like it.  I've
appended the changes in case anyone else wants to try it out, or (dare
I hope?) incorporate it into the official distribution.  Enjoy.
---
Jef

 Jef Poskanzer  unisoft!jef@ucbvax.Berkeley.Edu  ...ucbvax!unisoft!jef
            "Imperial TTY fighters - a whole DZ of them!"

---------------------------------

diff -c Pnews Pnews.mine

*** Pnews	Mon Feb  2 13:36:39 1987
--- Pnews.mine	Mon Feb  2 13:39:42 1987
***************
*** 246,251 ****
--- 246,253 ----
      esac
  done
  
+ Gensig >>$tmpart
+ 
  $echo ""
  
  while true ; do
***************
*** 361,382 ****
  			;;
  		    *)
  			$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
--- 363,368 ----

---------------------------------

diff -c Rnmail Rnmail.mine

*** Rnmail	Mon Feb  2 13:41:00 1987
--- Rnmail.mine	Mon Feb  2 13:42:41 1987
***************
*** 163,168 ****
--- 163,170 ----
      esac
  done
  
+ Gensig >>$tmpart
+ 
  $echo ""
  
  while true ; do
***************
*** 240,255 ****
  	;;
      
      send)
- 	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
  	case $mailer in
  	*sendmail)
  	    $mailer -t <$tmpart
--- 242,247 ----

---------------------------------

#!/bin/csh -f

# Gensig - generate a signature
#
# 01A 12jan87 JP  First written.

cat ~/.newsignature

ahby@meccts.UUCP (02/04/87)

In article <250@unisoft.UUCP> jef@unisoft.UUCP (Jef Poskanzer) writes:
>It seems that a lot of people send out articles with two copies of their
>.signature appended.  The cause of this seems fairly obvious to me.  Pnews
>and Rnmail handle .signatures differently - Pnews (actually inews) always
>appends the .signature, but Rnmail asks first.

Pnews actually appends the .signature for you if you are posting to a
moderated group, and then sends the mail on to recmail or sendmail,
depending on your configuration.

>So I made some trivial changes to Pnews and
>Rnmail, and now they append my signature before they go into the editor,
>where I can change it or delete it as I wish.  While I was at it, I also
>made signature-generation the responsibility of a script.

Unfortunately, this is not a whole solution.  The program recmail (in
news version 2.10.3 and later), which Rnmail and Pnews use to relay mail,
also appends the .signature file.  As a matter of fact, it does it without 
asking!  This behavior should only be exhibited if you are not running
sendmail.  Rnmail and Pnews will call sendmail before recmail.

My solution to this problem was to just delete all of the .signature
handling code in both Pnews and Rnmail.  This seems to be working.  As
an aside, if on the command line for rn you place:

	-EEXINIT="+set wm=10"

(and you are using vi as your editor) then vi will behave as a 'word
processor', handling the newline generation for you at word breaks
near the end of line.
-- 
Shane P. McCarron		UUCP	ihnp4!meccts!ahby, ahby@MECC.COM
MECC Technical Services		ATT	(612) 481-3589

"They're only monkey boys;  We can still crush them here on earth!"