From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX"  8-JUN-1992 18:14:27.41
To:	info-vax@kl.sri.com
CC:	
Subj:	Re: Sig file.  PROGRAM to add one.

In article <1992Jun2.205538.16802@samba.oit.unc.edu>, Sahir.Siddiqui@bbs.oit.unc.edu (Sahir Siddiqui) writes:
> How does one attach a signature file to every mail message
> sent out?  Its easy in Unix, but I have not been able to find
> an equivalent feature in VMS.
> 
> Thanks,
> Sahir Siddiqui
> u93_Ssiddiqu@vaxa.steven-tech.edu

Here is a dcl file I whipped up a bit ago.  It adds a sig file, and if you're
replying to a message, it gives you the option of quoting it with a ">" 
(or whatever else you like).

$ 	v='f$verify(0)'
$! 	EMAIL.COM
$!	Pete Sabotka
$!
$!	Gives the option of quoting a reply, and adds a .sig file to 
$! 	local mail
$!
$!	Note:  For EMAIL.COM to work correctly you must do the following:
$!		- define MAIL$EDIT as this file
$!		- set MAIL as a global symbol:
$!			"MAIL :== MAIL/EDIT=(SEND,REPLY=EXTRACT,FORWARD)
$!
$ reprompt= ">"						! prompt to use w/reply
$ editor  = "LSEDIT"					! which editor to use
$ sigfile = "SCIENCE$DISK:[SABOTKAP.EMAIL]MAIL.SIG"	! sig file spec
$ 
$ emode :== assign/user sys$command sys$input		
$ file="SYS$SCRATCH:SEND.TMP;"
$ if p1 .eqs. ""
$	then 
$	sig=f$search(sigfile)
$	if sig .nes. "" then gosub addsig
$ 	emode	
$	'editor'/output='p2 'file
$	delete/noconfirm 'file
$ 	exit 
$ 	else
$	quote=0
$ 	read sys$command/end=done/prompt= -
	"%MAIL-I-INQUIRE, Quote this message? " c	
$ 	if (c) then quote=1
$	gosub Rewrite
$	sig=f$search(sigfile)				
$	if sig .nes. "" then gosub addsig
$	emode	
$	'editor'/output= 'p2 'file
$	delete/noconfirm 'file
$	v=f$verify(v)
$ exit 
$ endif	
$Rewrite:
$ if (.not. quote) then reprompt="" 
$ open/read input 'p1					
$ open/write output 'file				
$Loop:
$ read/end=closeloop input line	
$ write output reprompt,line	
$ goto loop
$Closeloop:
$ close input						
$ close output						
$ return						
$Addsig:
$ if f$search(file) .eqs. "" then create 'file	
$ open/read input 'sigfile	
$ open/append output 'file
$ write output ""
$ write output "--"
$Loop2:
$ read/end=closeloop2 input line
$ write output line
$ goto loop2
$ closeloop2:
$ close input
$ close output
$ return

----
Pete Sabotka, UMass-Lowell             
  DECnet: WOODS::SABOTKAP              
Internet: sabotkap@aspen.ulowell.edu

