Compare commits

..
Author SHA1 Message Date
Liosha84 152e93d997 Пароли новых ящиков — ещё и в лог: видно в Jambotron без консоли
После передеплоя (новая база) владелец видит пароли admin@ и trap@ в
проект → Сервисы → mail → Логи; файл /app/data/initial-passwords.txt остаётся.

α
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:34:48 +01:00
Liosha84 eaffffd4cc Merge pull request '75.2 IMAP: новый сервер на Reactor Netty (STARTTLS, 993, IDLE, UIDPLUS, MOVE)' (#10) from feat/75-2-imap into master
Reviewed-on: #10
2026-11-05 20:59:35 +01:00
3 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ cd frontend && npm install && npx ng serve # http://loca
В мастере деплоя выбрать `docker-compose.jambotron.yml`, домен дать сервису `mail`, порт `8080`. В мастере деплоя выбрать `docker-compose.jambotron.yml`, домен дать сервису `mail`, порт `8080`.
- Пароль базы и ключ токенов создаёт контейнер `secrets-init` при первом запуске (том `secrets`) — вводить ничего не нужно, в git ничего нет. - Пароль базы и ключ токенов создаёт контейнер `secrets-init` при первом запуске (том `secrets`) — вводить ничего не нужно, в git ничего нет.
- Ящики `admin@mail.test` (первый) и `trap@mail.test` (ловушка) создаются при старте, их пароли — в файле `/app/data/initial-passwords.txt` контейнера `mail` (том `data`, права 600): `docker exec <контейнер mail> cat /app/data/initial-passwords.txt`. Прочитать и сменить пароль в настройках. - Ящики `admin@mail.test` (первый) и `trap@mail.test` (ловушка) создаются при старте, их пароли печатаются в лог сервиса `mail` при первом запуске (в Jambotron: проект → Сервисы → `mail` → Логи) и лежат в файле `/app/data/initial-passwords.txt` контейнера `mail` (том `data`, права 600): `docker exec <контейнер mail> cat /app/data/initial-passwords.txt`. Прочитать и сменить пароль в настройках.
- Регистрация открыта (`MAIL_REGISTRATION=true`): любой может завести ящик в `MAIL_DOMAINS`. Наружу письма не уходят, поэтому для тестового стенда это безопасно; закрыть — `MAIL_REGISTRATION=false`. - Регистрация открыта (`MAIL_REGISTRATION=true`): любой может завести ящик в `MAIL_DOMAINS`. Наружу письма не уходят, поэтому для тестового стенда это безопасно; закрыть — `MAIL_REGISTRATION=false`.
- Наружу открыты только веб-почта и API. SMTP (3025) — внутри сети ВМ, наружу ничего не отправляется (`OUTBOUND_MODE=off`). - Наружу открыты только веб-почта и API. SMTP (3025) — внутри сети ВМ, наружу ничего не отправляется (`OUTBOUND_MODE=off`).
- Домен ящиков — `MAIL_DOMAINS` (по умолчанию `mail.test`). - Домен ящиков — `MAIL_DOMAINS` (по умолчанию `mail.test`).
@@ -28,8 +28,8 @@ import java.util.Locale;
* <li>the catch-all mailbox ({@code mailserver.catch-all}) if it does not exist yet — mail to unknown addresses is * <li>the catch-all mailbox ({@code mailserver.catch-all}) if it does not exist yet — mail to unknown addresses is
* stored there, so it must exist.</li> * stored there, so it must exist.</li>
* </ul> * </ul>
* A generated password is appended to {@code mailserver.passwords-file} (mode 600, in the data volume) — read it once * A generated password is printed to the log once (visible in Jambotron: project → Services → mail → Logs) and appended
* and change the password. Without the file setting it is printed to the log once. * to {@code mailserver.passwords-file} (mode 600, in the data volume) — change it after the first login.
*/ */
@Configuration @Configuration
public class DataInitializer { public class DataInitializer {
@@ -63,7 +63,8 @@ public class DataInitializer {
log.info("Mailbox created: {}", address); log.info("Mailbox created: {}", address);
} else if (file != null) { } else if (file != null) {
appendPassword(file, address, secret); appendPassword(file, address, secret);
log.warn("Mailbox created: {} — password in {} (change it)", address, file); // also in the log: the owner sees it in Jambotron (project → Services → mail → Logs) without a shell
log.warn("Mailbox created: {} — password: {} (also in {}; change it)", address, secret, file);
} else { } else {
log.warn("Mailbox created: {} — password: {} (shown once, change it)", address, secret); log.warn("Mailbox created: {} — password: {} (shown once, change it)", address, secret);
} }
+2 -1
View File
@@ -2,7 +2,8 @@
# Outside, only the web client + API (service "mail", port 8080) through Jambotron's Caddy — give it a domain. # Outside, only the web client + API (service "mail", port 8080) through Jambotron's Caddy — give it a domain.
# SMTP (3025) stays inside the VM's docker network; nothing is sent outside (OUTBOUND_MODE=off). # SMTP (3025) stays inside the VM's docker network; nothing is sent outside (OUTBOUND_MODE=off).
# Secrets are generated on the first start into the "secrets" volume — nothing to type in, nothing in git. # Secrets are generated on the first start into the "secrets" volume — nothing to type in, nothing in git.
# Mailboxes admin@<MAIL_DOMAINS> and trap@mail.test (catch-all): passwords in /app/data/initial-passwords.txt # Mailboxes admin@<MAIL_DOMAINS> and trap@mail.test (catch-all): passwords in the "mail" log on the first start
# (Jambotron: project → Services → mail → Logs) and in /app/data/initial-passwords.txt
# of the "mail" container (docker exec <mail container> cat /app/data/initial-passwords.txt). # of the "mail" container (docker exec <mail container> cat /app/data/initial-passwords.txt).
name: reactive-mail name: reactive-mail