Browse Source

Add support for email with msmtp

auth_remoteuser
Adrian Malacoda 8 months 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 @@
1 1
 FROM debian:stable
2 2
 
3 3
 RUN apt-get -y update && apt-get -y install nginx php-fpm php-mysql php-apcu php-mbstring php-xml supervisor python-pip \
4
-                                            mysql-client imagemagick curl wget zip unzip php-pclzip git
4
+                                            mysql-client imagemagick curl wget zip unzip php-pclzip git msmtp msmtp-mta
5 5
 RUN pip install supervisor-stdout
6 6
 
7 7
 ENV MW_VERSION REL1_31

+ 16
- 0
configuration/msmtprc View File

@@ -0,0 +1,16 @@
1
+defaults
2
+auth           on
3
+tls            on
4
+tls_trust_file /etc/ssl/certs/ca-certificates.crt
5
+logfile        /var/log/msmtp.log
6
+
7
+account        email
8
+host           @GCL_SMTP_HOST@
9
+port           @GCL_SMTP_PORT@
10
+from           @GCL_SMTP_FROM@
11
+user           @GCL_SMTP_USER@
12
+password       @GCL_SMTP_PASSWORD@
13
+...
14
+
15
+# Set a default account
16
+account default : email

+ 3
- 0
docker-compose.yml View File

@@ -28,3 +28,6 @@ services:
28 28
             GCL_FORUMS_URL: http://localhost:8001/forums
29 29
             GCL_WIKI_URL: http://localhost:8001/wiki
30 30
             GCL_MEMCACHED_HOST: cache
31
+            GCL_SMTP_HOST: mail.gandi.net
32
+            GCL_SMTP_USER: no-reply@monarch-pass.net
33
+            #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
22 22
 rm -rf /application/forums/pm_attachments
23 23
 ln -sf /userdata/pm_attachments /application/forums/pm_attachments
24 24
 
25
+# Configure email
26
+cp /configuration/msmtprc /etc/msmtprc
27
+sed -i "s/@GCL_SMTP_HOST@/$GCL_SMTP_HOST/g" /etc/msmtprc
28
+
29
+SMTP_PORT=${GCL_SMTP_PORT:-587}
30
+sed -i "s/@GCL_SMTP_PORT@/$SMTP_PORT/g" /etc/msmtprc
31
+
32
+SMTP_FROM=${GCL_SMTP_FROM:-no-reply@glitchcity.info}
33
+sed -i "s/@GCL_SMTP_FROM@/$SMTP_FROM/g" /etc/msmtprc
34
+sed -i "s/@GCL_SMTP_USER@/$GCL_SMTP_USER/g" /etc/msmtprc
35
+sed -i "s/@GCL_SMTP_PASSWORD@/$GCL_SMTP_PASSWORD/g" /etc/msmtprc
36
+
25 37
 # Run maintenance scripts
26 38
 cd /application/w/maintenance
27 39
 php update.php

Loading…
Cancel
Save