From c256989b7eaad7181bf128ed31796f8db046ae93 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 13 Nov 2023 10:18:51 +0100 Subject: [PATCH] updated readme to include current version in docker examples --- README.md | 6 +++--- docs/Dev.md | 21 +++++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6317a00..428ca0f 100644 --- a/README.md +++ b/README.md @@ -118,19 +118,19 @@ This in combination with the configuration option "DOMAINS" (eg docker parameter Simple start with no persistence ```bash -docker run -it -p 25:25 -p 80:80 -e URL="https://localhost:80" hascheksolutions/opentrashmail +docker run -it -p 25:25 -p 80:80 -e URL="https://localhost:80" hascheksolutions/opentrashmail:1 ``` Saving data directory on host machine ```bash -docker run -p 80:80 -p 25:25 -e URL="https://localhost:80" -v /path/on/host/where/to/save/data:/var/www/opentrashmail/data hascheksolutions/opentrashmail +docker run -p 80:80 -p 25:25 -e URL="https://localhost:80" -v /path/on/host/where/to/save/data:/var/www/opentrashmail/data hascheksolutions/opentrashmail:1 ``` 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=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 +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:1 ``` # How it works diff --git a/docs/Dev.md b/docs/Dev.md index 07822e3..fe93616 100644 --- a/docs/Dev.md +++ b/docs/Dev.md @@ -1,12 +1,25 @@ -# Quick testing +# Local dev -From the main directory run +## Web UI + +For testing the web UI you need to have php installed. From within the `web/` directory run `php -S localhost:8080 index.php` then you will be able to access the UI via http://localhost:8080 + +Since OpenTrashmail does not use a database, it will work right away but you won't be able to receive emails without running the python SMTP server. + +## Mailserver + +In combination with the PHP command from above you can use docker to run the mail server (since you probably don't have python2 installed on your machine). + +From the root directory run: ```bash -docker build -f docker/Dockerfile -t opentrashmail . && docker run --rm -it --name trashmail -p 3000:80 -p 2525:25 opentrashmail +docker build -f docker/Dockerfile -t opentrashmail . +docker run --rm -it --name trashmail -p 2525:25 \ +-v $( pwd )/data:/var/www/opentrashmail/data \ +-v $( pwd )/config.ini:/var/www/opentrashmail/config.ini:ro opentrashmail ``` -And check if it works on http://localhost:3000 +This binds the mailserver on port 2525 and also mounts the local data directory and your `config.ini` to the container. So emails you receive will show up in your `data` folder. ## Sending debug emails from the command line