From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 18-JUN-1993 15:48:24.76
To:	EVERHART
CC:	
Subj:	RE: Including signature blocks into messages.

From: biles@aa.wl.com (Bob Biles)
X-Newsgroups: comp.os.vms
Subject: RE: Including signature blocks into messages.
Date: 17 Jun 93 17:47:18 -0500
Organization: Parke-Davis/Warner-Lambert
Lines: 90
Message-Id: <1993Jun17.174718.1@aa.wl.com>
Nntp-Posting-Host: pdav01.research.aa.wl.com
To: Info-VAX@kl.sri.com
X-Gateway-Source-Info: USENET

In article <01GZ1ZD1BEX0FN44JN@PUMA.DIR.TEXAS.GOV>, stewart.nichols@dir.texas.gov writes:
>>p.s. I've noticed trailer messages from people on here and i'd love
>>to have one.  Anyone want to teach me how to make one for my Vax
>>account? :)
> 
> 
If you are using VMS mail & TPU, then you can use the following:

Cut out the attached com file, & edit to point to your own sig file.  You
can change the editor section files if you want; I use process logicals for
this.

In your login.com : $define mail$edit sys$login:mail$edit.com
or where you put it.

When you send mail with the /edit (or reply with /edit) you will get your sig
file attached.  This also adds the > character to the beginning of any line 
if you are doing a reply/ed/extract.

=== Cut here ===
$!
$! MAIL$EDIT.COM
$!
$! Edit	Edit date	By	Why
$!  05  03-jan-92	rlb	Stolen from Bob 
$!  04  02-jan-92	rca	Stolen from John
$!  03  20-DEC-89       JHB     Modify for my use
$!  02	07-Sep-89	NMdS	Tidy up
$!  01	??-???-??	???	Idea from INFOVAX (author unknown)
$!
$! Discussion:
$! Appends a MAIL signature file to the end of a message when
$! the user type SEND/EDIT or REPLY/EXTRACT etc.
$! In the latter case (REPLY/EXTRACT), the orignal message is included
$! within the current buffer, with leading "> " characters.
$!
$! I make no claims to the ownership of the original idea of this, as
$! it came from INFOVAX. I have just tidied it up into one file and
$! made it use the horrid DCL permanent file hack. Bleugh...
$!
$! To use this feature, add the following to your LOGIN.COM:
$!
$!	$ Assign dev:[dir]MAIL$EDIT.COM MAIL$EDIT
$!
$! I have included an example SIG file (MAIL.SIG) in this directory.
$!
$	Open/Read	MAIL_COMMAND 'F$Environment("Procedure")		! Open this procedure as MAIL_COMMAND
$ 10$:	Read MAIL_COMMAND Record						! Skip through until we find a line...
$	If F$Extract(0,1,Record) .nes. "!" Then Goto 10$			! ...starting with "!".
$!
$! File logical MAIL_COMMAND is now positioned at the start of the TPU command file.
$!
$	Assign/User	SYS$COMMAND	SYS$INPUT
$	Edit = ""
$	Edit /Tpu	'P1		-
		/Command=MAIL_COMMAND	-
		/Output='P2
$!			/Section=ATG_EVE	-					! Change section to your favourite.
$ close MAIL_COMMAND
$ exit $status
! ** Important! Leave this comment here as line 1 **
!
! TPU command file to handle MAIL replies
!
sig_file := "SYS$LOGIN_DEVICE:[biles.coms]MAIL$SIG.SIG";	! Change this name for a different SIG file.
prefix	:= "> ";			! Prefix to insert in line

! Insert prefix at the beginning of each line

position(beginning_of(current_buffer));			! Go to the start of the current buffer
loop;							! For each line in the buffer...
	exitif (mark(none) = end_of(current_buffer));	! ...exit if we are at the end
	copy_text(prefix);				! Insert a prefix
	move_horizontal(-length(prefix));		! Go back to the start of the line...
	move_vertical(1);				! ...and go down to the start of the next line
endloop;
split_line; move_vertical(-1); temp := mark(FREE_CURSOR); ! Remember end of original message

! Append the signature file

if file_search(sig_file) <> "" then			! If there is a signature file...
	position(end_of(current_buffer));		! ...move to the end of the current buffer
	read_file(sig_file);				! ...and read in the file
endif;
position(temp);						! Move to end of original message
delete(sig_file);					! Free up any memory used
delete(prefix);
delete(temp);
! Put NOTHING after this line!


