Merge remote-tracking branch 'upstream/master' into refactor-config
commit
d0f07984b0
@ -1,10 +1,16 @@
|
|||||||
rules:
|
pull_request_rules:
|
||||||
default: null
|
- name: Successful travis and 2 approved reviews
|
||||||
branches:
|
conditions:
|
||||||
master:
|
- status-success=continuous-integration/travis-ci/pr
|
||||||
protection:
|
- "#approved-reviews-by>=2"
|
||||||
required_status_checks:
|
actions:
|
||||||
contexts:
|
merge:
|
||||||
- continuous-integration/travis-ci
|
method: merge
|
||||||
required_pull_request_reviews:
|
- name: Trusted author, successful travis and 1 approved review
|
||||||
required_approving_review_count: 2
|
conditions:
|
||||||
|
- author~=(kaiyou|muhlemmer|mildred|HorayNarea|adi90x|hoellen|ofthesun9)
|
||||||
|
- status-success=continuous-integration/travis-ci/pr
|
||||||
|
- "#approved-reviews-by>=1"
|
||||||
|
actions:
|
||||||
|
merge:
|
||||||
|
method: merge
|
||||||
|
@ -0,0 +1,59 @@
|
|||||||
|
## Adding more flavors/steps
|
||||||
|
(Everything will go under setup/ directory - using Kubernetes flavor as example)
|
||||||
|
|
||||||
|
Until this point, the app is working as it follows:
|
||||||
|
- when accesing the setup page it will display the flavors selection step (`templates/steps/flavor.html`)
|
||||||
|
- after you choose your desired flavor it will iterare over the files in the flavor directory and building the page
|
||||||
|
(`templates/steps/config.html is general for all flavors`)
|
||||||
|
- when you complete all required fields and press "Setup Mailu" button it will redirect you to the setup page (`flavors/choosen-flavor/setup.html`)
|
||||||
|
|
||||||
|
To add a new flavor you need to create a directory under `templates/steps/` in which you are adding actual steps.
|
||||||
|
Eg: Adding a WIP step we'll create `templates/steps/kubernetes/wip.html`
|
||||||
|
|
||||||
|
*Note that wizard.html is iterating over files in this directory and building the page. Files are prefixed with a number for sorting purposes.*
|
||||||
|
|
||||||
|
wip.html will start with
|
||||||
|
|
||||||
|
```
|
||||||
|
{% call macros.panel("info", "Step X - Work in progress") %}
|
||||||
|
```
|
||||||
|
|
||||||
|
and end with
|
||||||
|
```
|
||||||
|
{% endcall %}
|
||||||
|
```
|
||||||
|
|
||||||
|
You store variable from front-page using the name attribute inside tag.
|
||||||
|
In the example below the string entered in the input field is stored in the variable `named var_test`
|
||||||
|
```
|
||||||
|
<input type="text" name="var_test">
|
||||||
|
```
|
||||||
|
|
||||||
|
In order to user the variable furter you use it like `{{ var_test }}`
|
||||||
|
|
||||||
|
In the setup page (`flavors/kubernetes/setup.html`) you cand add steps by importing macros
|
||||||
|
|
||||||
|
```
|
||||||
|
{% import "macros.html" as macros %}
|
||||||
|
```
|
||||||
|
|
||||||
|
and start and end every step with
|
||||||
|
```
|
||||||
|
{% call macros.panel("info", "Step X - Title") %}
|
||||||
|
-------------------
|
||||||
|
{% endcall %}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generating a file
|
||||||
|
Create the file template in `flavors/kubernetes/` (eg. file.txt) in which you save your variables
|
||||||
|
```
|
||||||
|
ROOT = {{ root }}
|
||||||
|
MY_VAR = {{ var_test }}
|
||||||
|
```
|
||||||
|
|
||||||
|
When you submit to Setup Mailu the file will be generated. In order to get the file add the following command to setup.html
|
||||||
|
|
||||||
|
```
|
||||||
|
<p>curl {{ url_for('.file', uid=uid, filepath='file.txt', _external=True) }} > file.txt</p>
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,34 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
if ($("#webmail").val() == 'none') {
|
||||||
|
$("#webmail_path").hide();
|
||||||
|
$("#webmail_path").attr("value", "");
|
||||||
|
} else {
|
||||||
|
$("#webmail_path").show();
|
||||||
|
$("#webmail_path").attr("value", "/webmail");
|
||||||
|
}
|
||||||
|
$("#webmail").click(function() {
|
||||||
|
if (this.value == 'none') {
|
||||||
|
$("#webmail_path").hide();
|
||||||
|
$("#webmail_path").attr("value", "");
|
||||||
|
} else {
|
||||||
|
$("#webmail_path").show();
|
||||||
|
$("#webmail_path").attr("value", "/webmail");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
if ($('#admin').prop('checked')) {
|
||||||
|
$("#admin_path").show();
|
||||||
|
$("#admin_path").attr("value", "/admin");
|
||||||
|
}
|
||||||
|
$("#admin").change(function() {
|
||||||
|
if ($(this).is(":checked")) {
|
||||||
|
$("#admin_path").show();
|
||||||
|
$("#admin_path").attr("value", "/admin");
|
||||||
|
} else {
|
||||||
|
$("#admin_path").hide();
|
||||||
|
$("#admin_path").attr("value", "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,28 @@
|
|||||||
|
{% call macros.panel("info", "Step 5 - Number of replicas for containers") %}
|
||||||
|
<p>Select number of replicas for containers</p>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<input class="form-control" type="number" name="front_replicas" min="1" required value="1"
|
||||||
|
style="width: 6%; display: inline;">
|
||||||
|
<label>Front</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<input class="form-control" type="number" name="admin_replicas" min="1" required value="1"
|
||||||
|
style="width: 6%; display: inline;">
|
||||||
|
<label>Admin</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<input class="form-control" type="number" name="imap_replicas" min="1" required value="1"
|
||||||
|
style="width: 6%; display: inline;">
|
||||||
|
<label>IMAP</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<input class="form-control" type="number" name=smtp_replicas min="1" required value="1"
|
||||||
|
style="width: 6%; display: inline;">
|
||||||
|
<label>SMPT</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endcall %}
|
@ -0,0 +1,29 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIE/jCCAuagAwIBAgIJAKVnyadXS7SuMA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV
|
||||||
|
BAMMCWxvY2FsaG9zdDAeFw0xODEwMzExMDE1MzFaFw0yODEwMjgxMDE1MzFaMBQx
|
||||||
|
EjA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MQZHcNSkNORNP/2doCkR2qDUkazbhi/3ghLmDGVJ
|
||||||
|
p5OrIPQUwcp1bFOciX22fAaZwoa63ng3K+WZjSqqma05AiOc59MhDLAu6a0rKKO1
|
||||||
|
W3079UVfBB4hkfN2721fqyj+r/0z+R0=
|
||||||
|
-----END PRIVATE KEY-----
|
@ -0,0 +1,4 @@
|
|||||||
|
echo "Creating users ..."
|
||||||
|
docker-compose -f tests/compose/core/docker-compose.yml exec admin python3 manage.py admin admin mailu.io password || exit 1
|
||||||
|
docker-compose -f tests/compose/core/docker-compose.yml exec admin python3 manage.py user --hash_scheme='SHA512-CRYPT' user mailu.io 'password' || exit 1
|
||||||
|
echo "Admin and user successfully created!"
|
@ -0,0 +1 @@
|
|||||||
|
python3 tests/email_test.py message-core
|
@ -0,0 +1,80 @@
|
|||||||
|
# This file is auto-generated by the Mailu configuration wizard.
|
||||||
|
# Please read the documentation before attempting any change.
|
||||||
|
# Generated for compose flavor
|
||||||
|
|
||||||
|
version: '3.6'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
# External dependencies
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- "/mailu/redis:/data"
|
||||||
|
|
||||||
|
# Core services
|
||||||
|
front:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
|
- "127.0.0.1:443:443"
|
||||||
|
- "127.0.0.1:25:25"
|
||||||
|
- "127.0.0.1:465:465"
|
||||||
|
- "127.0.0.1:587:587"
|
||||||
|
- "127.0.0.1:110:110"
|
||||||
|
- "127.0.0.1:995:995"
|
||||||
|
- "127.0.0.1:143:143"
|
||||||
|
- "127.0.0.1:993:993"
|
||||||
|
volumes:
|
||||||
|
- "/mailu/certs:/certs"
|
||||||
|
|
||||||
|
admin:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/data:/data"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
|
||||||
|
imap:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/mail:/mail"
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
smtp:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
antispam:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/filter:/var/lib/rspamd"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
- "/mailu/overrides/rspamd:/etc/rspamd/override.d"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
# Optional services
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Webmail
|
@ -0,0 +1,84 @@
|
|||||||
|
# This file is auto-generated by the Mailu configuration wizard.
|
||||||
|
# Please read the documentation before attempting any change.
|
||||||
|
# Generated for compose flavor
|
||||||
|
|
||||||
|
version: '3.6'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
# External dependencies
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- "/mailu/redis:/data"
|
||||||
|
|
||||||
|
# Core services
|
||||||
|
front:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
|
- "127.0.0.1:443:443"
|
||||||
|
- "127.0.0.1:25:25"
|
||||||
|
- "127.0.0.1:465:465"
|
||||||
|
- "127.0.0.1:587:587"
|
||||||
|
- "127.0.0.1:110:110"
|
||||||
|
- "127.0.0.1:995:995"
|
||||||
|
- "127.0.0.1:143:143"
|
||||||
|
- "127.0.0.1:993:993"
|
||||||
|
volumes:
|
||||||
|
- "/mailu/certs:/certs"
|
||||||
|
|
||||||
|
admin:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/data:/data"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
|
||||||
|
imap:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/mail:/mail"
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
smtp:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
antispam:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/filter:/var/lib/rspamd"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
- "/mailu/overrides/rspamd:/etc/rspamd/override.d"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
# Optional services
|
||||||
|
|
||||||
|
|
||||||
|
fetchmail:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/fetchmail:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
|
||||||
|
# Webmail
|
@ -0,0 +1,139 @@
|
|||||||
|
# Mailu main configuration file
|
||||||
|
#
|
||||||
|
# Generated for compose flavor
|
||||||
|
#
|
||||||
|
# This file is autogenerated by the configuration management wizard.
|
||||||
|
# For a detailed list of configuration variables, see the documentation at
|
||||||
|
# https://mailu.io
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Common configuration variables
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Set this to the path where Mailu data and configuration is stored
|
||||||
|
# This variable is now set directly in `docker-compose.yml by the setup utility
|
||||||
|
# ROOT=/mailu
|
||||||
|
|
||||||
|
# Mailu version to run (1.0, 1.1, etc. or master)
|
||||||
|
#VERSION=master
|
||||||
|
|
||||||
|
# Set to a randomly generated 16 bytes string
|
||||||
|
SECRET_KEY=JS48Q9KE3B6T97E6
|
||||||
|
|
||||||
|
# Address where listening ports should bind
|
||||||
|
# This variables are now set directly in `docker-compose.yml by the setup utility
|
||||||
|
# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
|
||||||
|
# PUBLIC_IPV6= (default: ::1)
|
||||||
|
|
||||||
|
# Main mail domain
|
||||||
|
DOMAIN=mailu.io
|
||||||
|
|
||||||
|
# Hostnames for this server, separated with comas
|
||||||
|
HOSTNAMES=localhost
|
||||||
|
|
||||||
|
# Postmaster local part (will append the main mail domain)
|
||||||
|
POSTMASTER=admin
|
||||||
|
|
||||||
|
# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
|
||||||
|
TLS_FLAVOR=cert
|
||||||
|
|
||||||
|
# Authentication rate limit (per source IP address)
|
||||||
|
AUTH_RATELIMIT=10/minute;1000/hour
|
||||||
|
|
||||||
|
# Opt-out of statistics, replace with "True" to opt out
|
||||||
|
DISABLE_STATISTICS=False
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Optional features
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Expose the admin interface (value: true, false)
|
||||||
|
ADMIN=true
|
||||||
|
|
||||||
|
# Choose which webmail to run if any (values: roundcube, rainloop, none)
|
||||||
|
WEBMAIL=none
|
||||||
|
|
||||||
|
# Dav server implementation (value: radicale, none)
|
||||||
|
WEBDAV=none
|
||||||
|
|
||||||
|
# Antivirus solution (value: clamav, none)
|
||||||
|
#ANTIVIRUS=none
|
||||||
|
|
||||||
|
#Antispam solution
|
||||||
|
ANTISPAM=none
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Mail settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Message size limit in bytes
|
||||||
|
# Default: accept messages up to 50MB
|
||||||
|
MESSAGE_SIZE_LIMIT=50000000
|
||||||
|
|
||||||
|
# Networks granted relay permissions, make sure that you include your Docker
|
||||||
|
# internal network (default to 172.17.0.0/16)
|
||||||
|
RELAYNETS=172.17.0.0/16
|
||||||
|
|
||||||
|
# Will relay all outgoing mails if configured
|
||||||
|
RELAYHOST=
|
||||||
|
|
||||||
|
# Fetchmail delay
|
||||||
|
FETCHMAIL_DELAY=600
|
||||||
|
|
||||||
|
# Recipient delimiter, character used to delimiter localpart from custom address part
|
||||||
|
RECIPIENT_DELIMITER=+
|
||||||
|
|
||||||
|
# DMARC rua and ruf email
|
||||||
|
DMARC_RUA=admin
|
||||||
|
DMARC_RUF=admin
|
||||||
|
|
||||||
|
|
||||||
|
# Maildir Compression
|
||||||
|
# choose compression-method, default: none (value: bz2, gz)
|
||||||
|
COMPRESSION=
|
||||||
|
# change compression-level, default: 6 (value: 1-9)
|
||||||
|
COMPRESSION_LEVEL=
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Web settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Path to the admin interface if enabled
|
||||||
|
WEB_ADMIN=/admin
|
||||||
|
|
||||||
|
# Path to the webmail if enabled
|
||||||
|
WEB_WEBMAIL=/webmail
|
||||||
|
|
||||||
|
# Website name
|
||||||
|
SITENAME=Mailu
|
||||||
|
|
||||||
|
# Linked Website URL
|
||||||
|
WEBSITE=https://mailu.io
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Advanced settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Log driver for front service. Possible values:
|
||||||
|
# json-file (default)
|
||||||
|
# journald (On systemd platforms, useful for Fail2Ban integration)
|
||||||
|
# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
|
||||||
|
# LOG_DRIVER=json-file
|
||||||
|
|
||||||
|
# Docker-compose project name, this will prepended to containers names.
|
||||||
|
COMPOSE_PROJECT_NAME=mailu
|
||||||
|
|
||||||
|
# Default password scheme used for newly created accounts and changed passwords
|
||||||
|
# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
|
||||||
|
PASSWORD_SCHEME=BLF-CRYPT
|
||||||
|
|
||||||
|
# Header to take the real ip from
|
||||||
|
REAL_IP_HEADER=
|
||||||
|
|
||||||
|
# IPs for nginx set_real_ip_from (CIDR list separated by commas)
|
||||||
|
REAL_IP_FROM=
|
||||||
|
|
||||||
|
# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
|
||||||
|
REJECT_UNLISTED_RECIPIENT=
|
@ -0,0 +1,6 @@
|
|||||||
|
python3 tests/email_test.py message-virus "tests/compose/filters/eicar.com"
|
||||||
|
if [ $? -eq 99 ]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
@ -0,0 +1,86 @@
|
|||||||
|
# This file is auto-generated by the Mailu configuration wizard.
|
||||||
|
# Please read the documentation before attempting any change.
|
||||||
|
# Generated for compose flavor
|
||||||
|
|
||||||
|
version: '3.6'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
# External dependencies
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- "/mailu/redis:/data"
|
||||||
|
|
||||||
|
# Core services
|
||||||
|
front:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
|
- "127.0.0.1:443:443"
|
||||||
|
- "127.0.0.1:25:25"
|
||||||
|
- "127.0.0.1:465:465"
|
||||||
|
- "127.0.0.1:587:587"
|
||||||
|
- "127.0.0.1:110:110"
|
||||||
|
- "127.0.0.1:995:995"
|
||||||
|
- "127.0.0.1:143:143"
|
||||||
|
- "127.0.0.1:993:993"
|
||||||
|
volumes:
|
||||||
|
- "/mailu/certs:/certs"
|
||||||
|
|
||||||
|
admin:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/data:/data"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
|
||||||
|
imap:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/mail:/mail"
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
smtp:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
antispam:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/filter:/var/lib/rspamd"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
- "/mailu/overrides/rspamd:/etc/rspamd/override.d"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
# Optional services
|
||||||
|
antivirus:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/clamav:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/filter:/data"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Webmail
|
@ -0,0 +1 @@
|
|||||||
|
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
|
@ -0,0 +1,139 @@
|
|||||||
|
# Mailu main configuration file
|
||||||
|
#
|
||||||
|
# Generated for compose flavor
|
||||||
|
#
|
||||||
|
# This file is autogenerated by the configuration management wizard.
|
||||||
|
# For a detailed list of configuration variables, see the documentation at
|
||||||
|
# https://mailu.io
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Common configuration variables
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Set this to the path where Mailu data and configuration is stored
|
||||||
|
# This variable is now set directly in `docker-compose.yml by the setup utility
|
||||||
|
# ROOT=/mailu
|
||||||
|
|
||||||
|
# Mailu version to run (1.0, 1.1, etc. or master)
|
||||||
|
#VERSION=master
|
||||||
|
|
||||||
|
# Set to a randomly generated 16 bytes string
|
||||||
|
SECRET_KEY=11H6XURLGE7GW3U1
|
||||||
|
|
||||||
|
# Address where listening ports should bind
|
||||||
|
# This variables are now set directly in `docker-compose.yml by the setup utility
|
||||||
|
# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
|
||||||
|
# PUBLIC_IPV6= (default: ::1)
|
||||||
|
|
||||||
|
# Main mail domain
|
||||||
|
DOMAIN=mailu.io
|
||||||
|
|
||||||
|
# Hostnames for this server, separated with comas
|
||||||
|
HOSTNAMES=localhost
|
||||||
|
|
||||||
|
# Postmaster local part (will append the main mail domain)
|
||||||
|
POSTMASTER=admin
|
||||||
|
|
||||||
|
# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
|
||||||
|
TLS_FLAVOR=cert
|
||||||
|
|
||||||
|
# Authentication rate limit (per source IP address)
|
||||||
|
AUTH_RATELIMIT=10/minute;1000/hour
|
||||||
|
|
||||||
|
# Opt-out of statistics, replace with "True" to opt out
|
||||||
|
DISABLE_STATISTICS=False
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Optional features
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Expose the admin interface (value: true, false)
|
||||||
|
ADMIN=true
|
||||||
|
|
||||||
|
# Choose which webmail to run if any (values: roundcube, rainloop, none)
|
||||||
|
WEBMAIL=none
|
||||||
|
|
||||||
|
# Dav server implementation (value: radicale, none)
|
||||||
|
WEBDAV=none
|
||||||
|
|
||||||
|
# Antivirus solution (value: clamav, none)
|
||||||
|
#ANTIVIRUS=clamav
|
||||||
|
|
||||||
|
#Antispam solution
|
||||||
|
ANTISPAM=none
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Mail settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Message size limit in bytes
|
||||||
|
# Default: accept messages up to 50MB
|
||||||
|
MESSAGE_SIZE_LIMIT=50000000
|
||||||
|
|
||||||
|
# Networks granted relay permissions, make sure that you include your Docker
|
||||||
|
# internal network (default to 172.17.0.0/16)
|
||||||
|
RELAYNETS=172.17.0.0/16
|
||||||
|
|
||||||
|
# Will relay all outgoing mails if configured
|
||||||
|
RELAYHOST=
|
||||||
|
|
||||||
|
# Fetchmail delay
|
||||||
|
FETCHMAIL_DELAY=600
|
||||||
|
|
||||||
|
# Recipient delimiter, character used to delimiter localpart from custom address part
|
||||||
|
RECIPIENT_DELIMITER=+
|
||||||
|
|
||||||
|
# DMARC rua and ruf email
|
||||||
|
DMARC_RUA=admin
|
||||||
|
DMARC_RUF=admin
|
||||||
|
|
||||||
|
|
||||||
|
# Maildir Compression
|
||||||
|
# choose compression-method, default: none (value: bz2, gz)
|
||||||
|
COMPRESSION=
|
||||||
|
# change compression-level, default: 6 (value: 1-9)
|
||||||
|
COMPRESSION_LEVEL=
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Web settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Path to the admin interface if enabled
|
||||||
|
WEB_ADMIN=/admin
|
||||||
|
|
||||||
|
# Path to the webmail if enabled
|
||||||
|
WEB_WEBMAIL=/webmail
|
||||||
|
|
||||||
|
# Website name
|
||||||
|
SITENAME=Mailu
|
||||||
|
|
||||||
|
# Linked Website URL
|
||||||
|
WEBSITE=https://mailu.io
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Advanced settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Log driver for front service. Possible values:
|
||||||
|
# json-file (default)
|
||||||
|
# journald (On systemd platforms, useful for Fail2Ban integration)
|
||||||
|
# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
|
||||||
|
# LOG_DRIVER=json-file
|
||||||
|
|
||||||
|
# Docker-compose project name, this will prepended to containers names.
|
||||||
|
COMPOSE_PROJECT_NAME=mailu
|
||||||
|
|
||||||
|
# Default password scheme used for newly created accounts and changed passwords
|
||||||
|
# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
|
||||||
|
PASSWORD_SCHEME=BLF-CRYPT
|
||||||
|
|
||||||
|
# Header to take the real ip from
|
||||||
|
REAL_IP_HEADER=
|
||||||
|
|
||||||
|
# IPs for nginx set_real_ip_from (CIDR list separated by commas)
|
||||||
|
REAL_IP_FROM=
|
||||||
|
|
||||||
|
# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
|
||||||
|
REJECT_UNLISTED_RECIPIENT=
|
@ -0,0 +1,88 @@
|
|||||||
|
# This file is auto-generated by the Mailu configuration wizard.
|
||||||
|
# Please read the documentation before attempting any change.
|
||||||
|
# Generated for compose flavor
|
||||||
|
|
||||||
|
version: '3.6'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
# External dependencies
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- "/mailu/redis:/data"
|
||||||
|
|
||||||
|
# Core services
|
||||||
|
front:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
|
- "127.0.0.1:443:443"
|
||||||
|
- "127.0.0.1:25:25"
|
||||||
|
- "127.0.0.1:465:465"
|
||||||
|
- "127.0.0.1:587:587"
|
||||||
|
- "127.0.0.1:110:110"
|
||||||
|
- "127.0.0.1:995:995"
|
||||||
|
- "127.0.0.1:143:143"
|
||||||
|
- "127.0.0.1:993:993"
|
||||||
|
volumes:
|
||||||
|
- "/mailu/certs:/certs"
|
||||||
|
|
||||||
|
admin:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/data:/data"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
|
||||||
|
imap:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/mail:/mail"
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
smtp:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
antispam:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/filter:/var/lib/rspamd"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
- "/mailu/overrides/rspamd:/etc/rspamd/override.d"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
# Optional services
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Webmail
|
||||||
|
webmail:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/rainloop:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/webmail:/data"
|
||||||
|
depends_on:
|
||||||
|
- imap
|
@ -0,0 +1,139 @@
|
|||||||
|
# Mailu main configuration file
|
||||||
|
#
|
||||||
|
# Generated for compose flavor
|
||||||
|
#
|
||||||
|
# This file is autogenerated by the configuration management wizard.
|
||||||
|
# For a detailed list of configuration variables, see the documentation at
|
||||||
|
# https://mailu.io
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Common configuration variables
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Set this to the path where Mailu data and configuration is stored
|
||||||
|
# This variable is now set directly in `docker-compose.yml by the setup utility
|
||||||
|
# ROOT=/mailu
|
||||||
|
|
||||||
|
# Mailu version to run (1.0, 1.1, etc. or master)
|
||||||
|
#VERSION=master
|
||||||
|
|
||||||
|
# Set to a randomly generated 16 bytes string
|
||||||
|
SECRET_KEY=V5J4SHRYVW9PZIQU
|
||||||
|
|
||||||
|
# Address where listening ports should bind
|
||||||
|
# This variables are now set directly in `docker-compose.yml by the setup utility
|
||||||
|
# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
|
||||||
|
# PUBLIC_IPV6= (default: ::1)
|
||||||
|
|
||||||
|
# Main mail domain
|
||||||
|
DOMAIN=mailu.io
|
||||||
|
|
||||||
|
# Hostnames for this server, separated with comas
|
||||||
|
HOSTNAMES=localhost
|
||||||
|
|
||||||
|
# Postmaster local part (will append the main mail domain)
|
||||||
|
POSTMASTER=admin
|
||||||
|
|
||||||
|
# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
|
||||||
|
TLS_FLAVOR=cert
|
||||||
|
|
||||||
|
# Authentication rate limit (per source IP address)
|
||||||
|
AUTH_RATELIMIT=10/minute;1000/hour
|
||||||
|
|
||||||
|
# Opt-out of statistics, replace with "True" to opt out
|
||||||
|
DISABLE_STATISTICS=False
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Optional features
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Expose the admin interface (value: true, false)
|
||||||
|
ADMIN=true
|
||||||
|
|
||||||
|
# Choose which webmail to run if any (values: roundcube, rainloop, none)
|
||||||
|
WEBMAIL=rainloop
|
||||||
|
|
||||||
|
# Dav server implementation (value: radicale, none)
|
||||||
|
WEBDAV=none
|
||||||
|
|
||||||
|
# Antivirus solution (value: clamav, none)
|
||||||
|
#ANTIVIRUS=none
|
||||||
|
|
||||||
|
#Antispam solution
|
||||||
|
ANTISPAM=none
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Mail settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Message size limit in bytes
|
||||||
|
# Default: accept messages up to 50MB
|
||||||
|
MESSAGE_SIZE_LIMIT=50000000
|
||||||
|
|
||||||
|
# Networks granted relay permissions, make sure that you include your Docker
|
||||||
|
# internal network (default to 172.17.0.0/16)
|
||||||
|
RELAYNETS=172.17.0.0/16
|
||||||
|
|
||||||
|
# Will relay all outgoing mails if configured
|
||||||
|
RELAYHOST=
|
||||||
|
|
||||||
|
# Fetchmail delay
|
||||||
|
FETCHMAIL_DELAY=600
|
||||||
|
|
||||||
|
# Recipient delimiter, character used to delimiter localpart from custom address part
|
||||||
|
RECIPIENT_DELIMITER=+
|
||||||
|
|
||||||
|
# DMARC rua and ruf email
|
||||||
|
DMARC_RUA=admin
|
||||||
|
DMARC_RUF=admin
|
||||||
|
|
||||||
|
|
||||||
|
# Maildir Compression
|
||||||
|
# choose compression-method, default: none (value: bz2, gz)
|
||||||
|
COMPRESSION=
|
||||||
|
# change compression-level, default: 6 (value: 1-9)
|
||||||
|
COMPRESSION_LEVEL=
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Web settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Path to the admin interface if enabled
|
||||||
|
WEB_ADMIN=/admin
|
||||||
|
|
||||||
|
# Path to the webmail if enabled
|
||||||
|
WEB_WEBMAIL=/webmail
|
||||||
|
|
||||||
|
# Website name
|
||||||
|
SITENAME=Mailu
|
||||||
|
|
||||||
|
# Linked Website URL
|
||||||
|
WEBSITE=https://mailu.io
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Advanced settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Log driver for front service. Possible values:
|
||||||
|
# json-file (default)
|
||||||
|
# journald (On systemd platforms, useful for Fail2Ban integration)
|
||||||
|
# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
|
||||||
|
# LOG_DRIVER=json-file
|
||||||
|
|
||||||
|
# Docker-compose project name, this will prepended to containers names.
|
||||||
|
COMPOSE_PROJECT_NAME=mailu
|
||||||
|
|
||||||
|
# Default password scheme used for newly created accounts and changed passwords
|
||||||
|
# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
|
||||||
|
PASSWORD_SCHEME=BLF-CRYPT
|
||||||
|
|
||||||
|
# Header to take the real ip from
|
||||||
|
REAL_IP_HEADER=
|
||||||
|
|
||||||
|
# IPs for nginx set_real_ip_from (CIDR list separated by commas)
|
||||||
|
REAL_IP_FROM=
|
||||||
|
|
||||||
|
# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
|
||||||
|
REJECT_UNLISTED_RECIPIENT=
|
@ -0,0 +1,88 @@
|
|||||||
|
# This file is auto-generated by the Mailu configuration wizard.
|
||||||
|
# Please read the documentation before attempting any change.
|
||||||
|
# Generated for compose flavor
|
||||||
|
|
||||||
|
version: '3.6'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
# External dependencies
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- "/mailu/redis:/data"
|
||||||
|
|
||||||
|
# Core services
|
||||||
|
front:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
|
- "127.0.0.1:443:443"
|
||||||
|
- "127.0.0.1:25:25"
|
||||||
|
- "127.0.0.1:465:465"
|
||||||
|
- "127.0.0.1:587:587"
|
||||||
|
- "127.0.0.1:110:110"
|
||||||
|
- "127.0.0.1:995:995"
|
||||||
|
- "127.0.0.1:143:143"
|
||||||
|
- "127.0.0.1:993:993"
|
||||||
|
volumes:
|
||||||
|
- "/mailu/certs:/certs"
|
||||||
|
|
||||||
|
admin:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/data:/data"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
|
||||||
|
imap:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/mail:/mail"
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
smtp:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
antispam:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/filter:/var/lib/rspamd"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
- "/mailu/overrides/rspamd:/etc/rspamd/override.d"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
# Optional services
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Webmail
|
||||||
|
webmail:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/roundcube:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/webmail:/data"
|
||||||
|
depends_on:
|
||||||
|
- imap
|
@ -0,0 +1,139 @@
|
|||||||
|
# Mailu main configuration file
|
||||||
|
#
|
||||||
|
# Generated for compose flavor
|
||||||
|
#
|
||||||
|
# This file is autogenerated by the configuration management wizard.
|
||||||
|
# For a detailed list of configuration variables, see the documentation at
|
||||||
|
# https://mailu.io
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Common configuration variables
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Set this to the path where Mailu data and configuration is stored
|
||||||
|
# This variable is now set directly in `docker-compose.yml by the setup utility
|
||||||
|
# ROOT=/mailu
|
||||||
|
|
||||||
|
# Mailu version to run (1.0, 1.1, etc. or master)
|
||||||
|
#VERSION=master
|
||||||
|
|
||||||
|
# Set to a randomly generated 16 bytes string
|
||||||
|
SECRET_KEY=PGGO2JRQ59QV3DW7
|
||||||
|
|
||||||
|
# Address where listening ports should bind
|
||||||
|
# This variables are now set directly in `docker-compose.yml by the setup utility
|
||||||
|
# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
|
||||||
|
# PUBLIC_IPV6= (default: ::1)
|
||||||
|
|
||||||
|
# Main mail domain
|
||||||
|
DOMAIN=mailu.io
|
||||||
|
|
||||||
|
# Hostnames for this server, separated with comas
|
||||||
|
HOSTNAMES=localhost
|
||||||
|
|
||||||
|
# Postmaster local part (will append the main mail domain)
|
||||||
|
POSTMASTER=admin
|
||||||
|
|
||||||
|
# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
|
||||||
|
TLS_FLAVOR=cert
|
||||||
|
|
||||||
|
# Authentication rate limit (per source IP address)
|
||||||
|
AUTH_RATELIMIT=10/minute;1000/hour
|
||||||
|
|
||||||
|
# Opt-out of statistics, replace with "True" to opt out
|
||||||
|
DISABLE_STATISTICS=False
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Optional features
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Expose the admin interface (value: true, false)
|
||||||
|
ADMIN=true
|
||||||
|
|
||||||
|
# Choose which webmail to run if any (values: roundcube, rainloop, none)
|
||||||
|
WEBMAIL=roundcube
|
||||||
|
|
||||||
|
# Dav server implementation (value: radicale, none)
|
||||||
|
WEBDAV=none
|
||||||
|
|
||||||
|
# Antivirus solution (value: clamav, none)
|
||||||
|
#ANTIVIRUS=none
|
||||||
|
|
||||||
|
#Antispam solution
|
||||||
|
ANTISPAM=none
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Mail settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Message size limit in bytes
|
||||||
|
# Default: accept messages up to 50MB
|
||||||
|
MESSAGE_SIZE_LIMIT=50000000
|
||||||
|
|
||||||
|
# Networks granted relay permissions, make sure that you include your Docker
|
||||||
|
# internal network (default to 172.17.0.0/16)
|
||||||
|
RELAYNETS=172.17.0.0/16
|
||||||
|
|
||||||
|
# Will relay all outgoing mails if configured
|
||||||
|
RELAYHOST=
|
||||||
|
|
||||||
|
# Fetchmail delay
|
||||||
|
FETCHMAIL_DELAY=600
|
||||||
|
|
||||||
|
# Recipient delimiter, character used to delimiter localpart from custom address part
|
||||||
|
RECIPIENT_DELIMITER=+
|
||||||
|
|
||||||
|
# DMARC rua and ruf email
|
||||||
|
DMARC_RUA=admin
|
||||||
|
DMARC_RUF=admin
|
||||||
|
|
||||||
|
|
||||||
|
# Maildir Compression
|
||||||
|
# choose compression-method, default: none (value: bz2, gz)
|
||||||
|
COMPRESSION=
|
||||||
|
# change compression-level, default: 6 (value: 1-9)
|
||||||
|
COMPRESSION_LEVEL=
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Web settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Path to the admin interface if enabled
|
||||||
|
WEB_ADMIN=/admin
|
||||||
|
|
||||||
|
# Path to the webmail if enabled
|
||||||
|
WEB_WEBMAIL=/webmail
|
||||||
|
|
||||||
|
# Website name
|
||||||
|
SITENAME=Mailu
|
||||||
|
|
||||||
|
# Linked Website URL
|
||||||
|
WEBSITE=https://mailu.io
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Advanced settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Log driver for front service. Possible values:
|
||||||
|
# json-file (default)
|
||||||
|
# journald (On systemd platforms, useful for Fail2Ban integration)
|
||||||
|
# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
|
||||||
|
# LOG_DRIVER=json-file
|
||||||
|
|
||||||
|
# Docker-compose project name, this will prepended to containers names.
|
||||||
|
COMPOSE_PROJECT_NAME=mailu
|
||||||
|
|
||||||
|
# Default password scheme used for newly created accounts and changed passwords
|
||||||
|
# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
|
||||||
|
PASSWORD_SCHEME=BLF-CRYPT
|
||||||
|
|
||||||
|
# Header to take the real ip from
|
||||||
|
REAL_IP_HEADER=
|
||||||
|
|
||||||
|
# IPs for nginx set_real_ip_from (CIDR list separated by commas)
|
||||||
|
REAL_IP_FROM=
|
||||||
|
|
||||||
|
# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
|
||||||
|
REJECT_UNLISTED_RECIPIENT=
|
@ -1,101 +0,0 @@
|
|||||||
version: '2'
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
front:
|
|
||||||
image: $DOCKER_ORG/nginx:$VERSION
|
|
||||||
restart: 'no'
|
|
||||||
env_file: $PWD/.env
|
|
||||||
logging:
|
|
||||||
driver: $LOG_DRIVER
|
|
||||||
ports:
|
|
||||||
- "$BIND_ADDRESS4:80:80"
|
|
||||||
- "$BIND_ADDRESS4:443:443"
|
|
||||||
- "$BIND_ADDRESS4:110:110"
|
|
||||||
- "$BIND_ADDRESS4:143:143"
|
|
||||||
- "$BIND_ADDRESS4:993:993"
|
|
||||||
- "$BIND_ADDRESS4:995:995"
|
|
||||||
- "$BIND_ADDRESS4:25:25"
|
|
||||||
- "$BIND_ADDRESS4:465:465"
|
|
||||||
- "$BIND_ADDRESS4:587:587"
|
|
||||||
volumes:
|
|
||||||
- "$ROOT/certs:/certs"
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:alpine
|
|
||||||
restart: 'no'
|
|
||||||
volumes:
|
|
||||||
- "$ROOT/redis:/data"
|
|
||||||
|
|
||||||
imap:
|
|
||||||
image: $DOCKER_ORG/dovecot:$VERSION
|
|
||||||
restart: 'no'
|
|
||||||
env_file: $PWD/.env
|
|
||||||
volumes:
|
|
||||||
- "$ROOT/data:/data"
|
|
||||||
- "$ROOT/mail:/mail"
|
|
||||||
- "$ROOT/overrides:/overrides"
|
|
||||||
depends_on:
|
|
||||||
- front
|
|
||||||
|
|
||||||
smtp:
|
|
||||||
image: $DOCKER_ORG/postfix:$VERSION
|
|
||||||
restart: 'no'
|
|
||||||
env_file: $PWD/.env
|
|
||||||
volumes:
|
|
||||||
- "$ROOT/data:/data"
|
|
||||||
- "$ROOT/overrides:/overrides"
|
|
||||||
depends_on:
|
|
||||||
- front
|
|
||||||
|
|
||||||
antispam:
|
|
||||||
image: $DOCKER_ORG/rspamd:$VERSION
|
|
||||||
restart: 'no'
|
|
||||||
env_file: $PWD/.env
|
|
||||||
volumes:
|
|
||||||
- "$ROOT/filter:/var/lib/rspamd"
|
|
||||||
- "$ROOT/dkim:/dkim"
|
|
||||||
- "$ROOT/overrides/rspamd:/etc/rspamd/override.d"
|
|
||||||
depends_on:
|
|
||||||
- front
|
|
||||||
|
|
||||||
antivirus:
|
|
||||||
image: $DOCKER_ORG/$ANTIVIRUS:$VERSION
|
|
||||||
restart: 'no'
|
|
||||||
env_file: $PWD/.env
|
|
||||||
volumes:
|
|
||||||
- "$ROOT/filter:/data"
|
|
||||||
|
|
||||||
webdav:
|
|
||||||
image: $DOCKER_ORG/$WEBDAV:$VERSION
|
|
||||||
restart: 'no'
|
|
||||||
env_file: $PWD/.env
|
|
||||||
volumes:
|
|
||||||
- "$ROOT/dav:/data"
|
|
||||||
|
|
||||||
admin:
|
|
||||||
image: $DOCKER_ORG/admin:$VERSION
|
|
||||||
restart: 'no'
|
|
||||||
env_file: $PWD/.env
|
|
||||||
volumes:
|
|
||||||
- "$ROOT/data:/data"
|
|
||||||
- "$ROOT/dkim:/dkim"
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
depends_on:
|
|
||||||
- redis
|
|
||||||
|
|
||||||
webmail:
|
|
||||||
image: "$DOCKER_ORG/$WEBMAIL:$VERSION"
|
|
||||||
restart: 'no'
|
|
||||||
env_file: $PWD/.env
|
|
||||||
volumes:
|
|
||||||
- "$ROOT/webmail:/data"
|
|
||||||
depends_on:
|
|
||||||
- imap
|
|
||||||
|
|
||||||
fetchmail:
|
|
||||||
image: $DOCKER_ORG/fetchmail:$VERSION
|
|
||||||
restart: 'no'
|
|
||||||
env_file: $PWD/.env
|
|
||||||
volumes:
|
|
||||||
- "$ROOT/data:/data"
|
|
@ -1,57 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
containers=(
|
|
||||||
webmail
|
|
||||||
imap
|
|
||||||
smtp
|
|
||||||
antispam
|
|
||||||
admin
|
|
||||||
redis
|
|
||||||
antivirus
|
|
||||||
webdav
|
|
||||||
# fetchmail
|
|
||||||
front
|
|
||||||
)
|
|
||||||
|
|
||||||
# Time to sleep in minutes after starting the containers
|
|
||||||
WAIT=1
|
|
||||||
|
|
||||||
containers_check() {
|
|
||||||
status=0
|
|
||||||
for container in "${containers[@]}"; do
|
|
||||||
name="${DOCKER_ORG}_${container}_1"
|
|
||||||
echo "Checking $name"
|
|
||||||
docker inspect "$name" | grep '"Status": "running"' || status=1
|
|
||||||
done
|
|
||||||
docker ps -a
|
|
||||||
return $status
|
|
||||||
}
|
|
||||||
|
|
||||||
container_logs() {
|
|
||||||
for container in "${containers[@]}"; do
|
|
||||||
name="${DOCKER_ORG}_${container}_1"
|
|
||||||
echo "Showing logs for $name"
|
|
||||||
docker container logs "$name"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
clean() {
|
|
||||||
docker-compose -f tests/compose/run.yml -p $DOCKER_ORG down || exit 1
|
|
||||||
rm -fv .env
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup before callig exit
|
|
||||||
die() {
|
|
||||||
clean
|
|
||||||
exit $1
|
|
||||||
}
|
|
||||||
|
|
||||||
for file in tests/compose/*.env ; do
|
|
||||||
cp $file .env
|
|
||||||
docker-compose -f tests/compose/run.yml -p $DOCKER_ORG up -d
|
|
||||||
echo -e "\nSleeping for ${WAIT} minutes" # Clean terminal distortion from docker-compose in travis
|
|
||||||
travis_wait sleep ${WAIT}m || sleep ${WAIT}m #Fallback sleep for local run
|
|
||||||
container_logs
|
|
||||||
containers_check || die 1
|
|
||||||
clean
|
|
||||||
done
|
|
||||||
|
|
@ -0,0 +1,100 @@
|
|||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
import docker
|
||||||
|
from colorama import Fore, Style
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
# Declare variables for service name and sleep time
|
||||||
|
test_name=sys.argv[1]
|
||||||
|
timeout=int(sys.argv[2])
|
||||||
|
test_path="tests/compose/" + test_name + "/"
|
||||||
|
compose_file=test_path + "docker-compose.yml"
|
||||||
|
|
||||||
|
client = docker.APIClient(base_url='unix://var/run/docker.sock')
|
||||||
|
|
||||||
|
containers = []
|
||||||
|
|
||||||
|
# Stop containers
|
||||||
|
def stop(exit_code):
|
||||||
|
print_logs()
|
||||||
|
sys.stdout.flush()
|
||||||
|
print(subprocess.check_output("docker-compose -f " + compose_file + " down", shell=True).decode())
|
||||||
|
sys.exit(exit_code)
|
||||||
|
|
||||||
|
# Sleep for a defined amount of time
|
||||||
|
def sleep():
|
||||||
|
print(Fore.LIGHTMAGENTA_EX + "Sleeping for " + str(timeout) + "m" + Style.RESET_ALL)
|
||||||
|
time.sleep(timeout*60)
|
||||||
|
|
||||||
|
def health_checks():
|
||||||
|
exit_code = 0
|
||||||
|
#Iterating trough all containers dictionary
|
||||||
|
for container in client.containers(all=True):
|
||||||
|
#Perform "docker container inspect" on container based on container ID and save output to a dictionary
|
||||||
|
container_inspect = client.inspect_container(container['Id']) #Dict
|
||||||
|
|
||||||
|
if "Health" in container_inspect['State'].keys():
|
||||||
|
if container_inspect['State']['Health']['Status'] == "healthy":
|
||||||
|
print(Fore.GREEN + "Health status for " + container_inspect['Name'].replace("/", "") + " : " + Fore.CYAN + container_inspect['State']['Health']['Status'] + Style.RESET_ALL)
|
||||||
|
if container_inspect['State']['Health']['Status'] != "healthy":
|
||||||
|
print(Fore.RED + "Container " + container_inspect['Name'].replace("/", "") + " is " + Fore.YELLOW + container_inspect['State']['Health']['Status']
|
||||||
|
+ Fore.RED + ", FailingStreak: " + Fore.YELLOW + str(container_inspect['State']['Health']['FailingStreak'])
|
||||||
|
+ Fore.RED + ", Log: " + Fore.YELLOW + str(container_inspect['State']['Health']['Log']) + Style.RESET_ALL)
|
||||||
|
exit_code = 1
|
||||||
|
else:
|
||||||
|
if container_inspect['State']['Status'] == "running":
|
||||||
|
print(Fore.GREEN + "Running status for " + container_inspect['Name'].replace("/", "") + " : " + Fore.BLUE + container_inspect['State']['Status'] + Style.RESET_ALL)
|
||||||
|
if container_inspect['State']['Status'] != "running":
|
||||||
|
print(Fore.RED + "Container " + container_inspect['Name'].replace("/", "") + " state is: " + Fore.YELLOW + container_inspect['State']['Status'] + Style.RESET_ALL)
|
||||||
|
exit_code = 1
|
||||||
|
|
||||||
|
#Saving Id, Name and state to a new dictionary
|
||||||
|
containers_dict = {}
|
||||||
|
containers_dict['Name'] = container_inspect['Name'].replace("/", "")
|
||||||
|
containers_dict['Id'] = container_inspect['Id']
|
||||||
|
containers_dict['State'] = container_inspect['State']
|
||||||
|
|
||||||
|
#Adding the generated dictionary to a list
|
||||||
|
containers.append(containers_dict)
|
||||||
|
|
||||||
|
if exit_code != 0:
|
||||||
|
stop(exit_code)
|
||||||
|
|
||||||
|
def print_logs():
|
||||||
|
print("Printing logs ...")
|
||||||
|
#Iterating through docker container inspect list and print logs
|
||||||
|
for container in containers:
|
||||||
|
print(Fore.LIGHTMAGENTA_EX + "Printing logs for: " + Fore.GREEN + container['Name'] + Style.RESET_ALL)
|
||||||
|
sys.stdout.flush()
|
||||||
|
print(subprocess.check_output('docker container logs ' + container['Name'], shell=True).decode())
|
||||||
|
|
||||||
|
#Iterating over hooks in test folder and running them
|
||||||
|
def hooks():
|
||||||
|
print(Fore.LIGHTMAGENTA_EX + "Running hooks" + Style.RESET_ALL)
|
||||||
|
for test_file in sorted(os.listdir(test_path)):
|
||||||
|
try:
|
||||||
|
if test_file.endswith(".py"):
|
||||||
|
sys.stdout.flush()
|
||||||
|
print(subprocess.check_output("python3 " + test_path + test_file, shell=True).decode())
|
||||||
|
elif test_file.endswith(".sh"):
|
||||||
|
sys.stdout.flush()
|
||||||
|
print(subprocess.check_output("./" + test_path + test_file, shell=True).decode())
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
sys.stderr.write("[ERROR]: output = %s, error code = %s\n" % (e.output.decode(), e.returncode))
|
||||||
|
stop(1)
|
||||||
|
|
||||||
|
# Start up containers
|
||||||
|
sys.stdout.flush()
|
||||||
|
print(subprocess.check_output("docker-compose -f " + compose_file + " up -d", shell=True).decode())
|
||||||
|
print()
|
||||||
|
sleep()
|
||||||
|
print()
|
||||||
|
sys.stdout.flush()
|
||||||
|
print(subprocess.check_output("docker ps -a", shell=True).decode())
|
||||||
|
print()
|
||||||
|
health_checks()
|
||||||
|
print()
|
||||||
|
hooks()
|
||||||
|
print()
|
||||||
|
stop(0)
|
@ -0,0 +1,86 @@
|
|||||||
|
# This file is auto-generated by the Mailu configuration wizard.
|
||||||
|
# Please read the documentation before attempting any change.
|
||||||
|
# Generated for compose flavor
|
||||||
|
|
||||||
|
version: '3.6'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
# External dependencies
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- "/mailu/redis:/data"
|
||||||
|
|
||||||
|
# Core services
|
||||||
|
front:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
|
- "127.0.0.1:443:443"
|
||||||
|
- "127.0.0.1:25:25"
|
||||||
|
- "127.0.0.1:465:465"
|
||||||
|
- "127.0.0.1:587:587"
|
||||||
|
- "127.0.0.1:110:110"
|
||||||
|
- "127.0.0.1:995:995"
|
||||||
|
- "127.0.0.1:143:143"
|
||||||
|
- "127.0.0.1:993:993"
|
||||||
|
volumes:
|
||||||
|
- "/mailu/certs:/certs"
|
||||||
|
|
||||||
|
admin:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/data:/data"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
|
||||||
|
imap:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/mail:/mail"
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
smtp:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/overrides:/overrides"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
antispam:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/filter:/var/lib/rspamd"
|
||||||
|
- "/mailu/dkim:/dkim"
|
||||||
|
- "/mailu/overrides/rspamd:/etc/rspamd/override.d"
|
||||||
|
depends_on:
|
||||||
|
- front
|
||||||
|
|
||||||
|
# Optional services
|
||||||
|
|
||||||
|
webdav:
|
||||||
|
image: ${DOCKER_ORG:-mailu}/radicale:${MAILU_VERSION:-master}
|
||||||
|
restart: always
|
||||||
|
env_file: mailu.env
|
||||||
|
volumes:
|
||||||
|
- "/mailu/dav:/data"
|
||||||
|
|
||||||
|
|
||||||
|
# Webmail
|
@ -0,0 +1,139 @@
|
|||||||
|
# Mailu main configuration file
|
||||||
|
#
|
||||||
|
# Generated for compose flavor
|
||||||
|
#
|
||||||
|
# This file is autogenerated by the configuration management wizard.
|
||||||
|
# For a detailed list of configuration variables, see the documentation at
|
||||||
|
# https://mailu.io
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Common configuration variables
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Set this to the path where Mailu data and configuration is stored
|
||||||
|
# This variable is now set directly in `docker-compose.yml by the setup utility
|
||||||
|
# ROOT=/mailu
|
||||||
|
|
||||||
|
# Mailu version to run (1.0, 1.1, etc. or master)
|
||||||
|
#VERSION=master
|
||||||
|
|
||||||
|
# Set to a randomly generated 16 bytes string
|
||||||
|
SECRET_KEY=XVDDSWOAGVF5J9QJ
|
||||||
|
|
||||||
|
# Address where listening ports should bind
|
||||||
|
# This variables are now set directly in `docker-compose.yml by the setup utility
|
||||||
|
# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
|
||||||
|
# PUBLIC_IPV6= (default: ::1)
|
||||||
|
|
||||||
|
# Main mail domain
|
||||||
|
DOMAIN=mailu.io
|
||||||
|
|
||||||
|
# Hostnames for this server, separated with comas
|
||||||
|
HOSTNAMES=localhost
|
||||||
|
|
||||||
|
# Postmaster local part (will append the main mail domain)
|
||||||
|
POSTMASTER=admin
|
||||||
|
|
||||||
|
# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
|
||||||
|
TLS_FLAVOR=cert
|
||||||
|
|
||||||
|
# Authentication rate limit (per source IP address)
|
||||||
|
AUTH_RATELIMIT=10/minute;1000/hour
|
||||||
|
|
||||||
|
# Opt-out of statistics, replace with "True" to opt out
|
||||||
|
DISABLE_STATISTICS=False
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Optional features
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Expose the admin interface (value: true, false)
|
||||||
|
ADMIN=true
|
||||||
|
|
||||||
|
# Choose which webmail to run if any (values: roundcube, rainloop, none)
|
||||||
|
WEBMAIL=none
|
||||||
|
|
||||||
|
# Dav server implementation (value: radicale, none)
|
||||||
|
WEBDAV=radicale
|
||||||
|
|
||||||
|
# Antivirus solution (value: clamav, none)
|
||||||
|
#ANTIVIRUS=none
|
||||||
|
|
||||||
|
#Antispam solution
|
||||||
|
ANTISPAM=none
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Mail settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Message size limit in bytes
|
||||||
|
# Default: accept messages up to 50MB
|
||||||
|
MESSAGE_SIZE_LIMIT=50000000
|
||||||
|
|
||||||
|
# Networks granted relay permissions, make sure that you include your Docker
|
||||||
|
# internal network (default to 172.17.0.0/16)
|
||||||
|
RELAYNETS=172.17.0.0/16
|
||||||
|
|
||||||
|
# Will relay all outgoing mails if configured
|
||||||
|
RELAYHOST=
|
||||||
|
|
||||||
|
# Fetchmail delay
|
||||||
|
FETCHMAIL_DELAY=600
|
||||||
|
|
||||||
|
# Recipient delimiter, character used to delimiter localpart from custom address part
|
||||||
|
RECIPIENT_DELIMITER=+
|
||||||
|
|
||||||
|
# DMARC rua and ruf email
|
||||||
|
DMARC_RUA=admin
|
||||||
|
DMARC_RUF=admin
|
||||||
|
|
||||||
|
|
||||||
|
# Maildir Compression
|
||||||
|
# choose compression-method, default: none (value: bz2, gz)
|
||||||
|
COMPRESSION=
|
||||||
|
# change compression-level, default: 6 (value: 1-9)
|
||||||
|
COMPRESSION_LEVEL=
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Web settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Path to the admin interface if enabled
|
||||||
|
WEB_ADMIN=/admin
|
||||||
|
|
||||||
|
# Path to the webmail if enabled
|
||||||
|
WEB_WEBMAIL=/webmail
|
||||||
|
|
||||||
|
# Website name
|
||||||
|
SITENAME=Mailu
|
||||||
|
|
||||||
|
# Linked Website URL
|
||||||
|
WEBSITE=https://mailu.io
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Advanced settings
|
||||||
|
###################################
|
||||||
|
|
||||||
|
# Log driver for front service. Possible values:
|
||||||
|
# json-file (default)
|
||||||
|
# journald (On systemd platforms, useful for Fail2Ban integration)
|
||||||
|
# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
|
||||||
|
# LOG_DRIVER=json-file
|
||||||
|
|
||||||
|
# Docker-compose project name, this will prepended to containers names.
|
||||||
|
COMPOSE_PROJECT_NAME=mailu
|
||||||
|
|
||||||
|
# Default password scheme used for newly created accounts and changed passwords
|
||||||
|
# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
|
||||||
|
PASSWORD_SCHEME=BLF-CRYPT
|
||||||
|
|
||||||
|
# Header to take the real ip from
|
||||||
|
REAL_IP_HEADER=
|
||||||
|
|
||||||
|
# IPs for nginx set_real_ip_from (CIDR list separated by commas)
|
||||||
|
REAL_IP_FROM=
|
||||||
|
|
||||||
|
# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
|
||||||
|
REJECT_UNLISTED_RECIPIENT=
|
@ -0,0 +1,59 @@
|
|||||||
|
import smtplib
|
||||||
|
import imaplib
|
||||||
|
import time
|
||||||
|
import sys
|
||||||
|
from email.mime.multipart import MIMEMultipart
|
||||||
|
from email.mime.text import MIMEText
|
||||||
|
import ntpath
|
||||||
|
from email.mime.base import MIMEBase
|
||||||
|
from email import encoders
|
||||||
|
|
||||||
|
msg = MIMEMultipart()
|
||||||
|
msg['From'] = "admin@mailu.io"
|
||||||
|
msg['To'] = "user@mailu.io"
|
||||||
|
msg['Subject'] = "File Test"
|
||||||
|
msg.attach(MIMEText(sys.argv[1], 'plain'))
|
||||||
|
|
||||||
|
if len(sys.argv) == 3:
|
||||||
|
part = MIMEBase('application', 'octet-stream')
|
||||||
|
part.set_payload((open(sys.argv[2], "rb")).read())
|
||||||
|
encoders.encode_base64(part)
|
||||||
|
part.add_header('Content-Disposition', "attachment; filename=%s" % ntpath.basename(sys.argv[2]))
|
||||||
|
msg.attach(part)
|
||||||
|
|
||||||
|
try:
|
||||||
|
smtp_server = smtplib.SMTP('localhost')
|
||||||
|
smtp_server.set_debuglevel(1)
|
||||||
|
smtp_server.connect('localhost', 587)
|
||||||
|
smtp_server.ehlo()
|
||||||
|
smtp_server.starttls()
|
||||||
|
smtp_server.ehlo()
|
||||||
|
smtp_server.login("admin@mailu.io", "password")
|
||||||
|
|
||||||
|
smtp_server.sendmail("admin@mailu.io", "user@mailu.io", msg.as_string())
|
||||||
|
smtp_server.quit()
|
||||||
|
except:
|
||||||
|
sys.exit(25)
|
||||||
|
|
||||||
|
time.sleep(30)
|
||||||
|
|
||||||
|
try:
|
||||||
|
imap_server = imaplib.IMAP4_SSL('localhost')
|
||||||
|
imap_server.login('user@mailu.io', 'password')
|
||||||
|
except:
|
||||||
|
sys.exit(110)
|
||||||
|
|
||||||
|
stat, count = imap_server.select('inbox')
|
||||||
|
try:
|
||||||
|
stat, data = imap_server.fetch(count[0], '(UID BODY[TEXT])')
|
||||||
|
except :
|
||||||
|
sys.exit(99)
|
||||||
|
|
||||||
|
if sys.argv[1] in str(data[0][1]):
|
||||||
|
print("Success sending and receiving email!")
|
||||||
|
else:
|
||||||
|
print("Failed receiving email with message %s" % sys.argv[1])
|
||||||
|
sys.exit(99)
|
||||||
|
|
||||||
|
imap_server.close()
|
||||||
|
imap_server.logout()
|
@ -0,0 +1,2 @@
|
|||||||
|
docker
|
||||||
|
colorama
|
Loading…
Reference in New Issue