From 2566988f73508da50551d93b8701614aec7718c0 Mon Sep 17 00:00:00 2001 From: Christian Haschek Date: Wed, 10 Nov 2021 09:27:59 +0100 Subject: [PATCH] implemented new settings into docker container --- README.md | 7 ++++--- docker/rootfs/start.sh | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f0b9b51..00570bf 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,8 @@ Just edit the `config.ini` You can use the following settings - [ ] Make better theme - [ ] Configurable settings - [x] Choose domains for random generation - - [ ] Choose if out-of-scope emails are discarded + - [x] Choose if out-of-scope emails are discarded + - [x] Automated cleanup of old mails - [ ] Honeypot mode where all emails are also saved for a catchall account - [ ] Optionally secure whole site with a password - [ ] Optionally allow site to be seen only from specific IP Range @@ -78,10 +79,10 @@ Saving data directory on host machine docker run -p 80:80 -p 25:25 -v /path/on/host/where/to/save/data:/var/www/opentrashmail/data hascheksolutions/opentrashmail ``` -Complete example with running as daemon, persistence, a domain for auto-generation of emails and auto restart +Complete example with running as daemon, persistence, a domain for auto-generation of emails, acceptng only emails for configured domains, cleanup for mails older than 90 days and auto restart ```bash -docker run -d --restart=always --name opentrashmail -e "DOMAINS=mydomain.eu" -e "DATEFORMAT='D.M.YYYY HH:mm'" -p 80:80 -p 25:25 -v /path/on/host/where/to/save/data:/var/www/opentrashmail/data hascheksolutions/opentrashmail +docker run -d --restart=unless-stopped --name opentrashmail -e "DOMAINS=mydomain.eu" -e "DATEFORMAT='D.M.YYYY HH:mm'" -e "DISCARD_UNKNOWN=false" -e "DELETE_OLDER_THAN_DAYS=90" -p 80:80 -p 25:25 -v /path/on/host/where/to/save/data:/var/www/opentrashmail/data hascheksolutions/opentrashmail ``` # How it works diff --git a/docker/rootfs/start.sh b/docker/rootfs/start.sh index 23dc23e..33e83a1 100644 --- a/docker/rootfs/start.sh +++ b/docker/rootfs/start.sh @@ -35,6 +35,12 @@ fi echo "[MAILSERVER]" >> /var/www/opentrashmail/config.ini echo "MAILPORT=25" >> /var/www/opentrashmail/config.ini +if [ "$DISCARD_UNKNOWN" != "" ]; then + echo "DISCARD_UNKNOWN=$DISCARD_UNKNOWN" >> /var/www/opentrashmail/config.ini + echo " [i] Setting up DISCARD_UNKNOWN to: $DISCARD_UNKNOWN" +else + echo "DISCARD_UNKNOWN=false" >> /var/www/opentrashmail/config.ini +fi echo "[DATETIME]" >> /var/www/opentrashmail/config.ini if [ "$DATEFORMAT" != "" ]; then @@ -45,6 +51,11 @@ else echo " [i] Using default dateformat" fi +echo "[CLEANUP]" >> /var/www/opentrashmail/config.ini +if [ "$DELETE_OLDER_THAN_DAYS" != "" ]; then + echo "DELETE_OLDER_THAN_DAYS=$DELETE_OLDER_THAN_DAYS" >> /var/www/opentrashmail/config.ini + echo " [i] Setting up cleanup time to $DELETE_OLDER_THAN_DAYS days" +fi cd /var/www/opentrashmail/python