-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for sending emails based on #61 Co-authored-by: ckulka <ckulka@wlgore.com>
- Loading branch information
Showing
9 changed files
with
154 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Email Guide | ||
|
||
This guide outlines the email configuration so that you can send out email invitations. Many thanks to [@philippneugebauer](https://github.com/philippneugebauer), [@vaskozl](https://github.com/vaskozl), [ahgraber](https://github.com/ahgraber), and everyone in [#61](https://github.com/ckulka/baikal-docker/discussions/61) for contributing. | ||
|
||
In order to send out emails, you need a working SMTP service - you can host your own or rely on a service such as [Gmail](https://support.google.com/mail/answer/7126229?hl=en#zippy=%2Cstep-change-smtp-other-settings-in-your-email-client). | ||
|
||
The entire email configuration is stored in the `MSMTPRC` environment variable. | ||
|
||
## Generic SMTP server | ||
|
||
If you have an SMTP server without security in place, i.e. no authentication or SSL/TLS/STARTTLS, then you only have to configure the SMTP server name. Needless to say it's highly recommended to have authentication and TLS in place. | ||
|
||
```yaml | ||
services: | ||
baikal: | ||
image: ckulka/baikal:nginx | ||
environment: | ||
MSMTPRC: | | ||
defaults | ||
account default | ||
host <smtp host> | ||
port 25 | ||
``` | ||
If you have TLS and authentication in place, add the following configuration parameters: | ||
```yaml | ||
services: | ||
baikal: | ||
image: ckulka/baikal:nginx | ||
restart: always | ||
environment: | ||
MSMTPRC: | | ||
defaults | ||
auth on | ||
tls on | ||
tls_trust_file /etc/ssl/certs/ca-certificates.crt | ||
account default | ||
host <smtp host> | ||
port 587 | ||
from baikal@example.com | ||
user <user> | ||
password <password> | ||
``` | ||
See [examples/docker-compose.email.yaml](../examples/docker-compose.email.yaml) for a starter template. | ||
## Gmail | ||
If you use Gmail as your SMTP server, you have to first allow less secure apps (sendmail) to use Gmail, see [Less secure apps & your Google Account](https://support.google.com/accounts/answer/6010255?hl=en#zippy=). | ||
Once that is done, use the following configuration: | ||
```yaml | ||
services: | ||
baikal: | ||
image: ckulka/baikal:nginx | ||
environment: | ||
MSMTPRC: | | ||
defaults | ||
auth on | ||
tls on | ||
tls_trust_file /etc/ssl/certs/ca-certificates.crt | ||
account default | ||
host smtp.gmail.com | ||
port 587 | ||
from <user>@gmail.com | ||
user <user> | ||
password <password> | ||
``` | ||
See [examples/docker-compose.sendmail-gmail.yaml](../examples/docker-compose.email-gmail.yaml) for a starter template. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Docker Compose file for a Baikal server | ||
# See https://github.com/ckulka/baikal-docker/blob/master/docs/email-guide.md | ||
|
||
version: "2" | ||
services: | ||
baikal: | ||
image: ckulka/baikal:nginx | ||
restart: always | ||
environment: | ||
MSMTPRC: | | ||
defaults | ||
auth on | ||
tls on | ||
tls_trust_file /etc/ssl/certs/ca-certificates.crt | ||
account default | ||
host smtp.gmail.com | ||
port 587 | ||
from <user>@gmail.com | ||
user <user> | ||
password <password> | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- config:/var/www/baikal/config | ||
- data:/var/www/baikal/Specific | ||
|
||
volumes: | ||
config: | ||
data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Docker Compose file for a Baikal server | ||
# See https://github.com/ckulka/baikal-docker/blob/master/docs/email-guide.md | ||
|
||
version: "2" | ||
services: | ||
baikal: | ||
image: ckulka/baikal:nginx | ||
restart: always | ||
environment: | ||
MSMTPRC: | | ||
defaults | ||
auth on | ||
tls on | ||
tls_trust_file /etc/ssl/certs/ca-certificates.crt | ||
account default | ||
host <smtp host> | ||
port 587 | ||
from baikal@example.com | ||
user <user> | ||
password <password> | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- config:/var/www/baikal/config | ||
- data:/var/www/baikal/Specific | ||
|
||
volumes: | ||
config: | ||
data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
# See https://github.com/ckulka/baikal-docker/discussions/61 | ||
|
||
# Insert sendmail mailer definitions | ||
if [ ! -z ${MSMTPRC+x} ] | ||
then | ||
echo "$MSMTPRC" > /etc/msmtprc | ||
chown root:msmtp /etc/msmtprc | ||
chmod 640 /etc/msmtprc | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters