This is my replacement for the MAIL-11 to RFC822 mail gateway supplied with
Digital's DECnet-Ultrix product.  It should also run on Sun systems running
SunLink/DNI.

I wrote this because, as network postmaster, I was having entirely too many
problems with mail traffic generated by DEC's mail11d gateway.  In
particular, many RFC822 mail user agents choke when trying to generate
replies to addresses of the form @device:[directory]filename.type (left
over from VMS MAIL To: lines), and because mail forwarded from other
networks through a VMS node (using e.g., JNET, WIN/TCP, or PMDF) could not
be replied to.

The mail11dv3 program supplied with DECnet-Ultrix version 3.0 supports a
few features that this program does not yet support, including DDIF
document conversion.  On the other hand, this gateway program is
documented, works on Suns as well as DEC machines, is available in source
form, and (above all) implements a minimal functioning gateway correctly.

The gateway is currently being used on two DECnet-Ultrix systems.  Minimal
testing has also been done on a Sun-3 running SunOS 3.5 and Sunlink/DNI
5.0.  I haven't tried it with 6.0, but it looks like you would just have to
change "dna" to "dni" in several places in sunlink-dni.c.

mail11d is known to interoperate with VMS MAIL 4.7 and 5.0, and the mail11
gateway supplied with DECnet-Ultrix 3.0.

Enhancements and bug reports are appreciated.  Please send them to

moore@utkcs2.cs.utk.edu (Internet)
MOORE@UTKVX (BITNET)
{gatech,uunet}!utkcs2.cs.utk.edu!moore (UUCP)

Keith Moore
University of Tennessee Computer Science Department
107 Ayres Hall
Knoxville, Tennessee 37996-1301


INSTALLATION:

1.  You will probably need to edit the Makefile to set a few variables:

CC is the C compiler.  I've used gcc to develop this program, but there's
no reason why it couldn't work with vanilla cc with a few changes.

SMTP can be either smtp-tcp-bsd, which will cause mail11d to open up a
TCP/IP connection to the local SMTP daemon, or it can be
smtp-pipe-sendmail, which will cause mail11d to fork and exec sendmail in
SMTP mode, with pipes connected to stdin and stdout.  smtp-tcp-bsd should
work with any SMTP server, while smtp-pipe-sendmail requires sendmail or a
reasonable facsimile thereof.  smtp-pipe-sendmail is more reliable since
it can't be shut out by the sendmail 'x' or 'X' options, and it is faster
since all the running sendmail server is going to do is fork, which you
can do yourself by vforking execing sendmail with the -bs option.

DECNET should be decnet-ultrix if you are on a VAX running Ultrix, or
sunlink-dni if you are on a Sun running Sunlink/DNI.

LIBS should be -ldnet on a Ultrix 3.0 or later system.

2.  Type make.

3.  Copy the binary (named utk-mail11d) to an appropriate directory.  We
use /usr/local/lib.  You might want to wrap utk-mail11d in an executable
shell script, so you can set up some environment variables (or command-line
options in the DEC version of this software).  You can set the variable
MAIL11D_DEBUG (or the -debug_file command-line option) to the name of a
file to which debugging info will be written.  See mail11d.sh.* for an
example.

You might want to install the man page in an appropriate place.

For Ultrix systems:

4.  Run ncp to install the binary.  Assuming you name either the
binary or the executable shell script "mail11d", this would look like:

	# ncp
	ncp> clear object mail11
	ncp> set object mail11 number 27 file /usr/local/lib/mail11d \
		default user daemon type sequenced packet accept deferred
	ncp> show object mail11 characteristics
	ncp> ^D

5.  Log on to a remote system and try to send mail to the gateway.  For
example, if you've just installed mail11d on DECnet node "FOO", log on to
some other DECnet node, and send mail to FOO::USER.  Or you can send mail
to FOO::"quoted-string", where quoted-string is any address that FOO's
mailer will accept.  (This example assumes that you're sending from a VMS
machine

6.  Once you trust the daemon, repeat step 4, substituting "purge" for
"clear", "define" for "set", and "list" for "show".  This will preserve the
new setting across reboots.

For SunOS systems:

4.  Add the following line to /usr/sunlink/dna/dnaserver.reg:
( or /usr/sunlink/dni/dniserver.reg, as appropriate )

27 MAIL /usr/local/lib/mail11d

You will probably need to kill and restart dn[ai]server, or simply
reboot your system.

5.  Log on to a remote system and try to send mail to the gateway.


TESTING:

Here's how to try this out without actually installing it:
(This only works on Ultrix systems)

1,  On UNIX, copy the compiled version of this program (or an executable
shell script that calls it) into your home directory, with the name
MAIL11D (upper case is important).

2.  On VMS, define the following logical name:

$ define MAIL$PROTOCOL_TEST "%UNIX::""user password""::""0=MAIL11D"""

where UNIX is the DECnet node name of your UNIX system running the gateway,
user is your username there, and password is your password.

You can then use VMS MAIL to send to an address like:

TEST::USER or TEST::"string"

which will invoke the gateway without actually installing it for general
use.

3.  Finally, if you use an executable shell script to call the gateway
program, and you have compiled mail11d with the -DDEBUG option, you can
define the MAIL11D_DEBUG environment variable to be the name of a file
(or terminal) that you'd like trace information written to.
