
			   Installing ENMA

* Supported OSes
  - Linux
  - FreeBSD, NetBSD
  - MacOS X 10.5.x 
  - Solaris 10 or later

* Necessary softwares
  - GNU C Compiler
  - GNU Make
  - libbind (bind 9, libbind 6.0 or later)
  - libmilter (sendmail 8.13 or later)
  - OpenSSL (0.9.8 or later)

* Two ways to build ENMA

  - Automatic building

    It will compile libbind and libmilter in a temporary directory and
    link ENMA to them.  Please refer to build/INSTALL. You don't have
    to read the rest of this file.

  - Manual building

    If you want to install libbind, libmilter and OpenSSL, and then
    link ENMA to them, please continue to read the rest of this file.

* Steps of manual building and execution

  1. Extracting

    $ tar xzf enma-x.y.z.tar.gz
    $ cd enma-x.y.z

  2. Installing dependent libraries

    To install libbind, libmilter and OpenSSL, please read "Building
    dependent libraries" below.

  3. Executing configure

    If the headers and libraries of libbind, libmilter and OpenSSL are
    installed in the "/usr/local" directory, execute "configure"
    without options.

    $ ./configure

    If they are installed in another directory, please specify the
    base directories with the --with-libbind, --with-libmilter and
    --with-ssl option.

    The following example is that the base directory of libbind is
    "/foo", that of libmilter is "/bar" and that of OpenSSL is "/baz".

    $ ./configure --with-libbind=/foo --with-libmilter=/bar --with-ssl=/baz

  4. Building

    $ make

  5. Installing

    $ sudo make install

  6. Preparing the configuration file

    $ sudo cp enma/etc/enma.conf.sample /etc/enma.conf

  7. Creating the directory for the PID file

    In the sample configuration file, "/var/run/enma/enma.pid" is
    specified to "milter.pidfile". So, you need to change permission
    of the directory so that "milter.user" can write.

    $ sudo mkdir -p /var/run/enma
    $ sudo chown daemon:daemon /var/run/enma
    $ sudo chmod 700 /var/run/enma

  8. Executing

    $ sudo /usr/local/libexec/enma -c /etc/enma.conf
  
* Configuring MTA

  Configure MTA so as to use ENMA when it receives messages.

  - sendmail

    Specify ENMA's milter socket with the MAIL_FILTER or
    INPUT_MAIL_FILTER macro in the .mc file, then generate
    sendmail.cf.

    Example of using ENMA's default socket:

        INPUT_MAIL_FILTER(`enma', `S=inet:10025@127.0.0.1')dnl

    For more information on INPUT_MAIL_FILTER, please refer to
    cf/README etc in the sendmail package.

    If you use sendmail 8.13 or earlier as MTA, set 
    "milter.sendmail813" to "ture" in ENMA's configuration file.

  - postfix (2.4 or later)

    Set "milter.postfix" to "true" in ENMA's configuration file.
    Specify smtpd_milters to ENMA's milter socket in the mail.cf file.

    Example of using ENMA's default socket:

        smtpd_milters = inet:127.0.0.1:10025

    For more information on milter support of postfiex, please refer to
    README_FILES/MILTER_README in the postfix package.

* Building dependent libraries

  This is an example to install libbind and libmilter under
  the /usr/local directory.

  - libbind

    $ tar zxf bind-x.y.z
    $ cd bind-x.y.z/lib/bind
    $ ./configure --prefix=/usr/local --enable-threads
    $ make
    $ sudo make install

  - libmilter

    $ tar zxf sendmail.x.y.z.tar.gz
    $ cd sendmail-x.y.z

    - Put the followings to devtools/Site/site.config.m4

    define(`confINCLUDEDIR', `/usr/local/include')
    define(`confLIBDIR', `/usr/local/lib')
    APPENDDEF(`confINCDIRS', `-I/usr/local/bind/include')
    APPENDDEF(`confLIBS', `/usr/local/lib/libbind.a')
    # Pease add other setting appropriate to your OS.

    $ cd libmilter
    $ ./Build
    $ sudo ./Build install

  - OpenSSL
    $ openssl-x.y.z.tar.gz
    $ cd openssl-x.y.z
    $ ./config threads shared --prefix=/usr/local
    $ make
    $ sudo make install

  For more information about installation of libbind, libmiter and
  OpenSSL, please refer to manuals in each packages.

* Notes on building ENMA for the many user environments

  - Specifying SM_CONF_POLL for libmilter

    If select() is used for the communication with sendmail, 
    file descriptors over FD_SETSIZE cannot be handled. So, poll()
    should be used instead. Please define SM_CONF_POLL when building
    libmilter.

    Please refer to "build/site.config.m4.poll-generic".

      # Setting to add to site.config.m4
      APPENDDEF(`confENVDEF', `-DSM_CONF_POLL=1')

    If you install ENMA with "build/build_all.sh", SM_CONF_POLL is
    automatically specified.

  - Specifying the "-m64" option of gcc on SPARC Solaris

    32bit version fopen() of Solaris, used in libbind, cannot handle
    file descriptors over 255. So, please specify the "-64bit" option
    when building the libraries and ENMA.

    - libbind

      $ ./configure CFLAGS=-m64 LDFLAGS=-m64

    - libmilter

      Please refer to "build/site.config.m4.poll-m64"

      # Setting to add to site.config.m4
      APPENDDEF(`confENVDEF', `-DSM_CONF_POLL=1')
      APPENDDEF(`confCCOPTS', `-m64')

    - ENMA

      $ ./configure CFLAGS=-m64 LDFLAGS=-m64

$Id: INSTALL 857 2009-03-30 01:53:54Z kazu $
