From d69bfd5795a037f18637f6be4937fd0f749410ce Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 10 Feb 2018 16:54:26 -0800 Subject: [PATCH] Support for real email sending without a relay. --- README.md | 16 +++++++++++++--- mediagoblin_local.ini.template | 7 ++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 17a1ac3..357820e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,18 @@ # MediaGoblin -A basic container for a private MediaGoblin media server (https://mediagoblin.org/), including Nginx and uWSGI. Assumes a separate PostgreSQL database for persistence, and an email relay host for sending email notifications. +A basic container for a private MediaGoblin media server (https://mediagoblin.org/), including Nginx and uWSGI. Assumes a separate PostgreSQL database for persistence, and an email host for sending email notifications. Source at https://projects.torsion.org/witten/mediagoblin-docker ## Environment variables * `NOTIFICATION_EMAIL`: From address for MediaGoblin notification emails. - * `EMAIL_RELAY_HOST`: Hostname used to send outgoing notification emails. Since MediaGoblin isn't terribly configurable as an email client, it's recommended that this "host" is a mail relay like https://hub.docker.com/r/alterrebe/postfix-relay/. + * `EMAIL_HOSTNAME`: Hostname used to send outgoing notification emails. + * `EMAIL_PORT`: Port number used to send outgoing notification emails. + * `EMAIL_USERNAME`: Username used to connect to outgoing email host. + * `EMAIL_PASSWORD`: Password used to connect to outgoing email host. + * `EMAIL_TLS_SSL`: "true" or "false" for using TLS/SSL encryption for sending emails. + * `EMAIL_STARTTLS`: "true" or "false" for using STARTTLS encryption for sending emails. * `DATABASE_URL`: Connection string for database to use for persistence, including credentials. See example below. ## Volumes @@ -23,7 +28,12 @@ Source at https://projects.torsion.org/witten/mediagoblin-docker ```console docker run --detach --name=mediagoblin \ --env NOTIFICATION_EMAIL=media@example.org \ - --env EMAIL_RELAY_HOST=relay.example.org \ + --env EMAIL_HOSTNAME=mail.example.org \ + --env EMAIL_PORT=587 \ + --env EMAIL_USERNAME=bob@example.org \ + --env EMAIL_PASSWORD=pass \ + --env EMAIL_TLS_SSL=false \ + --env EMAIL_STARTTLS=true \ --env DATABASE_URL=postgresql://mediagoblin:password@database.example.org/mediagoblin \ --volume /var/lib/mediagoblin/user_dev:/app/user_dev \ --publish 80:80 \ diff --git a/mediagoblin_local.ini.template b/mediagoblin_local.ini.template index f7a5095..483865f 100644 --- a/mediagoblin_local.ini.template +++ b/mediagoblin_local.ini.template @@ -14,7 +14,12 @@ [mediagoblin] direct_remote_path = /mgoblin_static/ email_sender_address = "$NOTIFICATION_EMAIL" -email_smtp_host = "$EMAIL_RELAY_HOST" +email_smtp_host = "$EMAIL_HOSTNAME" +email_smtp_port = $EMAIL_PORT +email_smtp_user = "$EMAIL_USERNAME" +email_smtp_pass = "$EMAIL_PASSWORD" +email_smtp_force_tls = $EMAIL_TLS_SSL +email_smtp_force_starttls = $EMAIL_STARTTLS ## Uncomment and change to your DB's appropiate setting. ## Default is a local sqlite db "mediagoblin.db".