home *** CD-ROM | disk | FTP | other *** search
- @(#)@ INSTALL 3.14 - INSTALL
-
- Installation
- ============
-
- 1. Preparation
-
- As distributed, perl is expected to reside in /usr/local/bin. You
- can change this in the Makefile if your perl resides somewhere
- else.
-
- The mail server needs a user id to own the programs, and a place
- where the programs and files can be stored.
- Pre-configured values are "mserv" and "/usr/local/lib/mserv"
- respectively. We'll call the library LIBDIR in this document.
- LIBDIR could be the HOME directory of the mail server owner, but it
- need not.
- If you prefer a different value for LIBDIR, change the appropriate
- line in the Makefile.
- The name of the mail server owner can be changed in step 2, as
- described below.
-
- Since all messages sent by the mail server are sent under the
- server owner uid, its full name (the GCOS or comment field in
- /etc/passwd) should be descriptive.
-
- The mail server owner does not need any privileges, except for
- read access to the archives, and read/write access to LIBDIR.
-
- Do not use the root account for server owner!
-
- 2. Configure and build
-
- Tailor "mserv_config.pl" to reflect your specific needs. It has
- extensive descriptions for configuration variables and values.
- Do not forget to tailor the Makefile also, if needed.
-
- It may be a good habit to generate differences using the 'diff'
- program so you can apply your modifications to a new version of
- the mail server software easily.
-
- Issue "make" to prepare the programs.
-
- If you select the index file feature, you need GNU find / locate.
- As of GNU find version 3.6, you can use the locate program 'as is'.
- For version 3.5, change GNUFIND in the Makefile to designate where
- your GNU find sourcetree is, and issue "make ixlookup".
- This will build a customized version of GNU locate, called
- "ixlookup".
-
- Issue "make listener" to generate and compile the listener
- program. This command uses mserv_config.pl (from the current
- directory) to determine how to build the listener program.
-
- 3. Installation
-
- Now "su mserv" and execute "make install".
-
- This will install all programs and files in LIBDIR.
- It will not install programs ixlookup and listener, since they
- need special treatment.
-
- If you select the index file feature, issue "make install-ixlookup"
- if you need the customized version of GNU locate 3.5.
- Note that whoever creates the index files, must have write access
- to the location the index files are stored.
-
- If you configured the listener to use the setruid/setrgid system
- calls, you need to "su mserv" before executing "make
- install-listener".
-
- If you do not have setruid/setrgid, the program must be installed
- setuid root. In this case, you have to "su root" before doing
- "make install-listener". Look at the source of the listener.c
- program to verify it will not harm your system security.
-
- 4. Adding aliases
-
- Create a suitable alias in /usr/lib/aliases (or wherever your
- aliases are kept):
-
- mail-server : "|LIBDIR/listener"
-
- To get rid of bounced mail, the mail server fakes "bit-bucket" as
- its return address. To avoid bounced mails filling your
- filesystems, add another alias:
-
- bit-bucket: /dev/null
-
- 5. Verification of the installation
-
- All the following steps should be executed under the mail server
- owner!
-
- * Run program LIBDIR/chkconfig. It shows most of the
- configuration values, and verifies the existence of files and
- programs.
-
- You may need to run the perl tool "h2ph" to supply system
- include files needed for locking.
-
- * Verify your locking strategy. Execute
-
- % perl -s testlock.pl -test1 &
-
- It should say "Got the lock -- waiting ...".
- Now execute
-
- % perl -s testlock.pl -test2 &
-
- It should say "Good. Could not lock -- waiting ...".
- Now kill the first process. The second process should print "ret = 1"
- and exit.
-
- * Verify the working of the "dorequest" program:
-
- % LIBDIR/dorequest <youraddress> <arealfile>
-
- You should receive mail(s) containing the indicated file.
- NOTE: If your site is running sendmail, the mail(s) are queued
- for delivery. They can take some time before they arrive,
- depoending on how often the sendmail queue is run.
- You may want to inspect the sendmail queue to see if your
- mail(s) are in it.
-
- If no mail(s) arrive, try
-
- % LIBDIR/dorequest -debug <youraddress> <arealfile>
-
- and see what happens.
-
- * Execute the "process" script by hand:
-
- % LIBDIR/process
- From bla
- From: <youraddress>
-
- test
- send HELP
- end
-
- (The program should terminate after processing the "end"
- command).
- Now you should receive a mail (from yourself!) telling that your
- request has been processed.
- NOTE: If your site is running sendmail, and sendmail is
- configured to use 'queued' delivery, the mail(s) are not
- delivered immediately.
- You may want to inspect the sendmail queue to see if your
- mail is in it, or run the queue by hand.
-
- In case of trouble: run LIBDIR/process with "-debug" to find out
- what happens.
-
- * Execute the "process" script again with the same input, but
- leave out the line "test".
-
- Again you should receive a mail (from yourself!) telling that your
- request has been processed. It should also tell you that your
- request has been queued.
-
- If you configured $auto_runrequest, program "dorequest" will be
- run to handle your request. You should receive a mail with the
- requested file.
-
- In case of trouble: run LIBDIR/process with "-debug" to find out
- what happens. This will prevent "dorequest" from being invoked,
- so you can study the contents of LIBDIR/queue.
-
- * Execute the "listener" program with the same input.
-
- Again you should receive a mail message.
-
- If you configured $auto_runrequest, program "dorequest" will be
- run to handle your request. You should receive a mail with the
- requested file.
-
- * As another user, run the "listener" program with the same input.
-
- Again you should receive a mail, still originating from the
- mail server owner.
-
- * Still going strong? Now, as another user, send a mail message to
- your mail server:
-
- % mail mail-server
- send foo bar INDEX
- end
- ^D
-
- (Mail programs usually do not terminate after reading the "end"
- line. Issue Control-D or whatever you local EndOfFile setting is).
-
- You will receive a return mail, indicating which archive entries
- were found, and how they would be transmitted.
-
- * If you did not configure $auto_runrequest, change back to the
- mail server user, and inspect LIBDIR/queue to see that your
- request is in it.
- Run LIBDIR/dorequest without arguments; the selected file should
- be sent to you by email.
-
- If you receive the requests, your mail server is fully
- operational!
-
- 6. If you don't want to keep of log of transactions, remove the file
- "LIBDIR/logfile" that was created by the Makefile.
-
- 7. As a service: place the files "HELP" and "unpack.pl" in one of
- your archives. The Makefile prepares PUBDIR (defaults to
- LIBDIR/pub) for this purpose.
-
- Also, supply shar-files with the btoa/atob handling
- programs, uudecode/uuencode, and compress/uncompress.
-
- The contents of file LIBDIR/mserv.notes is prepended to every
- reply the mail server sends. This file can be used to supply a
- daily message about the server, new entries, etc.
-
- The contents of file LIBDIR/mserv.hints is appended to every reply
- the mail server sends.
-
- Make sure your archives have a decent copy of Dumas uud/uue and
- xxencode/xxdecode if you intent to support these.
- Likewise, zoo, zip, etc.
-
- Also, provide a file "INDEX" that more or less describes what is
- in your archives. People are going to ask for it.
-
- Since people usually don't read the documentation, link "help" to
- "HELP", "index" to "INDEX", "atob.shar" to "btoa.shar", etc.
-
- 8. Install crontab entries for the mail server processes. A sample
- crontab is included in the distribution as CRONTAB.sample.
-
- 30 0,2,4,6,18,20,22 * * * LIBDIR/do_runq
- 0 3 * * * LIBDIR/makeindex
- 0 7 * * * LIBDIR/do_report -errors -since .errrun
- 10 7 * * 7 LIBDIR/do_report -full -collect
-
- The above example runs the mail server queue every two hours,
- except during working hours. Once a day any mail server errors are
- reported, once a week the logfile data is accumulated and a usage
- report is generated.
-
- CHECK AND MODIFY THESE SCRIPTS SINCE THEY WILL PROBABLY NOT
- DO WHAT YOU WANT!
-
- Every night a three o'clock new index files are generated. You may
- leave this line out if you do not use index files.
-
- If you configured auto_runrequest in mserv_common.pl, there is no
- need to run the queue that often; once or twice a day will be
- sufficient.
-
- Interaction of programs
- =======================
-
- An email message directed to the mail server will be passed to program
- `listener'. This program disguises itself as the mail server owner and
- executes `process'.
-
- `process' parses the mail message, and extracts commands. Requests are
- looked up, and --if viable-- written to the mail server queue.
-
- Some other time, `dorequest' will be run, either automatically from
- `process' or via cron. This program will lock the queue and read all
- entries from it. It will also read any pending entries in queue~. Then
- it will empty the queue and release it. Next, it will handle all
- entries it has read. Before handling a request, all in-core entries
- are written to file queue~ just in case the system goes down.
- Upon completion of a request, a logfile entry is written and the
- request is removed from memory. Upon sucessful completion of
- `dorequest' the file queue~ will be removed.
-
- Each queue entry takes one record from the queue file, with space
- separated files as follows:
-
- type M for email, U for UUCP transfer, MP for packed email,
- UP for packed UUCP.
- recipient the reply address used
- destination (type M* only): email address
- host!path (type U* only) UUCP host and path
- notify (type U* only) UUCP notification user
- request the request
- file the name of the file
- encoding (type M* only) encoding (B = btoa, U = uuencode, X = xxencode,
- D = Dumas' uue)
- limit max size (in Kb) per chunk
- parts comma-separated parts list.
-
- Logging
- =======
-
- If you select logging, all transfers that are sent are logged in the
- logfile. Each record has a number of (space separated) fields as
- follows:
-
- date e.g. 920501
- time e.g. 15:22
- type M for email, U for UUCP transfer
- destination email address, or host!notify for UUCP transfers
- request the name of the requested file
- Xnn/mm X = encoding (B = btoa, U = uuencode, X = xxencode,
- D = Dumas' uue)
- Note: no encoding is specfied for UUCP transfers.
- nn/mm = part nn of mm parts
- size the size of the transfer
-
- The programs report.pl and do_report.pl can be used to generate
- reports from the logfile.
-
- Errors are logged with type `F'. The remainder of the record contains
- the error message.
- If an error is detected due to a user request, the queue entry for
- this request is entered in the logfile with type `Q'.
- If the failure is temporary, the queue entry can be extracted from the
- logfile and added to the queue (or better: queue~) file.
-
- do_report.pl can also be used to cleanup the logfile.
-
- Design and Maintenance of the Archives
- ======================================
-
- The mail server software can handle multiple archive directories.
- Every directory specified in @libdirs is treated equal.
-
- Please consider the following points:
-
- - Hidden files (filenames starting with `.') and files that are not
- readable to `mserv' cannot be retrieved. They might show in the
- index, however.
-
- - If a file occurs multiple (e.g. "INDEX" in more than one archive
- directory) the first occurrence is retrieved.
-
- - If a directory occurs multiple it can not be retrieved.
-
- - For best results: name archives similar to "foo-XXX.tar.Z", where
- XXX is a version number, e.g. emacs-18.58.tar.Z or xdvi-12.zoo.
- This will aid people in finding the right version for a specific
- archive entry.
-
- Please share your experiences and programs.
-
- Good Luck!
-
- Johan Vromans
- Multihouse Research
- Doesburgweg 7
- 2803 PL Gouda
- The Netherlands
- Phone: +31 1820 62911
- E-mail: jv@mh.nl
-