Categorygithub.com/skpr/mail
modulepackage
0.0.14
Repository: https://github.com/skpr/mail.git
Documentation: pkg.go.dev

# README

skprmail

This project is a drop-in replacement for Sendmail which sends email via Amazon SES.

It reads a raw SMTP message from stdin and forwards it unaltered.

Installation

Download the binary for the latest release and place it at $(which sendmail).

Credentials

skpr config

The app knows how skpr mounts configuration into the container (via the mount at /etc/skpr). It picks up credentials from the following keys:

  • IAM Key ID smtp.username
  • IAM Key Secret smtp.password
  • AWS Region smtp.region
  • From Address smtp.from.address

Environment variables

  • IAM Key ID SKPRMAIL_AWS_ACCESS_KEY_ID
  • IAM Key Secret SKPRMAIL_AWS_SECRET_ACCESS_KEY
  • AWS Region SKPRMAIL_AWS_REGION
  • From Address SKPRMAIL_FROM_ADDRESS

Testing Locally

Create a file /tmp/test-mail.txt with the following contents. Adjust from/to address to those which are verified in SES.

To: [email protected]
Subject: sendmail test two
From: [email protected]

And here goes the e-mail body, test test test..
export SKPRMAIL_AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
export SKPRMAIL_AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
export SKPRMAIL_AWS_REGION=us-east-1
export [email protected]
$ cat /tmp/test-email.txt | skprmail

Releasing

Testing a release:

goreleaser release --rm-dist --snapshot --skip-publish

Releasing:

golreleaser

# Constants

ConfigFrom used to override and set the FROM request for mail using a Skpr config.
ConfigPassword used to configure authentication using a Skpr config.
ConfigRegion used to configure the region where SES resides using a Skpr config.
ConfigUsername used to configure authentication using a Skpr config.
EnvFrom used to override and set the FROM request for mail using an environment variable.
EnvPassword used to configure authentication using an environment variable.
EnvRegion used to configure the region where SES resides using an environment variable.
EnvUsername used to configure authentication using an environment variable.