Email/SMTP Configuration
monetr supports sending email notifications (and email verification) if SMTP is configured. Currently emails can be sent when a user creates a new account, forgets their password, or changes their password.
All email features require that enabled is set to true and a valid smtp config is provided. monetr does not
support specific email APIs and has no plans to. Several email providers offer an SMTP relay, this is monetr's preferred
method of sending emails as it is the most flexible.
Below is an example of the email/SMTP configuration block:
The following environment variables map to the following configuration file fields. Each field is documented below.
Blocked Sign Up Domains
If you want to keep certain email domains (such as disposable or throwaway email providers) from being used to create
new accounts, add them to blockedDomains. This only restricts sign up, an account that already exists on one of
these domains can still sign in, reset its password, and verify its email. It works regardless of whether email sending
is enabled, it does not require SMTP to be configured.
The match is case insensitive and matches the domain exactly, so blocking example.com does not block
mail.example.com. An empty list (the default) disables the feature.
When someone tries to sign up with a blocked domain monetr intentionally returns the same "email already in use" error that it returns for an address that is already registered. This is so the blocklist is not disclosed to people signing up. The actual reason, including which domain was blocked, is recorded in the server logs.
When set via the environment variable the domains are comma separated, for example
MONETR_EMAIL_BLOCKED_DOMAINS=mailinator.com,guerrillamail.com.
Email Verification Configuration
If you want to require users to verify their email address when they create a new login on monetr, you can enable email verification. This will email users a link that they must click after creating their login, the link's lifetime can be customized if needed.
An example of the email verification config:
The token lifetime is parsed using time.ParseDuration(...), any value that
can be parsed using that function is a valid configuration value.
The following environment variables map to the following configuration file fields. Each field is documented below.
Forgot Password Configuration
If you ever lose your password and need to reset it, the easiest way is by using the forgot password form. This will
send an email to the user (if a user with that email exists) that includes a link to reset their password. Similar to
the Email Verification Configuration, this also only requires an enabled and
tokenLifetime value.
Example of the forgot password configuration:
The following environment variables map to the following configuration file fields. Each field is documented below.
SMTP Configuration
Make sure to read the documentation for your email provider. monetr requires TLS support from the SMTP server that
it is connecting to. This can be via STARTTLS or via a dedicated TLS port on the server. Consult your providers
documentation for specifics.
monetr's SMTP implementation requires TLS. Your email provider must support TLS on whatever port specified below.
The following environment variables map to the following configuration file fields. Each field is documented below.