email-webtools

command module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 7 Imported by: 0

README

Camdram Email Web Tools

email-webtools is a small micro-service written in Go that we at Camdram use to monitor our Email systems and ensure that email receipt and delivery is functioning as expected.

How does it work?

At Camdram we use Postal for the sending and receiving of emails. This service connects to the Postal database in MySQL (technically MariaDB) and, when a correctly authenticated HTTP request is made, executes queries to determine the length of the mail queue and the volume of held mail.

Queued messages are messages that are actively awaiting delivery. Held messages are those that have been put to one side and will not be delivered, needing manual intervention.

Compiling

We compile the project down to a single statically-linked executable which avoids having to install the entire Go toolchain on our server. Both of the methods detailed below produce a single email-webtools binary file in your working directory.

Docker

First install Docker and then run the following in a terminal window:

docker build -t camdram/email-webtools .
docker run --rm -v ${PWD}:/go/src/github.com/camdram/email-webtools camdram/email-webtools
Old School

You will need to install the Golang programming language (see here for details). Then run the build using the included Makefile:

make clean
make all

Deploying

You'll need to create a .env config file to house the authentication settings. This should contain something along the following lines:

HTTP_SERVER: hostname
HTTP_PORT: 8080
HTTP_AUTH_TOKEN: yourauthtoken
MYSQL_USER: username
MYSQL_PASSWORD: password
MAIN_DB: postal
SERVER_DB: postal-server-1
SMTP_TO: address1@example.com,address2@example.com

The code in this Git repository is released under the MIT License.

Copyright (c) 2019–2020 The Association of Cambridge Theatre Societies and contributing groups.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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