4.1. Installation

The Halon programs are installed using a Linux distribution package manager according to the corresponding instructions, or by manually copying the files to the /opt/halon directory.

4.1.1. Configuration

Each program has a small startup configuration, which contains settings such as control socket paths and user privilege drop. Most importantly, they point at the running configuration load path via environment.appconf. The default startup configuration files in /opt/halon/share/examples can normally be used. The running configuration contains the bulk of the configuration data, including all the Halon script. To quickly get started, follow the steps below.

$ mkdir -p test/dist
$ cd test
$ cp -r /opt/halon/share/examples src
$ halonconfig
$ sudo cp dist/* /etc/halon/
$ sudo groupadd staff
  • The default configuration in /opt/halon/share/examples is copied to a working directory
  • The halonconfig script prepares the configuration files
    • It validates the configuration files in src/config against the JSON schemas
    • It “packs” the script in src/hooks and src/files into the smtpd-app.yaml running configuration
    • It writes the result to the dist directory
  • The prepared configuration is copied from dist/ to /etc/halon/
  • The default configuration allows users in the staff group to manage the MTA

4.1.2. Startup

When the initial configuration is in place, the programs can be enabled on system boot and started with:

$ sudo systemctl enable halon.service
$ sudo systemctl start halon

4.1.3. Test email

The default configuration allows you to relay email on port 587 from localhost, so you can send a test email using for example swaks:

$ swaks --server 127.0.0.1 --port 587 --to [email protected]