Коллеги, приветствую!
"Юзаю" docker-mailserver
Не получается отправить почту.
Что я сделал для достижения цели:
- Сконфигурировал docker-compose.yml
- Поднял контейнеры
- Выполнил все рекомендации (надеюсь)
- Установил необходимые компоненты в Symfony ("symfony/swiftmailer-bundle": "^3.4")
- Настроил MAILER_URL
Выполняю отправку командой
docker exec -it mail.app bin/console swiftmailer:email:send
[OK] 1 emails were successfully sent.
Письма как не было так и нет.
Как убедиться, что
docker-mailserver правильно сконфигурирован?
docker-mailserver постоянно что-то пишет в логи например
2020-02-21 18:25:11,164 INFO exited: postfix (exit status 0; expected)
2020-02-21 18:25:11,180 INFO spawned: 'postfix' with pid 16771
2020-02-21 18:25:11,181 INFO success: amavis entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Feb 21 18:25:10 mail amavis[16758]: starting. /usr/sbin/amavisd-new at mail.dev.com amavisd-new-2.10.1 (20141025), Unicode aware
Feb 21 18:25:11 mail amavis[16758]: (!)Net::Server: 2020/02/21-18:25:11 Can't connect to UNIX socket at file /var/lib/amavis/amavisd.sock [Input/output error]\n at line 70 in file /usr/share/perl5/Net/Server/Proto/UNIX.pm
2020-02-21 18:25:11,215 INFO success: postfix entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-02-21 18:25:13,189 INFO exited: amavis (exit status 1; not expected)
Feb 21 18:25:12 mail amavis[16770]: starting. /usr/sbin/amavisd-new at mail.dev.com amavisd-new-2.10.1 (20141025), Unicode aware
Feb 21 18:25:13 mail amavis[16770]: (!)Net::Server: 2020/02/21-18:25:13 Can't connect to UNIX socket at file /var/lib/amavis/amavisd.sock [Input/output error]\n at line 70 in file /usr/share/perl5/Net/Server/Proto/UNIX.pm
2020-02-21 18:25:13,221 INFO spawned: 'amavis' with pid 16815
docker-compose
# Development configuration
version: "3.7"
services:
# Php application
app:
container_name: mail.app
restart: on-failure
build:
context: .
dockerfile: ./docker/php/Dockerfile-dev.docker
volumes:
- ./docker/timezone:/etc/timezone
- .:/www
- ./docker/php/log:/var/log
- ./docker/php/usr/local/etc/php/conf.d:/usr/local/etc/php/conf.d
depends_on:
- db
links:
- db
expose:
- "9000"
environment:
PHP_INI_SCAN_DIR: ":/usr/local/etc/php/conf.d"
TZ: "Europe/Moscow"
# Database
db:
image: percona:latest
container_name: mail.db
restart: on-failure
ports:
- "127.0.0.110:3306:3306"
expose:
- "3306"
volumes:
- ./docker/timezone:/etc/timezone:ro
- ./docker/mysql/dumps:/var/mysql/dumps
- ./docker/mysql/test-data:/var/mysql/test-data
environment:
- MYSQL_USER=root
- MYSQL_ROOT_PASSWORD=ra3kw1UD20Sa6G1dqOEF4L1pmNkcyQ2oL
- MYSQL_DATABASE=mail
- MYSQL_ROOT_HOST=%
# Mail
mail:
image: tvial/docker-mailserver:latest
hostname: mail
domainname: dev.com
container_name: mail
depends_on:
- app
ports:
- "127.0.0.110:25:25"
- "127.0.0.110:143:143"
- "127.0.0.110:587:587"
- "127.0.0.110:993:993"
volumes:
- ./docker/mail/dev/maildata:/var/mail
- ./docker/mail/dev/mailstate:/var/mail-state
- ./docker/mail/dev/maillogs:/var/log/mail
- ./docker/mail/dev/config/:/tmp/docker-mailserver/
- ./docker/mail/utils:/var/mail/utils
environment:
- ENABLE_SPAMASSASSIN=1
- ENABLE_CLAMAV=1
- ENABLE_FAIL2BAN=1
- ENABLE_POSTGREY=1
- ONE_DIR=1
- DMS_DEBUG=0
- SMTP_ONLY=1
cap_add:
- NET_ADMIN
- SYS_PTRACE