From: im@cmr.no (Ingolf Magnus)
Subject: MSMail <--> SMTP (Was: Re: TCP/IP, WFW, ethernet, and internet mail)
Organization: Christian Michelsen Research a.s., Norway
Date: Tue, 22 Dec 92 14:03:36 GMT

In article <rick.104.724358768@sjsumcs.sjsu.edu>, rick@sjsumcs.sjsu.edu (Richard M. Warner) says:
>
>In article <8892@lee.SEAS.UCLA.EDU> weiss@curtiss.seas.ucla.edu (Michael Weiss) writes:

(stuff deleted)

>>In article <1fvotcINNnq8@tamsun.tamu.edu> cmenzel@tamsun.tamu.edu (Chris Menzel) writes:
>>>Will WFW allow one using a PC on a campus ethernet to use Microsoft
>>>mail (which, I understand, is bundled with WFW) to send and receive
>>>internet mail directly?  Thanx.
>>
>>The answer is "yes," IF:
>>1)  a mail server is used on that LAN
>>           -AND-
>>2)  an Internet gateway is added to the mail server.
>
>I.e., the answer is NO.  Note the original question included the word
>'directly' - which implies no intermediate mailer and no gateway.
> 
>>-  Michael  weiss@seas.ucla.edu   |  School of Engineering & Applied Science  -
>>-   Weiss   izzydp5@oac.ucla.edu  |   University of California, Los Angeles   -

A few facts:
 - MS Mail always uses a file server share name, like \\MAILHOST\MSMAIL for spooling local mail
 - An organization doing Internet mail needs a separate mail server for two purposes:
   (this is true for both UNIX-only and mixed UNIX/Windows networks)
   - Receiving SMTP mail on behalf of all users, no matter what machine they use
   - Queueing outbound mail that can't be delivered at once.

==> There is need for both a mail server and an Internet mail host. It could be the same machine,
        doing both file serving and TCP/IP comms. 

The routing of messages between MS Mail and SMTP can be done in at least two ways:
1. Installing a separete gateway PC, acting as a client to both the MSMail post office and the
    SMTP mail server. This would poll and move messages between the two worlds at frequent
    intervals, e.g. each 5 minutes.
2. If the PCs have TCP/IP stacks, install a Transport Service for MSMail, letting each MSMail 
    instance poll for, and deliver, mail to/from the SMTP server.

Alternative 1 is available (at least in Norway) as the Microsoft SMTP Gateway product. It costs
around USD 7.000,- (Yep, seven-zero-zero-zero). Or, one can purchase the FFAPI (File Format
API) from MS at around USD 300,-. it consist of a large set of DOS .EXE modules that one can
combine in .BAT files to construct a gateway mechanism. It can read and write directly to the
MS post office, but I guess one has to write the SMTP/POP socket code oneself, in DOS.

Alternative 2 is the most elegant, and it is software-only. The Microsoft MAPI (Message API) 
describes how to write a Transport Service (TS), using the SPI (Service Provider Interface, part of
MAPI). The TS is written as a  .DLL, and a reference to this DLL is registered in MSMAIL.INI
(or some other INI file). So, each time MSMail starts, it will ask this DLL what kind of mail it accepts,
and then provide the user with a logon message for that transport (can be remembered for
future logons). This would be the user's UNIX userid and password. The DLL can verify this with 
the SMTP server, using POP. When logged into the tranport, MSMail will call the TS's Poll routine
regularly, and the TS will in turn poll to the POP service on the mail server.
At an SMTP mail arrival, the poll will say 'Yes!' and MSMail will issue calls to get the message and
its properties.  The TS can retrieve the mail via POP. 
Sending mail to SMTP is just as smooth: Ther users define their SMTP friends
in the address book, with address SMTP/user@org.xxx instead of MSMAIL/....  The TS registed 
itself as tranport for SMTP/... mails at startup, so MSMail will call it to deliver the message, with
properties, body, and attachments. The TS converts useful things to ASCII, drops the rest, and
delivers the mail to the SMTP server, using SMTP.  The advanced version of this would uucode
attachments, and uudecode blocks in incoming mail, converting them to attachments.
Of course it would be nice to use the WinSock API for SMTP and POP communications.

WELL, HAS ANYBODY DONE THIS ALREADY? I'm inspired to do it, but time doesn't allow me
right now.

Btw, is the MSMail bundled with WfWG in any way crippled (as to e.g. MAPI usage), 
or is it full 3.0 ?


--Ingolf Magnus      <im@cmr.no>