Добавлена конфигурация для почты
This commit is contained in:
40
docker-compose.yml
Normal file
40
docker-compose.yml
Normal 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
|
||||
|
||||
3
dovecot/conf.d/10-auth.conf
Normal file
3
dovecot/conf.d/10-auth.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
disable_plaintext_auth = no
|
||||
auth_mechanisms = plain login
|
||||
!include auth-passwdfile.conf.ext
|
||||
9
dovecot/conf.d/auth-passwdfile.conf.ext
Normal file
9
dovecot/conf.d/auth-passwdfile.conf.ext
Normal 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
1
dovecot/users
Normal file
@@ -0,0 +1 @@
|
||||
user@yourdomain.com:{PLAIN}password
|
||||
26
postfix/main.cf
Normal file
26
postfix/main.cf
Normal 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
2
postfix/virtual/aliases
Normal file
@@ -0,0 +1,2 @@
|
||||
# Перенаправления (опционально)
|
||||
admin@dended.ru user@dended.ru
|
||||
1
postfix/virtual/domains
Normal file
1
postfix/virtual/domains
Normal file
@@ -0,0 +1 @@
|
||||
dended.ru OK
|
||||
1
postfix/virtual/email2user
Normal file
1
postfix/virtual/email2user
Normal file
@@ -0,0 +1 @@
|
||||
user@dended.ru user/
|
||||
Reference in New Issue
Block a user