Subject: UNIX <--> DOS gateway using procmail?

From: Dave Carre <[email-masked]>
Date: Mon, 5 Sep 1994 17:16:23 -0400 (EDT)

My basic question is:  Is PROCMAIL the best way to divert mail in the
implementation of a UNIX (Internet host) to DOS (private satellite network)
gateway? 

First, I'll describe the context of the gateway.  Volunteers in Technical
Assistance (VITA) operates a private communications network with global
coverage that uses a single Low Earth Orbit Satellite (VITASat) and DOS-based
ground stations.  This network provides low-throughput email connectivity for
people and organizations working for humanitarian purposes in countries and
regions where telephone communications are unreliable or non-existent.  We
want to provide Internet email & conferencing connectivity to these users. 

VITA has recently established a full Internet host (vita.org) at their
headquarters in Arlington, Virginia, USA, which is running on an Apple Quadra
(mc68040) running A/UX 3.0.2 SVR2 & using SENDMAIL.  The satellite network
operates on ground stations which are PC-DOS based.  We want to establish an
email gateway between VITA's Internet host to its DOS ground station (already
connected by ether).  I developed the DOS-based ground station software, but
am inexperienced in UNIX, so I would very much appreciate some advice on
whether PROCMAIL is the way to go.  VITA's system administrator is still
learning about UNIX and the Internet, as well, and is wary of adding 
another utility (& cron job, etc.) to the system when SENDMAIL might do 
the job more cleanly from a sysadmin's point of view. 

We can transfer files using RCP & RSH (Novell Workplace for DOS).  It seems
easiest to have the DOS gateway machine initiate all the file tranfers in
both directions and do the file format conversions (to and from RFC-821). 
I've gotten the file transfers to work, but I don't know how to set up the
Internet host to divert mail to/from the DOS machine. 

It took me a day and a half of head-scratching before I finally managed to
make PROCMAIL 3.05 last week (basically, to figure out that cc wouldn't do it
and that I needed to use gcc instead), and I'm even more confused about how
to configure PROCMAIL to do what we need (or if it does anything for us that
SENDMAIL won't do just as well), so I solicit the advice of the experienced
users.  Perhaps tweaking SENDMAIL is all that's needed, but after several
hours of reading the O'Reilly Nutshell book on SENDMAIL, I'm not sure about
that one either. 

Here's what I am aiming for:  Every piece of mail addressed to

     [email-masked]

will reach the vita.org host (which runs its own name server) and get placed
as a separate file in the subdirectory named

     /u/vitasat/to_dos/

using some unique filename, and with the destination address changed to
"any_user".  It should also be able to handle any standard variations on that
addressing format (such as bang paths) that could be received from other
Internet users. 

And every piece of mail from the VITAsat network that is destined for the
Internet would be placed by the DOS machine into /u/vitasat/to_internet/ (on
the vita.org host) using some unique filename (and I also need to figure out
the best way to create the header for that file so that it is Internet
compliant), and will be subsequently picked up by the vita.org mail transfer
agent and sent off. 

Should I bother using PROCMAIL for this, and if so, how?  I have read all the
man pages (for an older version dated 1992/06/03, since make failed to make
the man pages on this machine), but am still having difficulty figuring out
how to do this.  Any advice on this would be greatly appreciated.  And if
there's anyone out there with a good, general knowledge of the interactions
between UNIX/Sendmail/procmail who wouldn't mind a few questions from a
novice over private email or telephone, please let me know - I'd be grateful
for the help. 

Thanks,
Dave Carre
[email-masked]

---

From: [email-masked] (Stephen R. van den Berg)
Date: Tue, 6 Sep 1994 19:52:16 +0200

>(mc68040) running A/UX 3.0.2 SVR2 & using SENDMAIL.  The satellite network

Sendmail v8.6.9 I presume (although that is not absolutely critical in
your case).

>make PROCMAIL 3.05 last week (basically, to figure out that cc wouldn't do it

You don't happen to have a make log you could mail me (not to the procmail
list), do you?

>addressing format (such as bang paths) that could be received from other

Sendmail takes perfectly good care of the various addressing schemes,
procmail is best suited to do the actual filing.

>Should I bother using PROCMAIL for this, and if so, how?  I have read all the

You can do this, you'll have to make sure that the envelope sender and
recipient addresses aren't lost in the transition from sendmail to
procmail though.  Other than that, it's not so difficult at all.
The actual implementation would require the Mprocmail mailer in the
sendmail.cf file similar to the example in the procmail man page.
The sendmail.cf file should then resolve any addresses aimed at the PC network
to the Mprocmail mailer.  The actual procmailrcfile needed to do the
filing can be very simple, something like:

	SENDER="$1"			# get envelope sender from sendmail
	RECIPIENT="$2"			# get envelope recipient from sendmail
					# put them in an extra header
	:0 fwh
        | echo "MAIL_FROM: $SENDER"; echo "RCPT_TO: $RECIPIENT"; \
	  echo ""; cat 

	:0
	/u/vitasat/to_dos			# deliver to a unique file

However, as a totally different solution, have you looked at how
POP-based packages or Pegasus mail handle it?

-- 
Sincerely,                                  [email-masked]
           Stephen R. van den Berg (AKA BuGless).

Time is nature's way of making sure everything doesn't happen at once.