smtp

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 7 Imported by: 0

README

SMTP plugin

The SMTP plugin provides alerts that send e-mail messages over SMTP.

Alerts

smtp.send
alert smtp.send "example" {
  server = "mail.example.com:25"
  username = "goplum"
  password = "example"
  subject_prefix = "ALERT: "
  from = "alerts@example.com"
  to = "sysadmin@example.com"
}

Sends an e-mail message via an SMTP server. All parameters are required except for subject_prefix which defaults to "Goplum alert: ".

If the SMTP server supports STARTTLS, the connection will switch to use TLS prior to sending any authentication details.

If you do not run your own SMTP server, you might consider using a dedicated service such as mailgun or AWS SES, both of which you can access over SMTP.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct{}

func (Plugin) Alert

func (p Plugin) Alert(kind string) goplum.Alert

func (Plugin) Check

func (p Plugin) Check(_ string) goplum.Check

type SendAlert

type SendAlert struct {
	Server        string
	Username      string
	Password      string
	SubjectPrefix string `config:"subject_prefix"`
	From          string
	To            string
}

func (SendAlert) Send

func (s SendAlert) Send(details goplum.AlertDetails) error

func (SendAlert) Validate

func (s SendAlert) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL