GETMAIL.CMD - an ka9q compatible OS/2 smtp daemon
Copyright (C) 1995,1996 Alex Chapman <alex@budgetweb.com>

--
Introduction

This is a primitive smtp daemon.  It is my first attempt to write such
a program, and there are bound to be functions which I have not implemented
and matters that I have misunderstood from the rfc.

It presently does not lock mail boxes, and cannot handle a rewrite file.

This program is written in OS/2 Rexx and uses the RxSock DLL provided
in the rxsock.zip package on IBM Employee Written Software.

Writing this in REXX has advantages and disadvantages.  Rexx is not the
speediest of languages, but neither is it sluggish.  And considering most
of the users will be sending mail over a 14400 modem, this program is
unlikely to be the bottleneck.  Also, the code can be examined freely by
users, and modified if they so desire.

If you do come up with a neat enhancement, please don't keep it to yourself.
Send the modified code to me, and I will look at including it in the next
release.

---
Installation

1 Copy rxsock.dll from rxsock.zip into os2\dll (in LIBPATH)
  RxSock is IBM Employee-Written-Software, and can be downloaded from
  <ftp://src.doc.ic.ac.uk/packages/os2/ibm/ews/rxsock.zip>

2 Put getmail.cmd somewhere in your PATH

3 Put getmail.ini somewhere on your PATH and modify the values to reflect
  your system setup:
   If you are using CPPNEWS/SNEWS/PCELM etc. then you should make sure that
   the KA9Q_DELIVER and MAILBOX are set correctly
   If you are using PMMAIL+POP3D then you should make sure that POP_DELIVER
   and POP_MAILBOX are set correctly

4 Make sure that you have a record for your own host in your etc/hosts
  file (c:\tcpip\etc\hosts).  It should look something like the following
  with your ip address, hostname etc.

158.152.42.231  mercer.demon.co.uk  mercer

5 Start getmail before connecting

6 When you connect it should automatically collect any outstanding mail

---
Trouble shooting

If you start this program from a dialing script run by SLIPPM, then
the output will be sent to the SLIPPM status window, which is difficult to
read.  To prevent this, use the /I parameter on the START command.

You might still get errors on starting getmail offline, in which case you
need to issue the following command

ifconfig lo 158.152.42.231

again changing the ip address to whatever your ip address is.  ('lo' is ell-
ohh and not ell-zero in the 'ifconfig lo' command)

two sample alias files have been included called alias.1 and alias.2 there
are comments in each to indicate how they can be used

---
Bugs

   Report to alex@budgetweb.com, including as a minimum, the
   version of getmail and a copy of the getmail.log which should have
   been created in the directory where getmail was executed.  Other
   useful files are the /nos/alias and /nos/spool/mqueue/sequence.seq

---
Planned Enhancements

   handle kill file to discard mail items from unwanted senders

   handle return-receipt-to: header lines

   Report the correct time zone fetched from the environment variable
   TZ or GTZ on the RECEIVED: line added to the note, rather than hard
   coding to GMT which it presently does.

   Add time and date to the messages displayed, and check all messages are
   logged in the event of running detached.

   Alias file handling is kind-of overriden for POP_DELIVER and PRM_DELIVER,
   should probably revisit this, at least for PRM, and come up with some
   sensible scheme for deciding valid in baskets (like all the subdirectories
   from the PRM_ROOT directory).

   ini files are assumed to be written with values in upper case (for things
   like YES and NO).  This should be changed so that it can handle mixed case.

   add option to allow all mail addressed to _any_ host to be received

   lock mailboxes (i.e. create alex.lck when writing to alex.txt)

   rather than read the ini file, and set rexx variables by the name of the
   variables specified in the ini, it would be safer to put them into a
   stem variable.  So upon reading 'queue_name = WARPDIS' from the ini file
   it should record the value in 'ini.queue_name' rather than 'queue_name'.
   This would also allow for checking whether a variable has been set, by
   presetting the whole ini stem to a given value e.g. 'ini. = "!empty"'
