Neztore / tls-rpt-monitor

Stupid. Simple. TLS Report monitoring. Intended to be used with MTA-STS or DANE, for simplified reporting.
MIT License
6 stars 2 forks source link

Configuration Example. #7

Closed tdmarchetta closed 7 months ago

tdmarchetta commented 7 months ago

I'm at a complete loss of how this configuration file is supposed to look. This is what I've been able to put together so far. Please let me know if this looks correct.

{
  "from_admin": "name@domain.com",
  "smtp_host": "smtp.domain.com",
  "smtp_username": "username",
  "smtp_password": "passord",
  "recipients": [
    "name@domain.com"
  ],
  "ignoredSenders": [],
  "emailCooldown": 60
}
Neztore commented 7 months ago

The project uses a combination of environment variables and a configuration file, mostly because it is difficult to express mappings between domains and receivers in env vars. it is technically possible to add the below values in your configuration file, but I advise against it: it is bad practice to include secrets (password) in code files.

You should set the following variables in your env (From README): Variable Type Notes
from_address String From address to use when sending alerts. May be ignored by your provider. Can be specified as "Sender name" <name@domain.com> too.
smtp_host String SMTP server hostname to use to send emails. Will connect on 587.
smtp_password String SMTP Password to use for auth
smtp_username String SMTP username to use for auth

Then, for config.json itself, let's say I don't want to hear from spamscam.com, I want reports for personaldomain.com to go to personal@domain.com, and reports for companydomain.com to go to work@domain.com, and everything else to go to other@domain.com. I would use the following configuration:

{
  "recipients": {
      "personaldomain.com": "personal@domain.com",
      "companydomain.com": "work@domain.com",
     "otherwise": "other@domain.com"
  },
  "ignoredSenders": ["spamscam.com"],
  "emailCooldown": 60
}

More information is in the README. Hope that helps.