Email (SMTP)
The SMTP notifier sends one email per event through any SMTP server. Each email
has an HTML part and a plain-text part, so it reads well in Gmail and in mutt.
If the machine already sends mail with a local MTA, the
sendmail notifier needs less setup.
[notifiers.email-ops]type = "smtp"host = "smtp.example.com"port = 587username = "apikey"password = "${SMTP_PASSWORD}"Fields
Section titled “Fields”| Key | Required | What it does |
|---|---|---|
host |
yes | The SMTP server, like smtp.gmail.com. |
port |
no | Default 25. Usually 587 (STARTTLS) or 465 (TLS from the start). |
tls_mode |
no | starttls, implicit, or off. Default implicit on port 465, starttls otherwise. starttls requires TLS. |
tls_skip_verify |
no | Don’t check the server’s TLS certificate. Don’t use it in production. |
username |
no | SMTP login. Set together with password, or leave both out for a server without login. |
password |
no | SMTP password. Keep it out of the file; see Storing the secret. |
from |
yes | The From: address: "[email protected]" or "Name <[email protected]>". |
reply_to |
no | A Reply-To: address. |
to |
yes | List of recipients, at least one. |
cc |
no | List of Cc: recipients. |
bcc |
no | List of Bcc: recipients. |
template_path |
no | A Go template file that replaces the built-in HTML message. |
To send one task’s mail to another address through the same server, use
"email-ops:[email protected]" in notify. It replaces the to, cc, and
bcc lists for that task. See
One channel, several destinations.
Server settings
Section titled “Server settings”Gmail needs an app password; it rejects your normal password over SMTP.
[notifiers.email-ops]type = "smtp"host = "smtp.gmail.com"port = 587password = "${GMAIL_APP_PASSWORD}"The username is always apikey; the password is your API key.
[notifiers.email-ops]type = "smtp"host = "smtp.sendgrid.net"port = 587username = "apikey"password = "${SENDGRID_API_KEY}"Create SMTP credentials in the SES console under SMTP settings. Your IAM password doesn’t work here.
[notifiers.email-ops]type = "smtp"host = "email-smtp.eu-west-1.amazonaws.com"port = 587username = "AKIA..."password = "${SES_SMTP_PASSWORD}"Use your region’s host and the credentials they give you.
# Mailgun[notifiers.email-ops]type = "smtp"host = "smtp.eu.mailgun.org"port = 587password = "${MAILGUN_PASSWORD}"# Postmark[notifiers.email-ops]type = "smtp"host = "smtp.postmarkapp.com"port = 587username = "<server-token>"password = "${POSTMARK_TOKEN}"A server on the same machine, without login or TLS. tls_mode = "off" only
works without username and password.
[notifiers.email-local]type = "smtp"host = "127.0.0.1"port = 25tls_mode = "off"from = "runwisp@myhost"When mail doesn’t arrive
Section titled “When mail doesn’t arrive”If the bell shows a notify.delivery_failed warning, it includes the SMTP
error. Common causes:
- The port doesn’t match
tls_mode: port587needsstarttls, port465needsimplicit. - An expired or wrong app password.
- The server rejects a recipient (
550 No such user).
If nothing failed, check the spam folder. The first mail from a new sender often lands there.
What a message looks like
Section titled “What a message looks like”❌ backup-postgres failed
Exited with code 1 after 0.3s. Scheduled run · 14 May, 17:11.
Error: connection refuseddial tcp 127.0.0.1:5432: connect:connection refused[View full run]
from runwisp · bright-falcon
- The output block appears for failures and timeouts, up to three lines or 300 bytes.
- The View full run link appears only when the Web UI address is known.
- The footer names the daemon that sent it.
- The plain-text part is made from the HTML, so text-only mail readers see the same content.
Changing the message
Section titled “Changing the message”Point template_path at your own Go template. Start from the built-in
smtp.tmpl.html.
It gets the whole event and the same helpers as the
Slack template. Escape
values with htmlEsc.
What’s rejected
Section titled “What’s rejected”- A missing
host,from, orto. usernamewithoutpassword, orpasswordwithoutusername.tls_mode = "off"with a username and password: RunWisp won’t send a password without encryption.- A
from,reply_to,to,cc, orbccvalue that isn’t a valid email address.