ZMAILER(1zm)                                                      ZMAILER(1zm)



NAME
       zmailer - zmailer control script

SYNOPSIS
       zmailer [--zconfig /mail/zmailer-x.conf] [[-q] [kill|nuke|stop] [start]
               [router] [scheduler] [smtpserver] [newdb] [newaliases]  [resub-
               mit] [bootclean] [cleanup] [logsync] [freeze] [thaw|unfreeze]]


DESCRIPTION
       The  zmailer(1zm)  is  the quick interface to starting and stopping the
       local mail daemons, and doing other administrative chores.

       There are three daemons, called the  router(8zm),  the  scheduler(8zm),
       and the smtpserver(8zm).

       The  router(8zm)'s  home directory is POSTOFFICE/router, which it scans
       every  15  idle  seconds  for  newly  submitted  message  files.    The
       router(8zm)  determines  what  to do with a message.  It will typically
       send it on to the scheduler(8zm) queue.   This  is  maintained  in  the
       POSTOFFICE/scheduler  directory, which is also the working directory of
       the scheduler(8zm) and its transport agents.  The  scheduler(8zm)  pro-
       cess  is  what  listens  to  the  mailq  TCP  port for queries from the
       mailq(1zm) program used to examine the state of the transport queues.


OPTIONS
       Invoking zmailer(1zm) without any argument is equivalent to giving  the
       three arguments:
           router scheduler smtpserver

       Invoking  zmailer(1zm) with only one argument, "kill", is equivalent to
       invoking it with the four arguments:
           kill router scheduler smtpserver

       The arguments specify actions to take in sequence:

       --zconfig /path/to/zconfig
              accepted only as the first parameter, and can be used  to  over-
              ride  the  hardcoded system-wide value of ZCONFIG ZENV variable.
              This value will also be propagated to  all  daemons  started  by
              this script.

       -q     shuts up this script wrapper from muttering anything.

       freeze sets  a  flag  so  that latter options/executions of the zmailer
              script need at first an unfreeze to  allow  restart  of  various
              subprograms.   The goal is to keep automatically restarting sys-
              tems from starting up a mailer when there is a  maintance  going
              on.

       unfreeze
              clears the flag that freeze did set.  Has an alias: thaw.

       kill   sets  a  flag so that when the following arguments are executed,
              the relevant process will be shut down gracefully, as opposed to
              restarted.  If kill is the last (or only) argument, it will ter-
              minate all three daemons.

       nuke   is like kill except the processes are shut down  with  the  KILL
              signal.

       start  clears  the  nuke/kill  flag,  and all daemons explicitely named
              after this (or if this the last in the command line,  then  all)
              will be started.

       router will  start  up (or shut down if after a kill) a new router dae-
              mon.

       scheduler
              will start up (or shut down if after a  kill)  a  new  scheduler
              daemon.

       smtpserver
              will  start  up (or shut down if after a kill) a new SMTP server
              daemon.

       newdb  will  run  database  regeneration  per  definitions  at   "MAIL-
              SHARE/db/dbases.conf" file.  See zdbases.conf(5zm).

       newaliases
              will  run  the  script  to  recreate the alias database from the
              "MAILSHARE/db/aliases" file.  (This is  old  invokation  method,
              and is superceded with "newdb")

       resubmit
              moves  messages  from  the  POSTOFFICE/deferred directory to the
              POSTOFFICE/router directory.  This should be  run  regularly  by
              cron.

       bootclean
              does any necessary boot-time cleanup.

       cleanup
              gets  rid  of  old files from the POSTOFFICE/postman and POSTOF-
              FICE/public directories.  This should be run once a day or  week
              or month.

       logsync
              A "post-logfile-movement" call hook to do things needed in vari-
              ous subsystems to get their logfiles  reopened,  or  some  such.
              Most subsystems have automated "reopen everything within 30 sec-
              onds of previous reopen" logic inside them.  Some may have other
              requirements.

EXAMPLES
       To stop the currently running daemons:

           zmailer kill

       At  boot  time,  typically the following script fragment will be run to
       start up all the daemons:

           if [ -f $MAILSHARE/zmailer ]; then
                   $MAILSHARE/zmailer -q &
                   (echo -n ' zmailer')     >/dev/console
           fi


FILES
       /opt/mail/zmailer.conf
              ZCONFIG file

       /var/spool/postoffice
              $POSTOFFICE

       /opt/mail/bin/router
              $MAILBIN/router

       /opt/mail/bin/scheduler
              $MAILBIN/scheduler

       /opt/mail/bin/smtpserver
              $MAILBIN/smtpserver

SEE ALSO
       router(8zm), scheduler(8zm), smtpserver(8zm),  mailq(1zm),  newdb(8zm),
       zdbases.conf(5zm), zmailer.conf(5zm).

AUTHOR
       This program authored and copyright by:
          Rayan Zachariassen <no address>
       Modifications over the years 1990-2003 by:
          Matti Aarnio <mea@nic.funet.fi>



                                  2003-Aug-28                     ZMAILER(1zm)