sendmail

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

README

Sentry Sendmail

This is sentry-sendmail, a sendmail replacement MTA. That means that all incoming emails on a system will get forwarded to sentry as a sentry issue.

This can be useful in situations where SMTP can not be used or local email server can not be installed, and we want to capture system's email as a sentry event.

Installation

sudo apt-get install sentry-sendmail

Local Build

Retrieve the latest copy of the source code by cloning the repository.

git clone https://github.com/retailnext/sentry-sendmail.git $HOME/sentry-sendmail
Build packages using GoReleaser

Build sentry-sendmail from source in a single step using make.

goreleaser release --clean --snapshot

This will create installation tarballs and packages in dist/.

Configuration

Enter the sentry DSN in the config file /etc/sentry-sendmail.conf

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GitCommit specifies the git commit sha, set by the compiler.
	GitCommit = ""
	// Version specifies Semantic versioning increment (MAJOR.MINOR.PATCH).
	Version = "0.0.0"
)

Functions

func BuildMessage

func BuildMessage(headers map[string]string, body string) (string, error)

BuildMessage creates a Sentry ready message from an email envelope

func ParseOptions

func ParseOptions()

ParseOptions loads the sendmail options from the command line parameters.

func ReadData

func ReadData(reader *bufio.Reader) (map[string]string, string, string)

ReadData reads data envelope from an input stream and parses the message.

func SentryConfig

func SentryConfig() error

SentryConfig sets the Sentry DSN and Environment by reading values from environment variables and the config file.

func SentrySend

func SentrySend(message string, headers map[string]string) error

SentrySend sends the message to Sentry

Types

type Config

type Config struct {
	SentryDSN   string `toml:"DSN"`
	Environment string
}

Config structure is where the config file options get de-serialized.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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