home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / MSDOS / WATTCP / SMTPSERV.ZIP / SMTPSERV.DOC < prev    next >
Encoding:
Text File  |  1992-04-06  |  9.0 KB  |  222 lines

  1.                               SMTPSERV
  2.                         A Simple SMTP Server
  3.  
  4. SMTPSERV is a program which runs on your pc and allows it to accept SMTP
  5. based mail from other sources, even from several sources at one time.
  6.  
  7. Introduction:
  8.     On the Internet, mail is usually transferred using SMTP (Simple Mail
  9.     Transfer Protocol).  The mail sender's computer simply calls up the
  10.     receiver's computer (where something like SMTPSERV is running) and
  11.     asks it to accept the mail on behalf of the receiver.
  12.  
  13.     With PC networks, SMTP service is not as easy since the receiver's
  14.     personal computer is not usually running a program like SMTPSERV
  15.     or it may even be turned off.  This makes it pretty hard to send
  16.     mail to the pc user!
  17.  
  18.     There are several workarounds, such as sending all the person's Email
  19.     to their UNIX account, but many sites simply wish or need to have their
  20.     mail handled by pcs.
  21.  
  22.     The classic way of doing this is to have a mail gateway, a machine
  23.     which is always running a program which waits for incoming mail.  This
  24.     machine (or another) will then convert the mail into a format usable
  25.     for on it's local network.
  26.  
  27.     Brad Clemments' CHARON gateway does an excellent job of this for Novell
  28.     Netware users.  Check it out via anonymous ftp to omnigate.clarkson.edu
  29.     if you are running Netware.
  30.  
  31.     Most other mail gateways are more generic, i.e. they don't know how to
  32.     send mail on the local network.  Instead, they simply accept mail and
  33.     place it into a subdirectory repository from which users or another pc
  34.     (or another task) must sort out for whom the mail is destined.
  35.  
  36.     SMTPSERV fits in this latter class along with Phil Karn's NOS and the
  37.     commercial SMTPSRV (FTP Software, approx $400).
  38.  
  39.     Phil's program is free and incredibly flexible but is not usable by
  40.     anyone other than educational institutions or for the private use of
  41.     amateur radio operators.
  42.  
  43.     We originally used NOS but found it unable to handle our high message
  44.     load reliably (avg. about 2000 inbound per day).  With that sort of
  45.     average load, you can immagine that several hosts were typically SMTPing
  46.     in similtaneously.  As FTP's product only allows a single incomming
  47.     session at a time, it offerred no hope.  We could have developed our
  48.     own using the FTP toolkit, but that would require other sites to also
  49.     purchase FTP's kernal to use our product.
  50.  
  51.     SMTPSERV was designed as a direct replacement for NOS (in this SMTPD
  52.     mode), so it uses similar file naming conventions.  BTW, the similarity
  53.     is only in the function, the internals are radically different.
  54.  
  55.     So, in summary, SMTPSERV simply accepts inbound mail and places it into
  56.     a single subdirectory.
  57.  
  58.     It does not:
  59.         forward mail            sort mail by userid         notify users
  60.         notify users            fail if invalid userid      transmit mail (yet)
  61.  
  62.                               - - -
  63.  
  64. Details:
  65.  
  66.     SMTPSERV works by allocating several tcp sockets so it can accept multiple
  67.     connections.  Each socket is managed independantly and one slow connection
  68.     will not affect the performance of other zippy connections.  Currently
  69.     the system supports a maximum of about 15 sessions - this is a DOS
  70.     file limit (actually, just an annoyance, I will be increasing that number).
  71.  
  72.     Inbound messages are assigned a unique 32 bit message number.  The numbers
  73.     will not necessarily be consequetive integers though they will be ascending
  74.     until you hit the 2^32 messages wraparound.  When a message is being
  75.     received, SMTPSERV will initially attempt to create two files:
  76.  
  77.         xxx.CMD     containing From: and To: directives
  78.         xxx.TMP     containing the body of the message
  79.  
  80.     Eg. Message 5321 would generate the following intermediate files:
  81.  
  82.       +-5321.CMD---------+  +--5321.TMP----------------------------------+
  83.       |From: erick@maggot|  |Received: from maggot by gnat with SMTP     |
  84.       |To: bruce@gnat    |  |       id A5321 ; Fri, 20 Dec 91 23:03:48   |
  85.       +------------------+  |Date: Fri, 20 Dec 91 15:05:49 -0800         |
  86.                             |From: erick@maggot                          |
  87.                             |To: bruce@gnat                              |
  88.                             |                                            |
  89.                             |Beers?                                      |
  90.                             +--------------------------------------------+
  91.  
  92.     If the message is successfully received, the files are renamed:
  93.         xxx.CMD  ------>   xxx.WRK
  94.         xxx.TMP  ------>   xxx.TXT
  95.     With the CMD file being renamed last - ie. if you see a WRK file, you can
  96.     process it delete it, or do whatever you wish.
  97.  
  98.     If the message was not successfully received, SMTPSERV deletes all the
  99.     files related to that message.
  100.  
  101.     When parsing the .WRK file, ensure you do the following things:
  102.  
  103.         1) Check for multiple To: lines, this is called mail exploding,
  104.            you must send a copy to each intended recipient
  105.  
  106.         2) Return an error message to the sender if any one of the
  107.            intended recipients will not receive the mail
  108.  
  109.         3) Send mail destined to the local postmaster account actually
  110.            go to someone.
  111.  
  112.  
  113.  
  114.                                - - -
  115.  
  116. Installation:
  117.  
  118. To use SMTPSERV you must create a valid WATTCP.CFG file as described
  119. in the documentation available in the standard WATTCP installation notes
  120. (location given at end of this document).
  121.  
  122. There are some parameters which are peculiar to SMTPSERV or perhaps just a
  123. little more important when SMTPSERV is in use.
  124.  
  125. smtp.sessions=numsessions
  126.  
  127.     The default value is 8, but it should work fine up to about 15.  I
  128.     currently use 12.  The limit of 15 comes from 20 dos file handles
  129.     minus standard io, standard error, standard prn, etc.  This limit will
  130.     probably be changed at a later date.
  131.  
  132.     eg. smtp.sessions=12
  133.  
  134.     NOTE: YOU SHOULD HAVE THE FOLLOWING LINES IN YOUR CONFIG.SYS
  135.     (you can use larger values if you wish)
  136.         FILES=20
  137.         BUFFERS=20
  138.  
  139.  
  140. smtp.subdir=pathname
  141.     The newly received files must be stored somewhere.  Select a subdirectory
  142.     where they will not be inconvienenced.  You really should give a
  143.     full path specifier including drive: and a path from the root directory.
  144.  
  145.     eg. smtp.subdir=n:\spool\rqueue
  146.  
  147.  
  148. inactive=seconds
  149.  
  150.     The inactive value tells WATTCP to give up if its partner does not
  151.     do anything within a certain period of time.  This is not a keepalive,
  152.     it is an inactivity timeout, WATTCP makes no attempt to correspond
  153.     with the partner except to hangup.  A good value for inactive is
  154.     1200 seconds or 20 minutes
  155.  
  156.     eg. inactive=1200   ; 20 minutes
  157.  
  158.  
  159. mss=bytes
  160.     The maximum segment size should be made small enough that ip packets
  161.     will not become fragmented.  A good value is 500 bytes.
  162.  
  163.     eg. mss=500
  164.  
  165.  
  166. hostname=name
  167.     The mail server really should be given a name and told its name.
  168.  
  169.     eg. hostname=snail
  170.  
  171.  
  172. domain=name
  173.     This too should be set.
  174.  
  175.     eg. domain=uwaterloo.ca
  176.  
  177.  
  178. You must also load a packet driver for your netword card.  If you don't
  179. know what I mean by that, ftp the notes described at the end of this doc.
  180.  
  181.                                    - - -
  182.  
  183. Sample WATTCP.CFG file, you will have to configure one for your machine.
  184.  
  185. my_ip=129.97.176.99         # set ip address
  186. netmask=255.255.254.0       # 23 bit subnet mask
  187. nameserver=129.97.129.140   # primary and
  188. nameserver=129.97.128.196   #    secondary nameservers
  189. gateway=129.97.176.1        # my gateway to the world
  190.                             # for advanced subnetting details see the complete
  191.                             # wattcp installation guide ftpable from
  192.                             # sunee.uwaterloo.ca in pub/wattcp/apps.zip
  193. domainslist="watstar.uwaterloo.ca"
  194. inactive=1200
  195. hostname=maggot
  196. smtp.subdir=n:\spool\rqueue
  197. smtp.sessions=12
  198.  
  199.                                    - - -
  200.  
  201. More Information:
  202.  
  203.     SMTPSERV was written using the WATTCP TCP/IP communications library
  204.     in about 500 lines of C code.  WATTCP handles most of the complexities
  205.     of network communciations so the programmer can concentrate on the
  206.     data rather than the connection.
  207.  
  208.     If you have any suggestions on how SMTPSERV can be improved, please
  209.     let me know.  The next planned addition is an outbound mail service
  210.     (like Karn's embedded one).  Once that's in place I will be calling up
  211.     the Paegus mail folks to see how we can get our two programs to work
  212.     together.
  213.  
  214.     For some other free and neat examples of WATTCP based network
  215.     applications anonymous ftp to sunee.uwaterloo.ca and read
  216.     pub/wattcp/README try out the new MSKermit 3.11 with TELNET capabilities.
  217.  
  218.     Details on packet drivers and indepth configuration notices are
  219.     available via anonymous ftp to sunee.uwaterloo.ca in pub/wattcp/apps.zip
  220.  
  221. Erick
  222.