Skip to content

Commit

Permalink
Merge pull request #249 from Munfred/master
Browse files Browse the repository at this point in the history
Describe setting up SMTP server with Sendgrid
  • Loading branch information
spantaleev authored Aug 19, 2019
2 parents c464ab3 + ecff0f4 commit 885338c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/configuring-playbook-email.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This may or may not work, depending on your domain configuration (SPF settings,

By default, emails are sent from `matrix@<your-domain-name>` (as specified by the `matrix_mailer_sender_address` playbook variable).

**Note**: If you are using a Google Cloud instance, [port 25 is always blocked](https://cloud.google.com/compute/docs/tutorials/sending-mail/), so you need to relay email through another SMTP server as described below.


## Firewall settings

Expand All @@ -31,6 +33,23 @@ matrix_mailer_relay_auth_password: "some-password"
**Note**: only the secure submission protocol (using `STARTTLS`, usually on port `587`) is supported. **SMTPS** (encrypted SMTP, usually on port `465`) **is not supported**.


### Configuations for sending emails using Sendgrid
An easy and free STMP service to set up is [Sendgrid](https://sendgrid.com/), the free tier allows for up to 100 emails per day to be sent. In the settings below you can provide any email for `matrix_mailer_sender_address`.

The only other thing you need to change is the `matrix_mailer_relay_auth_password`, which you can generate at https://app.sendgrid.com/settings/api_keys. The API key password looks something like `SG.955oW1mLSfwds7i9Yd6IA5Q.q8GTaB8q9kGDzasegdG6u95fQ-6zkdwrPP8bOeuI`.

Note that the `matrix_mailer_relay_auth_username` is literally the string `apikey`, it's always the same for Sendgrid.

```yaml
matrix_mailer_sender_address: "[email protected]"
matrix_mailer_relay_use: true
matrix_mailer_relay_host_name: "smtp.sendgrid.net"
matrix_mailer_relay_host_port: 587
matrix_mailer_relay_auth: true
matrix_mailer_relay_auth_username: "apikey"
matrix_mailer_relay_auth_password: "<your api key password>"
```

## Troubleshooting

If you're having trouble with email not being delivered, it may be useful to inspect the mailer logs: `journalctl -f -u matrix-mailer`.

0 comments on commit 885338c

Please sign in to comment.