This commit is contained in:
Bozhidar 2024-09-25 15:18:20 +03:00
parent 9718506b3b
commit d8778b30cc
6 changed files with 10 additions and 48 deletions

View file

@ -81,6 +81,7 @@ class SetupEmailServer extends Command
shell_exec('systemctl restart dovecot');
shell_exec('systemctl restart postfix');
shell_exec('systemctl restart opendkim');
}

View file

@ -44,7 +44,7 @@ smtp_sasl_local_domain = $myhostname
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_sender_restrictions = permit_sasl_authenticated
smtp_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
smtp_milters = inet:127.0.0.1:8891
# smtp_milters = inet:127.0.0.1:8891
# SMTPD
@if(!empty($sslPaths))
@ -64,13 +64,13 @@ smtpd_sasl_local_domain = $myhostname
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_sender_restrictions = permit_sasl_authenticated
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
smtpd_milters = inet:127.0.0.1:8891
# smtpd_milters = inet:127.0.0.1:8891
# DKIM
milter_default_action = accept
milter_protocol = 2
non_smtpd_milters = inet:127.0.0.1:8891
non_smtp_milters = inet:127.0.0.1:8891
# milter_default_action = accept
# milter_protocol = 2
# non_smtpd_milters = inet:127.0.0.1:8891
# non_smtp_milters = inet:127.0.0.1:8891
# Virtual Domains
virtual_mailbox_base = 0

View file

@ -3,4 +3,4 @@ password = {{$password}}
hosts = {{$host}}
dbname = {{$database}}
port = {{$port}}
query = SELECT goto FROM alias WHERE address='%s' AND active = '1'
query = SELECT goto FROM email_aliases WHERE address='%s'

View file

@ -3,4 +3,4 @@ password = {{$password}}
hosts = {{$host}}
dbname = {{$database}}
port = {{$port}}
query = SELECT domain FROM domain WHERE domain='%s' AND active = '1'
query = SELECT domain FROM domains WHERE domain='%s'

View file

@ -3,4 +3,4 @@ password = {{$password}}
hosts = {{$host}}
dbname = {{$database}}
port = {{$port}}
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'
query = SELECT maildir FROM email_boxes WHERE username='%s'

View file

@ -1,39 +0,0 @@
services:
mailserver:
image: ghcr.io/docker-mailserver/docker-mailserver:latest
container_name: {{$containerName}}
# Provide the FQDN of your mail server here (Your DNS MX record should point to this value)
hostname: {{$hostName}}
ports:
- "25:25" # SMTP (explicit TLS => STARTTLS)
- "465:465" # ESMTP (implicit TLS)
- "587:587" # ESMTP (explicit TLS => STARTTLS)
- "993:993" # IMAP4 (implicit TLS)
- "143:143" # IMAP4 (explicit TLS => STARTTLS)
- "110:110" # POP3
- "995:995" # POP3 (with TLS)
volumes:
- {{$workPath}}/docker-data/dms/mail-data/:/var/mail/
- {{$workPath}}/docker-data/dms/mail-state/:/var/mail-state/
- {{$workPath}}/docker-data/dms/mail-logs/:/var/log/mail/
- {{$workPath}}/docker-data/dms/config/:/tmp/docker-mailserver/
- /etc/localtime:/etc/localtime:ro
- {{$workPath}}/docker-data/acme-companion/certs/:/etc/letsencrypt/live/:ro
environment:
- SSL_TYPE=letsencrypt
- VIRTUAL_HOST={{$hostName}}
- LETSENCRYPT_HOST={{$hostName}}
- ENABLE_FAIL2BAN=0
- PERMIT_DOCKER=network
- ONE_DIR=1
- ENABLE_POSTGREY=0
- ENABLE_CLAMAV=0
- ENABLE_SPAMASSASSIN=0
- SPOOF_PROTECTION=0
- ENABLE_POP3=1
- POSTMASTER_ADDRESS=postmaster@localhost.localdomain
cap_add:
- NET_ADMIN
- SYS_PTRACE
restart: always