Browse Source

Add support for email with msmtp

auth_remoteuser
Adrian Malacoda 1 year ago
parent
commit
e038483e69
4 changed files with 32 additions and 1 deletions
  1. +1
    -1
      Dockerfile
  2. +16
    -0
      configuration/msmtprc
  3. +3
    -0
      docker-compose.yml
  4. +12
    -0
      scripts/setup.sh

+ 1
- 1
Dockerfile View File

@@ -1,7 +1,7 @@
FROM debian:stable

RUN apt-get -y update && apt-get -y install nginx php-fpm php-mysql php-apcu php-mbstring php-xml supervisor python-pip \
mysql-client imagemagick curl wget zip unzip php-pclzip git
mysql-client imagemagick curl wget zip unzip php-pclzip git msmtp msmtp-mta
RUN pip install supervisor-stdout

ENV MW_VERSION REL1_31

+ 16
- 0
configuration/msmtprc View File

@@ -0,0 +1,16 @@
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /var/log/msmtp.log

account email
host @GCL_SMTP_HOST@
port @GCL_SMTP_PORT@
from @GCL_SMTP_FROM@
user @GCL_SMTP_USER@
password @GCL_SMTP_PASSWORD@
...

# Set a default account
account default : email

+ 3
- 0
docker-compose.yml View File

@@ -28,3 +28,6 @@ services:
GCL_FORUMS_URL: http://localhost:8001/forums
GCL_WIKI_URL: http://localhost:8001/wiki
GCL_MEMCACHED_HOST: cache
GCL_SMTP_HOST: mail.gandi.net
GCL_SMTP_USER: no-reply@monarch-pass.net
#GCL_SMTP_PASSWORD: smtp-password-here

+ 12
- 0
scripts/setup.sh View File

@@ -22,6 +22,18 @@ ln -sf /userdata/profile_pictures /application/forums/profile_pictures
rm -rf /application/forums/pm_attachments
ln -sf /userdata/pm_attachments /application/forums/pm_attachments

# Configure email
cp /configuration/msmtprc /etc/msmtprc
sed -i "s/@GCL_SMTP_HOST@/$GCL_SMTP_HOST/g" /etc/msmtprc

SMTP_PORT=${GCL_SMTP_PORT:-587}
sed -i "s/@GCL_SMTP_PORT@/$SMTP_PORT/g" /etc/msmtprc

SMTP_FROM=${GCL_SMTP_FROM:-no-reply@glitchcity.info}
sed -i "s/@GCL_SMTP_FROM@/$SMTP_FROM/g" /etc/msmtprc
sed -i "s/@GCL_SMTP_USER@/$GCL_SMTP_USER/g" /etc/msmtprc
sed -i "s/@GCL_SMTP_PASSWORD@/$GCL_SMTP_PASSWORD/g" /etc/msmtprc

# Run maintenance scripts
cd /application/w/maintenance
php update.php

Loading…
Cancel
Save