Description
ezvpn-mqtt-email
listens to an MQTT broker and sends emails.
In IOhubTM architecture, ezvpn-mqtt-email
subscribes to an MQTT topic (email/#
by default) on the internal MQTT broker and sends emails.
How to use it
ezvpn-mqtt-email
is a Docker container image pre-configured for communication with ezvpn-mqtt
to send email. To use it, you first need an SMTP account to send emails. When used in combination with ezvpn-fld-exchanger, you have a flexible system that sends emails based on specific conditions triggered by events.
Environment variables
When you start the Email container, you can adjust the instance's configuration by passing one or more environment variables to the docker run
command.
MQTT Connection
-
MQTT_HOST
: MQTT host. Defaults to127.0.0.1
. -
MQTT_PORT
: MQTT port. Defaults to1883
. -
MQTT_SUBSCRIBE_TOPIC
: IOhubTM MQTT topic to subscribe. Defaults toemail/#
. Subscribe to multiple topics can be obtained by defining each topic on a separate line. -
MQTT_WANT_QOS2
: ask MQTT to upgrade each incoming message onMQTT_IN_TOPIC
to QoS 2 (delivery guaranteed). MQTT will honor the request only if persistence is enabled. -
SKIP_RETAIN
: iftrue
, discard all MQTT messages with retain flag set totrue
. Defaults tofalse
.
With SKIP_RETAIN
set to false
, each client that subscribes to a topic pattern receives the retained message immediately after they subscribe.
The broker stores only one retained message per topic.
Email Connection
-
SMTP_HOST
: SMTP server host name -
SMTP_PORT
: SMTP server port -
SMTP_USE_TLS
: iftrue
the connection will force the use of TLS when connecting to server. Iffalse
then TLS is used after negotiation, and used only if server supports the STARTTLS extension. In most cases set this value tofalse
unless you are connecting to a port supporting an initial TLS communication. -
SMTP_USE_AUTH
: iftrue
, login is attempted, usingSMTP_USERNAME
andSMTP_PASSWORD
. Otherwise, no authentication is attempted. -
SMTP_USERNAME
: SMTP authentication username -
SMTP_PASSWORD
: SMTP authentication password -
EMAIL_FROM
: The email address of the sender -
EMAIL_TO
: Comma separated list of recipients email addresses that will appear on the To: field. If not defined, the recipient is obtained dynamically by the topic name. The topic portion after the last/
is considered a dynamic recipient. e.g. when a message is sent toemail/a/b/c/info@ezvpn.online
, the recipient isinfo@ezvpn.online
. -
EMAIL_CC
: Comma separated list of recipients email addresses that will appear on the Cc: field -
EMAIL_BCC
: Comma separated list of recipients email addresses that will appear on the Bcc: field -
EMAIL_SUBJECT
: The subject of the email.## DATA ##
can be used as a placeholder for the value read from MQTT.## TOPIC ##
can be used as a placeholder for the incoming topic from MQTT. Defaults to empty string. -
EMAIL_TEXT_BODY
: body template, send as text.## DATA ##
can be used as a placeholder for the value read from MQTT.## TOPIC ##
can be used as a placeholder for the incoming topic from MQTT. Defaults to none. -
EMAIL_HTML_BODY
: body template, send as html.## DATA ##
can be used as a placeholder for the value read from MQTT.## TOPIC ##
can be used as a placeholder for the incoming topic from MQTT. Defaults to none.
At least one of EMAIL_TEXT_BODY
and EMAIL_HTML_BODY
must have content.
All email addresses can be plain sender@server.com
or formatted as “Sender Name” sender@server.com
.
Docker container details
Image: us-central1-docker.pkg.dev/ez-shared/iohub/iohub-mqtt-email
Supported architecture: amd64
Changelog v1.0.1
- Smaller image
- First Release