smtp bridge for using WEB API send email, currently support mailgun and sendgrid
1.9K
smtp bridge for apps which want to send email in the traditional SMTP way but actully goes to the WEB API
currently support mailgun and sendgrid
the main goal of this project is setup as a side container
for remark42 comment system to send email via WEB API
but the usage of it is not limited to this
mailgun
sendgrid
sudo podman run -d --name smtpbrd -p 2525:2525 \
-e BRD_PROVIDER=sendgrid \
-e BRD_SENDGRID_API_KEY='SG-KEY-HERE' \
80x86/smtp-brd:latest
sudo docker run -d --name smtpbrd -p 2525:2525 \
-e BRD_PROVIDER=sendgrid \
-e BRD_SENDGRID_API_KEY='SG-KEY-HERE' \
80x86/smtp-brd:latest
there are 3 ways to config
take mailgun.api_key for example:
config.toml
# Mailgun
[mailgun]
api_key = ""
the equal environment variable is BRD_MAINGUN_API_KEY
be aware here we introduced a prefix BRD_ to avoid conflict
the equal cli param is --mailgun.api_key
run smtp-brd --help for full config options
the environment variables is recommend way for running in container.
BRD_ADDR="0.0.0.0"
BRD_PORT="2525"
BRD_TLS=false
BRD_CERT="/etc/brd/ssl/ssl.crt"
BRD_KEY="/etc/brd/ssl/ssl.key"
BRD_DEBUG=false
BRD_USER=""
BRD_SECRET=""
BRD_PROVIDER="mailgun"
TZ=Asia/Hong_Kong
PUID=1000
PGID=1000
you can run the container in your own timezone, just to specific the env var, for example:
TZ=America/Los_Angeles
mailgun provider
BRD_MAILGUN_API_KEY=""
BRD_MAILGUN_DOMAIN=""
BRD_MAILGUN_TIMEOUT=10
sendgrid provider
BRD_SENDGRID_API_KEY=""
BRD_SENDGRID_TIMEOUT=10
default certificate stores under /etc/brd/ssl
however in container, you can map it to any path as you like
just set the correct value for BRD_CERT and BRD_KEY
smtp.plainAuth failed: unencrypted connection
You need either to setup TLS on your SMTP server,
use localhost as a relay or disable authentication.
the answer come from
this issue
The error is because the Go SMTP package doesn't allow authentication without encryption. From https://godoc.org/net/smtp#PlainAuth
PlainAuth will only send the credentials if the connection is using TLS or is connected to localhost. Otherwise authentication will fail with an error, without sending the credentials.
got x509: certificate signed by unknown authority error while TLS enabled
The error is because the Go net/smtp client tls.Config.InsecureSkipVerify is enforced to true
if TLS enabled, be sure your have valid certificate
self-signed cert is not allowed by golang smtp client
mail parser this project use github.com/veqryn/go-email/email to parse email
repo
minimal SMTP server use github.com/mhale/smtpd repo,
which seems based on the work of Brad Fitzpatrick's go-smtpd
flags parser github.com/spf13/pflag repo
config manager github.com/spf13/viper repo
logger go.uber.org/zap repo
Content type
Image
Digest
Size
37.1 MB
Last updated
about 6 years ago
docker pull 80x86/smtp-brd