Добавлена конфигурация для почты

This commit is contained in:
2025-07-15 16:09:36 +02:00
parent 18d2237b34
commit 643c772de7
8 changed files with 83 additions and 0 deletions

40
docker-compose.yml Normal file
View File

@@ -0,0 +1,40 @@
version: '3.3'
services:
postfix:
image: docker.dended.ru/postfix:latest
container_name: postfix
restart: always
volumes:
- ./postfix/main.cf:/etc/postfix/main.cf
- ./postfix/master.cf:/etc/postfix/master.cf
- ./postfix/virtual:/etc/postfix/virtual
- /usb1/mail-data:/var/mail
environment:
- POSTFIX_myhostname=mail.dended.ru
ports:
- "25:25"
- "587:587"
networks:
- mail-network
dovecot:
image: docker.dended.ru/dovecot:latest
container_name: dovecot
restart: always
volumes:
- ./dovecot/dovecot.conf:/etc/dovecot/dovecot.conf
- ./dovecot/conf.d/:/etc/dovecot/conf.d/
- ./ssl/:/etc/ssl/dovecot/
- ./mail-data:/var/mail
- ./dovecot/users:/etc/dovecot/users
ports:
- "143:143"
- "993:993"
networks:
- mail-network
networks:
mail-network:
driver: bridge

View File

@@ -0,0 +1,3 @@
disable_plaintext_auth = no
auth_mechanisms = plain login
!include auth-passwdfile.conf.ext

View File

@@ -0,0 +1,9 @@
passdb {
driver = passwd-file
args = scheme=PLAIN username_format=%u /etc/dovecot/users
}
userdb {
driver = passwd-file
args = username_format=%u /etc/dovecot/users
}

1
dovecot/users Normal file
View File

@@ -0,0 +1 @@
user@yourdomain.com:{PLAIN}password

26
postfix/main.cf Normal file
View File

@@ -0,0 +1,26 @@
# Основные настройки
myhostname = mail.dended.ru
mydomain = dended.ru
inet_interfaces = all
# Виртуальные домены и почтовые ящики
virtual_mailbox_domains = /etc/postfix/virtual/domains
virtual_mailbox_maps = hash:/etc/postfix/virtual/email2user
virtual_alias_maps = hash:/etc/postfix/virtual/aliases
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
# Настройки доставки
virtual_mailbox_base = /var/mail
virtual_mailbox_limit = 512000000
virtual_minimum_uid = 1000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
# Безопасность
smtpd_tls_security_level = may
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

2
postfix/virtual/aliases Normal file
View File

@@ -0,0 +1,2 @@
# Перенаправления (опционально)
admin@dended.ru user@dended.ru

1
postfix/virtual/domains Normal file
View File

@@ -0,0 +1 @@
dended.ru OK

View File

@@ -0,0 +1 @@
user@dended.ru user/