nyaruka / mailroom

Backend services for the TextIt platform.
Other
0 stars 1 forks source link

📬 Mailroom

Build Status codecov

Service for RapidPro/TextIt which does most of the heavy lifting. It interacts directly with the database and sends and receives messages with Courier for handling via Redis.

Deploying

As a Go application, it compiles to a binary and that binary along with the config file is all you need to run it on your server. You can find bundles for each platform in the releases directory. We recommend running it behind a reverse proxy such as nginx or Elastic Load Balancer that provides HTTPs encryption.

Configuration

The service uses a tiered configuration system, each option takes precendence over the ones above it:

  1. The configuration file
  2. Environment variables starting with MAILROOM_
  3. Command line parameters

We recommend running it with no changes to the configuration and no parameters, using only environment variables to configure it. You can use % mailroom --help to see a list of the environment variables and parameters and for more details on each option.

For use with RapidPro/TextIt, you will need to configure these settings:

For writing of message attachments, you need an S3 compatible service which you configure with:

You can use S3 storage for sessions and logs as well with:

Flow engine configuration:

Recommended settings for error and performance monitoring:

Development

Once you've checked out the code, you can build the service with:

go build github.com/nyaruka/mailroom/cmd/mailroom

This will create a new executable in $GOPATH/bin called mailroom.

To run the tests you need to create the test database:

$ createdb mailroom_test
$ createuser -P -E -s mailroom_test (set no password)

To run all of the tests:

go test -p=1 ./...