docker-mailserver

This commit is contained in:
Andreas Knuth 2025-08-22 17:56:01 -05:00
parent 08501f863a
commit 338c630f57
6 changed files with 128 additions and 0 deletions

0
dms/config/dovecot.cf Normal file
View File

View File

@ -0,0 +1 @@
knuth@andreasknuth.de|hashed_password_here # Generiere Passwort mit: docker run --rm ghcr.io/docker-mailserver/docker-mailserver:latest generate-password

View File

53
dms/docker-compose.yml Normal file
View File

@ -0,0 +1,53 @@
services:
mailserver:
image: ghcr.io/docker-mailserver/docker-mailserver:latest
container_name: dms-mailserver
hostname: mail.andreasknuth.de # Passe an deine Haupt-Domain an
env_file: mailserver.env
ports:
- "2525:25" # SMTP (extern auf 2525, um MailCow nicht zu stören)
- "1443:143" # IMAP (extern auf 1443)
- "465:465" # SMTPS
- "994:993" # IMAPS (extern auf 994, um Konflikte zu vermeiden)
- "2587:587" # Submission (extern auf 2587 für Lambda)
volumes:
- ./data/:/var/mail/
- ./state/:/var/mail-state/
- ./config/:/tmp/docker-mailserver/
environment:
- ENABLE_FAIL2BAN=1
- SSL_TYPE=letsencrypt # Oder self-signed für Test
- PERMIT_DOCKER=host
- ONE_DIR=1
cap_add:
- NET_ADMIN
restart: always
networks:
- dms_network
- mail_network # Verbinde mit deinem bestehenden mail_network für Caddy
roundcube:
image: roundcube/roundcubemail:latest
container_name: dms-roundcube
environment:
- ROUNDCUBEMAIL_DEFAULT_HOST=mail.andreasknuth.de
- ROUNDCUBEMAIL_DEFAULT_PORT=1443 # Dein IMAP-Port
- ROUNDCUBEMAIL_SMTP_SERVER=mail.andreasknuth.de
- ROUNDCUBEMAIL_SMTP_PORT=2587
- ROUNDCUBEMAIL_PLUGINS=archive,zipdownload,managesieve,password # Für Sieve (Auto-Reply/Forward), Password-Change
volumes:
- ./roundcube/:/var/roundcube/config/
ports:
- "9000:80" # Intern auf 80, extern via Caddy
depends_on:
- mailserver
restart: always
networks:
- dms_network
- mail_network
networks:
dms_network:
external: true
mail_network:
external: true

5
dms/mailserver.env Normal file
View File

@ -0,0 +1,5 @@
POSTMASTER_ADDRESS=postmaster@andreasknuth.de
OVERRIDE_HOSTNAME=mail.andreasknuth.de
DMS_DEBUG=1 # Für Logs
ENABLE_RSPAMD=1 # Spam-Filter aktiv (Schritt 4)
ENABLE_CLAMAV=1 # Optional: Virenscanner

View File

@ -0,0 +1,69 @@
<?php
/*
+-----------------------------------------------------------------------+
| Local configuration for the Roundcube Webmail installation. |
| |
| This is a sample configuration file only containing the minimum |
| setup required for a functional installation. Copy more options |
| from defaults.inc.php to this file to override the defaults. |
| |
| This file is part of the Roundcube Webmail client |
| Copyright (C) The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
| See the README file for a full license statement. |
+-----------------------------------------------------------------------+
*/
$config = [];
// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// NOTE: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
// or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
$config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
// IMAP host chosen to perform the log-in.
// See defaults.inc.php for the option description.
$config['imap_host'] = 'localhost:143';
// SMTP server host (for sending mails).
// See defaults.inc.php for the option description.
$config['smtp_host'] = 'localhost:587';
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';
// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';
// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';
// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Roundcube Webmail';
// This key is used to encrypt the users imap password which is stored
// in the session record. For the default cipher method it must be
// exactly 24 characters long.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = 'rcmail-!24ByteDESkey*Str';
// List of active plugins (in plugins/ directory)
$config['plugins'] = [
'archive',
'zipdownload',
];
// skin name: folder from skins/
$config['skin'] = 'elastic';
$config['plugins'] = ['managesieve', 'password'];
$config['managesieve_host'] = 'mail.andreasknuth.de';