Task handling service for RapidPro and TextIt.
It compiles to a binary and can find bundles for each platform in the releases directory.
The service uses a tiered configuration system, each option takes precendence over the ones above it:
- The configuration file
- Environment variables starting with
MAILROOM_ - 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.
MAILROOM_ADDRESS: address to bind our web server to (default "localhost")MAILROOM_DOMAIN: domain that mailroom is listening onMAILROOM_AUTH_TOKEN: authentication token clients will need to for web requests (should match setting in RapidPro)MAILROOM_ATTACHMENT_DOMAIN: domain that will be used for relative attachments in flowsMAILROOM_DB: URL describing how to connect to the RapidPro database (default "postgres://temba:temba@localhost/temba?sslmode=disable")MAILROOM_READONLY_DB: URL for an additional database connection for read-only operations (optional)MAILROOM_VALKEY: URL describing how to connect to Valkey (default "valkey://localhost:6379/15")MAILROOM_SMTP_SERVER: SMTP configuration for sending emails ex: smtp://user%40password@server:port/?from=foo%40gmail.comMAILROOM_ANDROID_FCM_SERVICE_ACCOUNT_FILE: FCM Service Account Credentials JSON File path used to notify Android relayers to syncMAILROOM_ELASTIC_USERNAME: ElasticSearch username for Basic AuthMAILROOM_ELASTIC_PASSWORD: ElasticSearch password for Basic AuthMAILROOM_COURIER_AUTH_TOKEN: authentication token used for requests to CourierMAILROOM_SESSION_STORAGE: where session output is stored which must bedb(default) ors3
MAILROOM_AWS_ACCESS_KEY_ID: AWS access key id used to authenticate to AWSMAILROOM_AWS_SECRET_ACCESS_KEY: AWS secret access key used to authenticate to AWSMAILROOM_AWS_REGION: AWS region (ex:eu-west-1)MAILROOM_S3_ATTACHMENTS_BUCKET: name of your S3 bucket (ex:mailroom-attachments)MAILROOM_S3_SESSIONS_BUCKET: name of your S3 bucket (ex:mailroom-sessions)
MAILROOM_DEPLOYMENT_ID: used for metrics reportingMAILROOM_SENTRY_DSN: DSN to use when logging errors to SentryMAILROOM_LOG_LEVEL: logging level to use (default iswarn)
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 ./...