From:	AITGW::"gbishop@ac.nsac.ns.ca"  3-DEC-1991 09:00:49.33
To:	carl@SOL1.GPS.CALTECH.EDU
CC:	mx-list@vms.ecs.rpi.edu
Subj:	RE: found a workaround for non-replyable messages

Received: by AITGW.DECnet (utk-mail11 v1.5) ; Tue, 3 Dec 91 08:59:27 EST
Received: from vms.ecs.rpi.edu by aitgw.ge.com (5.65/GE Gateway 1.4)
	id AA16336; Tue, 3 Dec 91 08:59:22 -0500
Errors-To: list-mgr@vms.ecs.rpi.edu
X-Listname: Message Exchange discussion list <MX-List@vms.ecs.rpi.edu>
Received: from AC.NSAC.NS.CA by vms.ecs.rpi.edu (MX Q3.0) with SMTP; Tue, 03
          Dec 1991 08:01:30 EST
Received: by ac.nsac.ns.ca (MX Q3.0) id 283; Tue, 03 Dec 1991 09:00:03 AST
Sender: <gbishop@ac.nsac.ns.ca>
Date: Tue, 03 Dec 1991 09:00:01 AST
From: Greg Bishop <gbishop@ac.nsac.ns.ca>
Reply-To: gbishop@ac.nsac.ns.ca
To: carl@SOL1.GPS.CALTECH.EDU
Cc: mx-list@vms.ecs.rpi.edu
Message-Id: <009528D7.2409F600.283@ac.nsac.ns.ca>
Subject: RE: found a workaround for non-replyable messages
 
  On Mon, 02 Dec 1991 19:09:50 PST Carl J Lydick <carl@SOL1.GPS.CALTECH.EDU>
wrote:
 
>Subject: RE: found a workaround for non-replyable messages
>
>I'm glad to hear it.  Now, in case somebody else encounters this problem in the
>future, exactly what did you do?
 
Sorry about that, the contents of a file I had created was supposed to be
attached. And that file said:
 
Well I've finally got a work around for my non-replyable address problem.
 
I created domain expansion routine of my own (in C) based on the name
conversion example that is in the example directory. It's kind of crude in
that it always returns a value of 0 to indicate that it couldn't do an
expansion (or contraction), but it works.
 
I'm glad the 2 samples were there in the distribution kit, or I would still be
stuck with no one being able to reply to any of our messages directly.
 
Here it is. Maybe someone could convert the DOM_EXPANSION in Bliss to C, since
I imagine far more sites have C Than Bliss.
 
/*
!++
! MODULE:   	    SITE EXPANSION X
!
! FACILITY: 	    MX Examples
!
! ABSTRACT: 	    Example of a domain name expander for use with MX
!   	    	    that does no name expansion
!
! MODULE DESCRIPTION:
!
!   This module contains the routines necessary for implementing
!   a domain name expander for use by the MX Router agent.  These
!   routines can be used to solve a problem with non-replyable addresses
!   due to munging by the Router.
!
!   To use this module: modify it as needed, then compile it
!   and link it with the commands:
!
!   	$ CC DOM_EXPANSION_X
!   	$ LINK/SHARE=DOM_EXPANSION/NOTRACE DOM_EXPANSION_X,SYS$INPUT:/OPT
!   	    SYS$SHARE:VAXCRTL/SHARE
!   	    UNIVERSAL=INIT,EXPAND,CLEANUP
!   	    <ctrl/Z>
!
!   Then copy it to MX_EXE and make it available to the Router with
!   the commands:
!
!   	$ COPY DOM_EXPANSION.EXE MX_EXE:
!   	$ DEFINE/SYSTEM/EXEC MX_SITE_DOM_EXPANSION MX_EXE:DOM_EXPANSION
!   	$ MCP RESET ROUTER
!
!   (You need a suitably privileged account to do this.)
!
! AUTHOR:   	    M. Madison
!   	    	    COPYRIGHT ) 1990, RENSSELAER POLYTECHNIC INSTITUTE.
!
!   THIS SOFTWARE IS PROVIDE "AS IS".  NEITHER THE AUTHOR NOR RENSSELAER
!   MAKE ANY GUARANTEES REGARDING THE SUITABILITY, RELIABILITY, SECURITY,
!   USEFULNESS, OR PERFORMANCE OF THIS SOFTWARE.  >>USE AT YOUR OWN RISK.
!
! CREATION DATE:    03-DEC-1990
!
! MODIFICATION HISTORY:
!
!   02-DEC-1991	V1.1	Bishop	    Based on sample code in Bliss written by
!				    M. Madison included with MX030 examples
!				    (my apologies to Matt for something this
!				     crude but I only modified what was there
!				     already; I could never have wriiten this
!				     from scratch.)
!--
*/
 
#include descrip
#include string
#include stdio
#include ssdef
#include str$routines
#include lib$routines
 
struct context {
    struct dsc$descriptor localnode;
    };
 
 
/*
!++
!
! ROUTINE NAME:	    INIT
!
! FUNCTIONAL DESCRIPTION:
!
!   Allocates and initializes context block for subsequent name conversions.
!
! RETURNS:  	cond_value, longword (unsigned), write only, by value
!
! PROTOTYPE:
!
!   INIT  ctxptr
!
! ctxptr:   pointer, longword (unsigned), modify, by reference
!
! IMPLICIT INPUTS:  None.
!
! IMPLICIT OUTPUTS: None.
!
! COMPLETION CODES:
!
!   SS$_NORMAL:	    	normal successful completion.
!
! SIDE EFFECTS:
!
!   None.
!--
*/
unsigned int
init (struct context **ctx) {
 
    int ctxsize;
    $DESCRIPTOR(mx_node_name,"MX_NODE_NAME");
 
    ctxsize = sizeof(struct context);
    lib$get_vm (&ctxsize, ctx);
    (*ctx)->localnode.dsc$b_dtype = DSC$K_DTYPE_T;
    (*ctx)->localnode.dsc$b_class = DSC$K_CLASS_D;
    (*ctx)->localnode.dsc$w_length = 0;
    (*ctx)->localnode.dsc$a_pointer = NULL;
    lib$sys_trnlog (&mx_node_name, 0, &(*ctx)->localnode);
    return SS$_NORMAL;
}  /* init */
 
/*
!++
!
! ROUTINE NAME:	    EXPAND
!
! FUNCTIONAL DESCRIPTION:
!
!   This routine PRETENDS to do a domain name expansion
!
!   NB: You MUST use STR$ routines to copy result to OUTSTR parameter
!       to ensure proper operation!!!!
!
!       You _may_ safely assume that INSTR is compatible with a DTYPE_T,
!   	CLASS_S (standard fixed-length) string descriptor.
!
! RETURNS:  	cond_value, longword (unsigned), write only, by value
!
! PROTOTYPE:
!
!   EXPAND  ctxptr, instr, outstr
!
! ctxptr:   pointer, longword (unsigned), modify, by reference
! instr:    char_string, character string, read only, by descriptor (fixed)
! outstr:   char_string, character string, write only, by descriptor
!
! IMPLICIT INPUTS:  None.
!
! IMPLICIT OUTPUTS: None.
!
! COMPLETION CODES:
!
!   SS$_NORMAL:	    	normal successful completion.
!
! SIDE EFFECTS:
!
!   None.
!--
*/
unsigned int
EXPAND (struct context **ctx, struct dsc$descriptor *instr,
    	    struct dsc$descriptor *outstr) {
 
    struct dsc$descriptor tmp, tmp2;
    size_t count;
    int retstat;
 
    count = instr -> dsc$w_length;
    tmp.dsc$b_dtype = DSC$K_DTYPE_T;
    tmp.dsc$b_class = DSC$K_CLASS_D;
    tmp.dsc$w_length = 0;
    tmp.dsc$a_pointer = NULL;
 
    tmp2.dsc$b_dtype = DSC$K_DTYPE_T;
    tmp2.dsc$b_class = DSC$K_CLASS_S;
 
/*
!   This code always returns a status of 0 to indicate a failure.
!
*/
    retstat = 0;
    str$free1_dx(&tmp);
    return retstat;
}  /* expand */
 
/*
!++
!
! ROUTINE NAME:	    CLEANUP
!
! FUNCTIONAL DESCRIPTION:
!
!   Deallocates context block allocated by init routine.
!
! RETURNS:  	cond_value, longword (unsigned), write only, by value
!
! PROTOTYPE:
!
!   CLEANUP  ctxptr
!
! ctxptr:   pointer, longword (unsigned), modify, by reference
!
! IMPLICIT INPUTS:  None.
!
! IMPLICIT OUTPUTS: None.
!
! COMPLETION CODES:
!
!   SS$_NORMAL:	    	normal successful completion.
!
! SIDE EFFECTS:
!
!   None.
!--
*/
unsigned int
cleanup (struct context **ctx) {
 
    int ctxsize;
 
    str$free1_dx(&(*ctx)->localnode);
    ctxsize = sizeof(struct context);
    lib$free_vm (&ctxsize, ctx);
    *ctx = NULL;
    return SS$_NORMAL;
}  /* cleanup */
 
 
Greg Bishop				Internet: GBISHOP@AC.NSAC.NS.CA
System Manager				Voice:    (902) 893-6693
Nova Scotia Agricultural College
Truro, Nova Scotia
CANADA   B2N 5E3
