ZMAILER(1zm)                                                      ZMAILER(1zm)

       zmailer - zmailer control script

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

       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.

       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

              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

       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-

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

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

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

              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")

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

              does any necessary boot-time 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.

              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

       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

              ZCONFIG file





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

       This program authored and copyright by:
          Rayan Zachariassen <no address>
       Modifications over the years 1990-2003 by:
          Matti Aarnio <>

                                  2003-Aug-28                     ZMAILER(1zm)