From:	AITGW::"gaynor@agvax2.ag.ohio-state.edu" "Jim Gaynor" 23-JAN-1992 14:21:16.13
To:	mx-list@vms.ecs.rpi.edu
CC:	
Subj:	Mailing from All-In-1 2.4 after K602 patch...

Received: by AITGW.DECnet (utk-mail11 v1.5) ; Thu, 23 Jan 92 14:21:44 EST
Received: from vms.ecs.rpi.edu by aitgw.ge.com (5.65/GE Gateway 1.4)
	id AA13085; Thu, 23 Jan 92 13:24:38 -0500
Errors-To: list-mgr@vms.ecs.rpi.edu
X-Listname: Message Exchange discussion list <MX-List@vms.ecs.rpi.edu>
Received: from agvax2.ag.ohio-state.edu by vms.ecs.rpi.edu (MX V3.0A) with
          SMTP; Thu, 23 Jan 1992 12:26:25 EST
Received: by agvax2.ag.ohio-state.edu (MX V2.3-1) id 14739; Thu, 23 Jan 1992
          12:23:28 EST
Date: Thu, 23 Jan 1992 12:23:28 EST
From: Jim Gaynor <gaynor@agvax2.ag.ohio-state.edu>
Reply-To: Jim Gaynor <gaynor@agvax2.ag.ohio-state.edu>
To: mx-list@vms.ecs.rpi.edu
Message-Id: <00955107.02F32D80.14739@agvax2.ag.ohio-state.edu>
Subject: Mailing from All-In-1 2.4 after K602 patch...
 
Hullo, all.
 
I just applied the All-In-1 2.4 Update 2.0, which includes the k602
patch.  One of the things that the k602 patch "fixes" is that fact
that you cannot have lower-case addresses when sending mail to the
"special" address (using a "_" in front of the address.)  This means
that SPECIAL.COM is updated by this patch, as well as other things
relating to it.
 
The practical upshot of all this is that, after applying the patch,
using my modified SPECIAL.COM to send mail via MX caused the message
to vanish into the bit bucket, never to return.  <sigh>
 
Never fear, for I went ahead and rewrote it.  The following version of
SPECIAL.COM will allow you to send email from All-In-1 via MX, by
prefacing the address with "_".  Thus, if you desire to send email to
"fred@bigvax.stateu.edu", you'd enter "_fred@bigvax.stateu.edu" in
All-In-1's TO: field.
 
This rewrite incorporates the "/NOCC" fix that was noted here on the
MX-list, and I've added some decent commenting as well.  Thanks to all
appropriate people, as my brain is too soggy to recall specific names.
 
One final note - after you add this in using the Customization
Management section, and your System Manager (if it isn't you) moves it
to the "live" area, make sure that the file itself is world readable
and executable.  Otherwise, non-privved users won't be able to use it.
 
-- Jim Gaynor
 
* * * Cut Here * * *
$! OALIB:SPECIAL.COM	V2.4 - K602	Last edited: (see rev notes)
$! Electronic Mail Subsystem
$! Deliver mail to the "SPECIAL" destination
$!
$! Rev Notes:
$!
$! This version of SPECIAL.COM has been modified to send all mail
$! "special routed" mail out via an SMTP transport.  In this case,
$! it is Message Exchange, aka MX.  One portion has been added, and
$! certain minor portions have been commented out.  Nothing of the
$! original file has been deleted.
$!
$! 22/jan/1992	Jim Gaynor	<gaynor@agvax2.ag.ohio-state.edu>
$!
$	ASSIGN/USER NLA0: SYS$OUTPUT
$	ASSIGN/USER NLA0: SYS$ERROR
$	ON WARNING THEN GOTO NOT_SENT
$	ORIG_DIR := 'F$LOGICAL("SYS$DISK")''F$DIRECTORY()'
$	MY_NODE	:= 'F$LOGICAL("SYS$NODE")
$
$ UNDERLINE_LOOP:
$	IF "''F$EXTRACT(0,1,MY_NODE)'" .NES. "_" THEN GOTO SETUP_PARAM
$	MY_NODE	:= 'F$EXTRACT(1,99,MY_NODE)
$	GOTO UNDERLINE_LOOP
$
$ SETUP_PARAM:
$	WRITE OAMAILBOX "OA GET PROFIL.DIRECT[OA$USER]"
$	@DCLMAILBOX:
$	HOME_DIR = RESULT
$	WRITE OAMAILBOX "OA GET #MAILSUBJ"
$	@DCLMAILBOX:
$	SUBJ = RESULT
$	WRITE OAMAILBOX "OA GET #MAILFILE"
$	@DCLMAILBOX:
$	FILE = RESULT
$	WRITE OAMAILBOX "OA GET #MAILNODE"
$	@DCLMAILBOX:
$	NODE = RESULT
$	IF NODE .EQS. "" THEN GOTO SEND_IT
$	IF 'F$LOCATE("::",NODE) .EQ. 'F$LENGTH(NODE) THEN NODE := 'NODE'::
$	IF "''MY_NODE'" .EQS. "''NODE'" THEN NODE := ""
$	WRITE OAMAILBOX "OA GET OA$STATUS=""1"""
$	@DCLMAILBOX:
$
$ SEND_IT:
$	WRITE OAMAILBOX "OA GET #MAILADDR"
$	@DCLMAILBOX:
$	TO = NODE + RESULT
$ LOOP1:
$      	IF F$EXTRACT(0,1,TO) .NES. "_" THEN GOTO REALLY_SEND
$	TO = F$EXTRACT(1,99,TO)
$	GOTO LOOP1
$ REALLY_SEND:
$	ASSIGN/USER NLA0: SYS$OUTPUT
$	ASSIGN/USER NLA0: SYS$ERROR
$	SET DEFAULT 'HOME_DIR
$!
$! Here start the fancy things added for Internet mailing
$!
$! First, we knock the contents of "TO" down to all lower case,
$! since that's what the net likes.  We also add the transport name
$! to the front.  In this case it's "MX%" for Message Exchange.  But
$! it could also be "IN%", "WIN%", "SMTP%", or whatever is used on
$! your own particular system.
$!
$	TO = "MX%" + """""" + F$EDIT(TO,"LOWERCASE") + """"""
$!
$! Since we can't pass the quotes that MX requires via standard DCL,
$! we'll write the MAIL command to a .COM file and submit it that way.
$!
$	OPEN/WRITE OUTFILE SPECIAL_TEMP.COM
$	WRITE OUTFILE "$MAIL"
$	WRITE OUTFILE "SEND/NOEDIT/NOSELF/NOCC ''FILE'"
$	WRITE OUTFILE "''TO'"
$	WRITE OUTFILE "''SUBJ'"
$	WRITE OUTFILE "EXIT"
$	WRITE OUTFILE "$EXIT"
$	CLOSE OUTFILE
$!
$! Run the .COM file we just made, and then delete it to leave no
$! trace that we were here.
$!
$	@SPECIAL_TEMP
$	DELETE /NOCONFIRM SPECIAL_TEMP.COM;*
$!
$! End of add-ins.  Following stuff is commented out, since it
$! doesn't work (or is irrelevant) after the stuff we just added in.
$!
$!	MAIL/SUBJ=&SUBJ &FILE &TO
$!	IF $STATUS THEN GOTO DONE
$!
$! NOT_SENT:
$!	Status := '$STATUS
$!	WRITE OAMAILBOX "OA GET OA$STATUS=""''STATUS'"""
$!	@DCLMAILBOX:
$!
$! We now return you to your regularly scheduled SPECIAL.COM...
$!
$ DONE:
$	SET DEFAULT 'ORIG_DIR
$	EXIT
* * * End of Add-In * * *
---
Jim Gaynor - System Analyst       Internet: gaynor@agvax2.ag.ohio-state.edu
Ohio State University - ACS/FMS   Phone: Voice 614/292-4338 - FAX 614/292-7443
ObDiscl:  Everything stated here and above is _my_ opinion.  Mine mine mine!
ObQuote: "Aiiiigggghhhh!  Small children!"  - John Cusack, "Hot Pursuit"
