Article 6595 of vmsnet.mail.mx:
>I have grabed a copy of the MAILSHR_PATCH archive from the WKU ftp
>server and tried to apply it.....

:
:

>Apply the patch? [Y]Y
>23:47:43> Patching MAILSHR.EXE...
>%RMS-F-NEF, not positioned to EOF on $PUT (sequential organization only)
>%DCL-W-SKPDAT, image data (records not beginning with "$") ignored
>23:47:44> PATCH failed.
>23:47:44> Results of PATCH saved in SYS$SYSROOT:[SYSMGR]MAILSHR_PATCH.LIS.
>%DELETE-I-FILDEL, SYS$SYSROOT:[SYSMGR]MAILSHR_PATCH.TMP;1 deleted (21 blocks)
>%DELETE-I-FILDEL, SYS$SYSROOT:[SYSMGR]MAILSHR_PATCH.TMP2;1 deleted (3 blocks)
>%DELETE-I-TOTAL, 2 files deleted (24 blocks)
>$
>$ type mailshr_patch.lis
>
>%PATCH-F-OPENOUT, error opening SYS$OUTPUT as output
>-RMS-E-FNF, file not found
>$
>
>Not being an expert on this, anyone care to offer some suggestions
>as to what to do next please.


  Yes, the procedure is a bit buggy. Enclosed is a modified version that fixes
  the problems.

  BTW, does anyone have a version of OpenVMS 6.1 on AXP (this procedure fails
  because PATCH doesn't exist, but I suppose the mailshr.exe image is completely
  different anyway!)

Regards,

Andy Harper
Kings College London










































$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))'
$!
$! This archive created:
$!  Name : M
$!  By   : Andy Harper <UDAA055@kcl.ac.uk>
$!  Date : 11-APR-1996 16:13:08.82
$!  Using: VMS_SHARE 8.5-1, (C) 1993 Andy Harper, Kings College London UK
$!
$! Credit is due to these people for their original ideas:
$!    James Gray, Michael Bednarek 
$!
$! To unpack this archive:
$!    Minimum of VMS 4.4 (VAX) / OpenVMS 1.0 (Alpha) is required.
$!    Remove the headers of the first part, up to `cut here' line.
$!    Execute file as a command procedure.
$!
$! The following file(s) will be created after unpacking:
$!       1. MAILSHR_PATCH.COM;4
$!
$ set="set"
$ set symbol/scope=(nolocal,noglobal)
$ f="SYS$SCRATCH:."+f$getjpi("","PID")+";"
$ if f$trnlnm("SHARE_UNPACK") .nes. "" then $ -
 f=f$parse("SHARE_UNPACK_TEMP",f)
$ e="write sys$error  ""%UNPACK"", "
$ w="write sys$output ""%UNPACK"", "
$ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!"
$ if f$getsyi("CPU") .gt. 127 then $ goto start
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto start
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$unpack:subroutine!P1=file,P2=chksum,P3=attrib,P4=size,P5=fileno,P6=filetotal
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'"
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn' File skipped"
$ delete 'f'*
$ exit
$dirok:
$ x=f$search(P1)
$ if x .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped"
$ delete 'f'*
$ exit
$file_absent:
$ w "-I-UNPACK, Unpacking ", P5, " of ", P6, " - ", P1, " - ", P4, " Blocks"
$ n=P1
$ if P3 .nes. "" then $ n=f
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT/NOJOURNAL 'f'/OUT='n'
PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t,
SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE;PROCEDURE SkipPartsep LOCAL m;
LOOP m:=MARK(NONE);EXITIF m=END_OF(CURRENT_BUFFER);DELETE(m);EXITIF INDEX(
ERASE_LINE,"-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;
PROCEDURE ProcessLine LOCAL c,s,l,b,n,p;s := ERASE_LINE;EDIT(s,TRIM);c :=
 SUBSTR(s,1,1);s := s-c;IF c = "X" THEN SPLIT_LINE; ENDIF;MOVE_HORIZONTAL(-1);
l := LENGTH(s);p := 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);p := p+1;
CASE c FROM ' ' TO '`' ['\']: b:=GetHex(s,p); n:=GetHex(s,p+2); p:=p+4;
 COPY_TEXT( SUBSTR(CURRENT_LINE,CURRENT_OFFSET-b+1,n));['&']: b:=GetHex(s,p);
 n:=GetHex(s,p+2); p:=p+4; COPY_TEXT(ASCII(n)*b);['`']: COPY_TEXT(ASCII(GetHex(
s,p))); p:=p+2;[INRANGE,OUTRANGE]: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE;
PROCEDURE Decode(b)LOCAL m;POSITION(BEGINNING_OF(b));LOOP m:=MARK(NONE);
EXITIF m=END_OF(b);DELETE(m);IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=
1 THEN SkipPartSep;ELSE ProcessLine;MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;
ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET(SUCCESS,OFF);SET(INFORMATIONAL,
OFF);t:="0123456789ABCDEF";f:=GET_INFO(COMMAND_LINE,"file_name");o:=
CREATE_BUFFER(f,f);Decode(o);WRITE_FILE(o,GET_INFO(COMMAND_LINE,"output_file"))
;QUIT;
$ if p3 .eqs. "" then $ goto dl
$ open/write fdl &f
$ write fdl "RECORD"
$ write fdl P3
$ close fdl
$ w "-I-CONVRFM, Converting record format to ", P3
$ convert/fdl='f' 'f'-1 'f'
$ fa=f$getdvi(f$parse(f),"ALLDEVNAM")
$ Pa=f$getdvi(f$parse(P1),"ALLDEVNAM")
$ if fa .eqs. Pa then $ rename &f 'f$parse(P1)'
$ if fa .nes. Pa then $ copy &f 'f$parse(P1)'
$dl: delete 'f'*
$ checksum 'P1'
$ if checksum$checksum .nes. P2 then $ -
  e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ exit
$ endsubroutine
$start:
$!
$ create 'f'
X$!--------\0808\1010\2020\400D
X$! MAILSHR_PATCH.COM
X$!
X$! This procedure patches SYS$LIBRARY:MAILSHR.EXE so e-mail addresses no longe
Vr
X$! require the MX%"" for Internet mail.
X$!
X$!--------\0808\1007
X$! NOTE: THIS PATCH HAS BEEN MODIFIED TO WORK WITH MX% INSTEAD OF IN%.
X$!`09To apply this patch for PMDF (IN%), uncomment\2506line from
X$!`09the patch below:
X$!
X$!`09!;'`09pushl`09#22254E49`09`09' ! ; ctrstr`09#`5EA/IN%"/
X$!
X$!`09and comment out the MX% line below it.
X$!--------\0808\1007
X$!
X$! The patch is dependent upon the version of VMS.  See the end of this
X$! procedure for version-specific details.
X$!
X$!--------\0808\1010\2020\400D
X$! HISTORY
X$!
X$!`09Originally written solely as a patch file by Claude Barbe, Aug, 1990.
X$!
X$!`09Modified by several others for newer releases of VMS.
X$!
X$!`09Converted to a command procedure by Edwin J. Bates, Feb, 1996.
X$!
X$!--------\0808\1010\2020\400D
X$
X$   WS`09`09= "WRITE SYS$OUTPUT"
X$   RS`09`09= "READ SYS$COMMAND /END=Finished /PROMPT="
X$   Stamp`09= WS+" F$EXTRACT(12,8,F$TIME()),""> "","
X$   Myself`09= F$ENVIRONMENT("PROCEDURE")
X$   Myself`09=\0907-"''F$PARSE(\1B06,,,"TYPE")''\1B13VERSION")'"
X$   Myname`09= F$PARSE(Myself,,,"NAME")
X$   Listfile`09= Myself+".LIS"
X$   Tempfile`09= "SYS$LOGIN:''Myname'.TMP"
X$   MAILSHRdir`09= "SYS$COMMON:`5BSYSLIB`5D"
X$   MAILSHRfile`09= "''\1107dir\0B08.EXE"
X$   PrevDef`09= F$ENVIRONMENT("DEFAULT")
X$   GOSUB Create_lists
X$
X$   SET NOON
X$   ON CONTROL_Y THEN  GOTO Finished
X$
X$!---- Display and processing of options ----
X$
X$   GOSUB Get_version
X$Display_menu:
X$   GOSUB Display_options
X$Read_menu_choice:
X$   RS "Please enter the number of your choice: `5B''Option_def'`5D  " \1006
X$   If "''Option'".EQS."" THEN  \1606 =\0907_def
X$   Params = Option_'\0806'
X$   IF "''Params'".EQS.""
X$   THEN
X$     WS "Invalid choice.  Please enter a number from the menu above (9 to exi
Vt)"
X$     GOTO Read_menu_choice
X$   ENDIF
X$
X$   Xfer = F$ELEMENT(2,",",Params)
X$   IF Xfer.NES."" THEN  GOTO 'Xfer'
X$
X$!----- Prepare and process the patch file ------
X$
X$   GOSUB Create_patch_file
X$   TYPE /PAGE SYS$INPUT
X
X$   WS "Patch file ready."
X$   WS "The old MAILSHR will be saved as\1908.UNPATCHED."
X$   WS ""
X$   RS "Apply the patch? `5BY`5D  " OK
X$   IF .NOT.OK .AND. OK.NES."" THEN  GOTO Finished
X$
X$   INSTALL := $\0C07/COMMAND
X$   SET DEFAULT 'MAILSHRdir'
X$   MAKECOPY="TRUE"
X$   IF F$SEARCH("MAILSHR.UNPATCHED") .NES. ""
X$     THEN
X$       MAKECOPY = F$FILE("MAILSHR.EXE","EOF").NES.\2010UNPATCHED\2608
X$   ENDIF
X$   IF MAKECOPY
X$   THEN
X$     Stamp "Copying MAILSHR.EXE as\0F09UNPATCHED..."
X$     COPY MAILSHR.EXE\0C09UNPATCHED
X$   ENDIF
X$   Stamp "Patching MAILSHR.EXE..."
X$!   DEFINE /USER_MODE SYS$OUTPUT 'Listfile'
X$   PATCH/JOURNAL='Listfile' @'Tempfile'
X$   IF $STATUS
X$   THEN
X$     Stamp "Installing new MAILSHR.EXE..."
X$     INSTALL REPLACE 'MAILSHRfile'
X$   ELSE
X$     Stamp "PATCH failed."
X$   ENDIF
X$   Stamp "Results of PATCH saved in ''Listfile'."
X$
X$Finished:
X$   CLOSE /NOLOG Temp
X$   IF F$SEARCH(Tempfile).NES."" THEN  DELETE '\1F08'*;*
X$   IF F$ENVIRONMENT("DEFAULT").NES.PrevDef THEN  SET \2007 '\1B07'
X$   EXIT
X$
X$!--------\0808\1010\2020\400B
X$! Create_patch_file
X$!--------\0808\1010\2020\400B
X$
X$Create_patch_file:
X$   CREATE 'Tempfile'2
X$   OPEN/APPEND Temp 'Tempfile'2
X$   WT = "WRITE Temp"
X$   WT "$   CREATE ",Tempfile
X$   WT "MAILSHR.EXE"
X$   WT "DEF"
X$   WT "MAIL$$ADD_ADDR"
X$   WT F$ELEMENT(0,",",Option_'\0806')
X$   WT "ADD_ADDR"
X$   WT F$ELEMENT(1,",",Option_'\0806')
X$   WT "EXI"
X$   CLOSE /NOLOG Temp
X$   @'Tempfile'2
X$   APPEND SYS$INPUT 'Tempfile'
X!
X! Now make sure that we have a patch area
X!
XALI/B PATAREA
X! And now enter instruction mode
X!
XSE M
XI
XEXI
X!       Start implementing the ALTER_TO subroutine
X!       It was first developped and tested as a MACRO-32 program
X!       and changed into the body of this patch.com file by
X!       a MACRO_TO_PATCH.COM procedure developped for that purpose
XDEP /PAT
XPATAREA
X       !;\0907ALTER_TO is called with the same 2 arguments used by
X       !;\0907MAIL$$SEND_ADD_ADDR in calling\1F07\1A09and will call
X       !;\0907ADD_ADDR itself with or without a rewrite. There is no\1508
X       !;\0907if SYS$FAO fails.  The original address is never modified and
X       !;\0907will still appear unmodified in the "published" TO: field.
X       !;
X       !;\0907At this point when MAIL$$ADD_ADDR calls ALTER_TO, 4(AP)\3006s
X       !;\0907to a string descriptor which MAIL has already parsed to be one
X       !;\0907of a single recipient (we don't have to look for commas or for
X       !;\0907an @ sign preceding a distribution list).  Because of the
X       !;\0907location of this patch, floating/unquoted "!"s seem unlikely.
X       !;
X       !;\0907The principle of this patch is to allow plain RFC addresses
X       !;\0907to be acceptable by mail.  We never anticipated to fully deal
X       !;\0907with the full RFC822 format but simply to lrt forms such as
X       !;\0907user@site.org or user%machine\1906company.org with all atoms
X       !;\0907being alphanumerics and the whole address void of double quotes
V
X       !;
X       !;\0907At the same time STRAIGHTFORWARD phase IV DECnet mail addresses
V
X       !;\0907are also allowed in an RFC822 like format: USERNAME@NODENAME
X       !;\0907is being transformed into NODENAME::USERNAME.  Note well that
X       !;\0907the code will NOT transform any address with an "@" into
X       !;\0907a more complex DECnet mail address such as AAA::BBB::USER.
X       !;
X       !;\0907The parsing is an adhoc scanning of the string looking for
X       !;\0907no more than one "@", checking the absence of " and for the
X       !;\0907A and B parts of A@B distinguish between A-Z,0-9,a-z,$,%,.,-
X       !;\0907and other characters (in case MAIL's parser would any slip thru)
V
X       !;
X       !;\0907More exactly the algorithm is:
X       !;
X       !;\0907input string might look like A@B with A and B containing no "
X       !;\0907if " or not A@B, pass the string to ADD_ADDR unchanged  ! Case 1
V
X       !;\0907else if A or B has any character not in A-Z,0-9,a-z,$,%,.,-
X       !;\0907\1007\0E09pass IN%"A@B"\2417    ! Case 2
X       !;\0907     else
X       !;\0907\1007  if B has no dots (pure DECnet) pass B::A\4108 Case 3
X       !;\0907\1007  else pass IN%"A@B"\2210\320D! Case 2
X       !;
X       'alter_to: .word 7C\1A07\2107\0E08' ! ; entry mask save R2-R6
X       '\0807 movq    @B`5E4(ap),r0'
X       '\0807 movzwl  r0,r0'
X       '\0807 clrl    r2'
X       'cdblp1: cmpb    #`5Ex22,(r1)'
X       '\0807 beql    cdbcs1'
X       '\0807 cmpb    #`5Ex40,(r1)+'
X       '\0807 beql    cdbl1x'
X       '\0807 incl    r2\1208\1A08\2908! ; length of A in A@B
X       '\0807 sobgtr  r0,cdblp1'
X       'cdbcs1: movab   @B`5E4(ap),r2'
X       '\0807 jmp     cdbcom\1608\1E08  ' ! ; no changes - case 1
X       'cdbl1x: decl    r0\1A07\2107\0E08' ! ; count "@"
X       '\0807 bleq    cdbcs1\1608\1E08  ' ! ; branch if at end
X       '\0807 tstl    r2'
X       '\0807 beql    cdbcs1\1608\1E08  ' ! ; branch if @B with no A
X       '\0807 clrl    r3\1208\1A08\2908! ; now parse after "@"
X       'cdblp2: cmpb    #`5Ex22,(r1)'
X       '\0807 beql    cdbcs1'
X       '\0807 cmpb    #`5Ex40,(r1)+'
X       '\0807 beql    cdbcs1'
X       '\0807 incl    r3\1208\1A08\2908! ; length of B in A@B
X       '\0807 sobgtr  r0,cdblp2'
X       !; passed test 1 - we have A@B - Now check A
X       '\0807 movq    @B`5E4(ap),r0'
X       !; allocate room on stack for 2 descriptors (for A and B)
X       '\0807 pushl   r1'
X       '\0807 pushl   r2'
X       '\0807 movl    sp,r5\1508   ' ! ; r5 points to desc(A)
X       '\0807 movl    r2,r0'
X       '\0807 beql    cdbcs1'
X       '\0807 jsb     cdbck1'
X       '\0807 tstl    r0'
X       '\0807 bneq    cdbcs2'
X       '\0807 incl    r1'
X       '\0807 pushl   r1'
X       '\0807 pushl   r3'
X       '\0807 movl    sp,r6\1508   ' ! ; r6 points to desc(B)
X       '\0807 movl    r3,r0'
X       '\0807 beql    cdbcs1'
X       '\0807 jsb     cdbck1'
X       '\0807 tstl    r0'
X       '\0807 beql    cdbps2'
X       !\0807\0F07\0E0E\1C10; build IN%"A@B" for case 2
X       !; use the stack this way for all $FAO
X       !;\0907\1007 outlen\150Ainitial sp\3206<- r3 <-r2
X       !;\0907\1007 ptr to outbuf   initial sp-264  <- r2 minus 8
X       !;\0907\1007 ......\150F\240B<- r2 to beg of ptr
X       !;\0907\1007 outbuf\150Ainitial sp-4    <- r3 minus 4
X       !;\0907\1007 ......\150Ainitial sp-256  <- sp
X       'cdbcs2: pushl   #22534121\2107\2807 ' ! ; ctrstr    #`5EA/!AS"/
X       !;'`09pushl`09#22254E49`09`09' ! ; ctrstr`09#`5EA/IN%"/
X       '`09pushl`09#2225584D`09`09' ! ; ctrstr`09#`5EA/MX%"/
X       '\0807 pushl   sp\1208\1A08\2908! ; make desc to ctrstr
X       '\0807 pushl   #8\1208\1A08\2908! ; make desc to ctrstr
X       '\0807 movl    sp,r4\1508\1D08   ' ! ; address of desc to ctrstr
X       '\0807 subl    #4,sp\1508\1D08   ' ! ; adjusted stack
X       '\0807 movl    sp,r3\1508\1D08   ' ! ; save stack for outlen
X       '\0807 movl    sp,r2\1508\1D08   ' ! ; end of desc to outbuf
X       '\0807 subl    #108,sp\1708 ' ! ; end of outbuf
X       '\0807 movl    sp,-(r2)\1808' ! ; make outbuf
X       '\0807 movzwl  #100,-(r2)\2108! ; make outbuf
X       '\0807 pushl   B`5E4(AP)\1708\1F08 ' ! ; #4 P1 pass what we got
X       '\0807 pushl   r2\1208\1A08\2908! ; #3 outbuf
X       '\0807 pushl   r3\1208\1A08\2908! ; #2 outlen
X       '\0807 pushl   r4\1208\1A08\2908! ; #1 ctrstr
X       '\0807 calls   #4,@#7FFEDF50\1D08   ' ! ;\260A04,g`5Esys$fao
X       '\0807 blbs    r0,N102$'
X       '\0807 jmp     cdberr'
X       'N102$:  movw    (r3),(r2)\2107\2807 ' ! ; complete ptr to final text
X       '\0807 jmp     cdbcom'
X       'cdbps2: movq    @B`5E4(ap),r0'
X       '\0807 addl    r2,r1'
X       '\0807 incl    r1'
X       '\0807 movl    r3,r0'
X       '\0807 jsb     cdbck2'
X       '\0807 tstl    r0'
X       '\0807 bneq    cdbcs2\1608\1E08  ' ! ;
X       !
X       !\0807\0F07\0E0E\1C10; build B::A for case 3
X       'cdbcs3: pushl   #5341213A\2107\2807 ' ! ; ctrstr    #`5EA/:!AS/
X       '\0807 pushl   #3A534121\1908\2909! ; ctrstr    #`5EA/!AS:/
X       '\0807 pushl   sp\1208\1A08\2908! ; make desc to ctrstr
X       '\0807 pushl   #8\1208\1A08\2908! ; make desc to ctrstr
X       '\0807 movl    sp,r4\1508\1D08   ' ! ; address of desc to ctrstr
X       '\0807 subl    #4,sp\1508\1D08   ' ! ; adjusted stack
X       '\0807 movl    sp,r3\1508\1D08   ' ! ; save stack for outlen
X       '\0807 movl    sp,r2\1508\1D08   ' ! ; end of desc to outbuf
X       '\0807 subl    #108,sp\1708 ' ! ; end of outbuf
X       '\0807 movl    sp,-(r2)\1808' ! ; make outbuf
X       '\0807 movzwl  #100,-(r2)\2108! ; make outbuf
X       '\0807 pushl   r5\1208\1A08\2908! ; #5 Second sub string A
X       '\0807 pushl   r6\1208\1A08\2908! ; #4 first  sub string B
X       '\0807 pushl   r2\1208\1A08\2908! ; #3 outbuf
X       '\0807 pushl   r3\1208\1A08\2908! ; #2 outlen
X       '\0807 pushl   r4\1208\1A08\2908! ; #1 ctrstr
X       '\0807 calls   #5,@#7FFEDF50\1D08   ' ! ;\260A05,g`5Esys$fao
X       '\0807 blbs    r0,N103$'
X       '\0807 jmp     cdberr'
X       'N103$:  movw    (r3),(r2)\2107\2807 ' ! ; complete ptr to final text
X       '\0807 jmp     cdbcom'
X       !; check if all alpha numerical + .-_$% returns non zero
X       'cdbck1: cmpb    #`5Ex41,(r1)'
X       '\0807 bgtr    cdbck11'
X       '\0807 cmpb    #`5Ex5A,(r1)'
X       '\0807 bgeq    cdbck19'
X       'cdbck11: cmpb   #`5Ex61,(r1)'
X       '\0807 bgtr    cdbck12'
X       '\0807 cmpb    #`5Ex7A,(r1)'
X       '\0807 bgeq    cdbck19'
X       'cdbck12: cmpb   #`5Ex30,(r1)'
X       '\0807 bgtr    cdbck13'
X       '\0807 cmpb    #`5Ex39,(r1)'
X       '\0807 bgeq    cdbck19'
X       'cdbck13: cmpb   #`5Ex24,(r1)'
X       '\0807 beql    cdbck19'
X       '\0807 cmpb    #`5Ex25,(r1)'
X       '\0807 beql    cdbck19'
X       '\0807 cmpb    #`5Ex2D,(r1)'
X       '\0807 beql    cdbck19'
X       '\0807 cmpb    #`5Ex2E,(r1)'
X       '\0807 beql    cdbck19'
X       '\0807 cmpb    #`5Ex5F,(r1)'
X       '\0807 rsb'
X       'cdbck19: incl   r1'
X       '\0807 sobgtr  r0,cdbck1'
X       '\0807 rsb'
X       !; check if we have at least one dot (then r0 > 0)
X       'cdbck2: cmpb    #`5Ex2E,(r1)'
X       '\0807 bneq    cdbck29'
X       '\0807 rsb'
X       'cdbck29: incl   r1'
X       '\0807 sobgtr  r0,cdbck2'
X       '\0807 rsb'
X       !;
X       'cdberr: movab   @B`5E4(ap),r2\2106 !; If SYS$FAO fails, use original a
Vddr
X       'cdbcom: MOVQ    #`5EX00000001,-(SP)'
X       '\0807 movl    B`5E8(ap),-(sp)'
X       '\0807 pushl   r2'
X       '\0807 CALLS   #04,L`5EADD_ADDR'
X       '\0807 ret\0B08\1308\2107!; this is the only RET for ALTER_TO
XEXI
X! Above was the new code
X! Below is the patch in the existing code that
X! will make use of the ALTER_TO new code
XRE
XMAIL$$ADD_ADDR
X'MOVQ    #`5EX00000001,-(SP)'
X'MOVQ    B`5E04(AP),-(SP)'
X'CALLS   #04,W`5EADD_ADDR'
X'RET'
XEXIT
X'MOVQ    B`5E04(AP),-(SP)'
X'CALLS   #02,ALTER_TO'
X'RET'
XEXIT
X! And now update if we reached this point without a single error
XU
X!--------\0808\1006 end of patch \2416
X$   RETURN
X$
X$!--------\0808\1010\2020\400B
X$! Display_intro
X$!--------\0808\1010\2020\400B
X$
X$Display_intro:
X$   TYPE/PAGE SYS$INPUT
XModifed Nov, 1990, RPW to replace IN%"  with  MX%" and to make the form
X   user@system translate into mx%"\1F0B" instead of \3206::user
X
XThis patch will be of interest to any VAX/VMS system (more especially if it
Xis running PMDF) since it lets TO: or CC: addresses such as
Xuser%machine@site.co.org to be accepted without the IN% prefix an\1B09
Xsurrounding double quotes.  Yes, let's admit it, it lets VMS mail accept Un*x
V
Xtype addresses.  In addition to its original goal, the format of this
Xmodification is also original by the fact of the straight macro code that
Xcan easily be modified/expanded or altered (ie IN% could become M_INTERNET::
Xin the case of most Schlumberger VMS nodes)
XIf the address is "similar" (see algorithm below) to user%machine@site.co.org
V
Xit is simply rewritten as IN%"user%machine@site.co.org" and passed along.
XAt the same time, user@machine will be accepted and rewritten as \2A07::user
X
XIf the IN% prefix is not the one in use on your VAX/VMS system, but XYZ% is,
Xthen all you have to do is $ DEFINE/SYSTEM/EXECUTIVE -
X      MAIL$PROTOCOL_IN -
X      XYZ_ROOT:`5BEXE`5DXYZ_MAILSHR\1F06 ! or wherever the XYZ overlay for MAI
VL
X        \0808\1010\2006! might be located and installed from
X
XSee additional impact remarks below.
X
XThis patch applies to SYS$LIBRARY:MAILSHR.EXE (usually SYS$COMMON:`5BSYSLIB`5D
V)
Xfrom VMS 5.0 to Field Test version of 5.4 as of June 1990
X
X      We recommend:
X
X      $ SET DEFAULT SYS$COMMON:`5BSYSLIB`5D
X      $ INSTALL:= $\0B07/COMMAND
X      $ PATCH @ this_file.COM
X      $ INSTALL REPLACE SYS$COMMON:`5BSYSLIB`5DMAILSHR.EXE
X
XClaude Barbe - Schlumberger-Doll Research - Ridgefield, CT - USA
X(Internet) barbe@sdr.slb.com (a happy hacker of MAIL and PMDF for over 3yr)
X
X3-Jul-1990
X
XNo warranty implied.  This can be freely copied and altered.  Use it at
Xyour own risks.  It is probably pure chance if it ever worked on a
Xparticular system.
X
XAdditional remarks on the impact of this patch
X
X1) With this patch in place we hope to make addressing unique in the VMS world
V
X   whether a message is sent via DECnet or via a foreign protocol (such as
X   the successful/affordable PMDF) without forcing any one to use prefixes
X   and/or quotes.  Quotes are to be avoided by all means since MAIL and DEC's
V
X   MRGATE interface have no mechanisms to imbed quoted addresses between
X   quotes (ie MRGATE and PMDF cannot carry the same message!)
X
X2) There are risks of confusion for new users who will learn that the Un*x
X   addressing format works on a patched VMS system and who will never bother
X   to know the DEC way to send mail with double colons between node and
X   username until they use a non patched VMS system
X
X3) The patch will certainly break when DECnet node names\2C07ontain dots
X   but this is in DECnet phase V and we still have to see a field test
X   for this product.  By that time a better patch will be developped or
X   whatever foreign protocol is used (PMDF by default) will just handle
X   these deliveries that could have gone also more simply across DECnet
X
X4) The patch is far from being fully RFC822 compliant and there are risks
X   that some users will be confused by the lack of completeness.  This
X   in some case will be due to the approach taken in this patch where,
X   instead of redoing the address pars\1406at DEC is \2606in MAIL, we
X   simply hacked a string filter on a "DEC approved \2106" which has already
X   been pruned of commas and exclamation points.  Users familiar with "bang"
X   addresses will still have to say IN%"node!node!user@relay.somewhere"
X
X5) After a few extra weeks of testing on a larger scale, this patch will be
X   submitted to DEC as an SPR for improvement.  Hopefully, then DEC will
X   support the de facto standard (or at least the most commonly used part
X   of it).  In the mean time let's try to let our users access Internet
X   addresses in the most natural way.  At last!
X$   GOTO Display_menu
X$
X$!--------\0808\1010\2020\400B
X$! Get_version
X$!--------\0808\1010\2020\400B
X$
X$Get_version:
X$   Stamp "Getting system information..."
X$   SysVer := 'F$GETSYI("VERSION")'
X$   Loc = F$LOCATE("`5C''SysVer',",Versionlist)
X$   Option_def = 9
X$   IF Loc.LT.F$LENGTH(Versionlist)
X$   THEN
X$     Option = 'F$ELEMENT(1,",",\100D`5C",F$EXTRACT(Loc,10,Versionlist)))'
X$     IF F$FILE(MAILSHRfile,"CDT").EQS."27-MAR-1995 19:08:55.00" .AND. -
X`09 F$FILE(MAILSHRfile,"EOF").EQ.119 THEN  -
X`09Option_def = MEMLEAKoption
X$   ENDIF
X$   RETURN
X$
X$!--------\0808\1010\2020\400B
X$! Display_options
X$!--------\0808\1010\2020\400B
X$
X$Display_options:
X$   TYPE SYS$INPUT /PAGE
X`09VMS ENVIRONMENT
X
X$   Count = 1
X$DO_loop:
X$     IF Count.GT.9 THEN  GOTO DO_loop_end
X$     Temp = "OPTION_''Count'"
X$     IF "''`26Temp'".NES."" THEN  WS "`09''Count') ",F$ELEMENT(3,",",'Temp')
V
X$     WS ""
X$     Count =\0806+1
X$     GOTO DO_loop
X$DO_loop_end:
X$   WS "Your system has reported that you are using VMS ''SysVer'."
X$   RETURN
X$
X$!--------\0808\1010\2020\400B
X$! Create_lists
X$!--------\0808\1010\2020\400B
X$
X$Create_lists:
X$   !--- Versionlist is a list of known VMS v\2306s and the patch`20
X$   !    option required for that version.
X$   !
X$   Versionlist = ""+ -
X`09"`5CV5.0,1"+ -
X`09"`5CV5.1,2"+ -
X`09"`5CV5.2,2"+ -
X`09"`5CV5.3,2"+ -
X`09"`5CV5.4,2"+ -
X`09"`5CV5.4-1,2"+ -
X`09"`5CV5.4-2,2"+ -
X`09"`5CV5.4-3,2"+ -
X`09"`5CV5.4-4,2"+ -
X`09"`5CV5.5,2"+ -
X`09"`5CV5.5-1,2"+ -
X`09"`5CV5.5-2,3"+ -
X`09"`5CV6.0,4"+ -
X`09"`5CV6.1,6"+ -
X`09""
X$   !--- A MAILSHR.EXE that has been patched for the memory leak is identified
V
X$   !    differently.  MEMLEAKoption identifies the \1607below for the
X$   !    memory-leak-patched system.
X$   !
X$   MEMLEAKoption = 5
X$
X$   !--- Option definitions.  \1507parameters, separated by commas, are:
X$   !
X$   !      MAIL$$ADD_ADDR   Used in PATCH file.
X$   !      ADD_ADDR\0E06   Used in PATCH file.
X$   !      Transfer label   Optional.  GOTO location for command processing.
X$   !      Description\1111 of option.
X$   !
X$   Option_1 = "000049C2,000048EF,,OpenVMS V5.0"
X$   Option_2 = "000049D2,000048FF,,OpenVMS V5.1 - 5.5-1"
X$   Option_3 = "000049DA,\090607,,OpenVMS V5.5-2"
X$   Option_4 = "00004AE2,\09060F,,OpenVMS V6.0"
X$   Option_5 = "00004B22,00004A33,,OpenVMS V5.5 - 6.0 with memory leak patch"
V
X$   Option_6 = "00004B9D,00004ACA,,OpenVMS V6.1"
X$   Option_8 = ",,Display_info    \1108 more information about this patch"
X$   Option_9 = ",,Finished        ,Exit"
X$   RETURN
$ call unpack MAILSHR_PATCH.COM;4 947668946 "" 43 1 1
$ v=f$verify(v)
$ exit


