Configuration

  1. Overview

    Configuring sapes involves two things: (1) setting up config.txt and (2) setting up the file system. config.txt controls how sapes operates and what domains it is responsible for. The file system must be setup so that you have a directory for each domain and a sub-directory under the domain directory for each mailbox.

  2. config.txt

    config.txt is were all of the sapes parameters are stored. mailserv, the sapes program, looks for config.txt in the working directory. If you don't know what the working directory is then simple start sapes from the same directory that config.txt is in. For instance, if config.txt is in /home/doug/sapes then start mailserv like this: cd /home/doug/sapes, ./mailserv. Trying to start mailserv from somewhere else (like cd /home, doug/sapes/mailserv) will result in an error since sapes could not find config.txt.

    There are several parameters in config.txt. Each of them is explained here.

    smtp_port
    The port that the SMTP server will listen on. The default is 25.
    pop3_port
    The port that the POP3 server will listen on. The default is 115
    http_port
    The port that the http monitor will listen on. The default is 80
    send_dir
    The directory where mail files temporarily stored before delivery. No default.
    scan_interval
    The number of seconds sapes waits between scanning send_dir for mail to send. Default is 1 second.
    sender_threads
    The number of threads sapes creates to send e-mails. This allows sapes to communicate with multiple SMTP servers at the same time. Default is 5.
    domain_count
    The number of domains that this configuration file specifies. No default.
    domainN
    The Nth domain name that this configuration file specifies. The N is a placeholder for the domain number. For instance, if it is the 1st domain name, then it would be domain1. No default.
    domainN_mailboxes
    The directory were domainN's mailboxes are located. No default.
    use_http_monitor
    Set to 0 to turn the http monitor off, and set to 1 to turn it on. Default is on.
    resource_dir
    The directory that contains HTML files that the http monitor uses.

    Here is an example config.txt file.

    smtp_port:2025
    pop3_port:20110
    http_port:2080
    send_dir:/home/doug/oss/sf/sapes/data/senddir
    scan_interval:1
    sender_threads:5
    domain_count:1
    domain1:the-richardsons.org
    domain1_mailboxes:/home/doug/oss/sf/sapes/data/mailboxes/the-richardsons.org
    use_http_monitor:1
    resource_dir:/home/doug/oss/sf/sapes/resource
    
  3. File System

    1. Domains

      Each domain that is specified in the config.txt file. The config.txt file points to a directory that is created for the domain. For instance, if domain1_mailboxes is /home/doug/the-richardsons.org, then that directory must be created.

    2. Mailboxes
  4. Domain Setup

    In order to get the e-mail server setup correctly you will have to have a domain that you can configure. You will then need to set the MX records in that domain to point to your machine that you are running sapes on. However, you don't need to do that if you are only going to work on the http monitor. But if you want to setup a complete e-mail server, you will have to do it. In case you don't know, MX stands for mail exchange (I think). It is a DNS record for specifying mail servers for domains.