Configuration

Mailer can load YAML, TOML, or JSON configuration files. If no configuration file is specified, it will search the current working directory for these files (in this order):

  1. config.yaml
  2. config.yml
  3. config.toml
  4. config.json

If no configuration file is found, the default settings will be used. There are three example configuration files in the installation folder, config.defaults.(yaml,toml,json), that show what the all of the default values are.

If you use a configuration file, you do not need to define every setting. Any setting that is not found in your configuration file will inherit its default value.

Examples

All of these examples are the same as what you would find in the config.defaults.(yaml,toml,json) files.

YAML

port: 2398
listenaddress: "127.0.0.1"
debug: false

db:
  user: ""
  password: ""
  host: "127.0.0.1"
  port: 27017
  database: "mailer"

logs:
  outfile: ""
  errfile: ""
  reqfile: ""

TOML

port = 2398
listenaddress = "127.0.0.1"
debug = false

[db]
user = ""
password = ""
host = "127.0.0.1"
port = 27017
database = "mailer"

[logs]
outfile = ""
errfile = ""
reqfile = ""

JSON

{
  "port": 2398,
  "listenaddress": "127.0.0.1",
  "debug": false,
  "db": {
    "user": "",
    "password": "",
    "host": "127.0.0.1",
    "port": 27017,
    "database": "mailer"
  },
  "logs": {
    "outfile": "",
    "errfile": "",
    "reqfile": ""
  }
}