Несколько ящиков у одного логина, общие ящики, кто ответил, вход ящик*логин
continuous-integration/drone/pr Build is passing
continuous-integration/drone/pr Build is passing
- V7: users.is_shared, mailbox_access (MEMBER от админа/Jambotron, ATTACHED по паролю ящика), messages.answered_by
- /api/mailboxes: мои ящики с непрочитанными, сессия другого ящика (JWT с claim by), подключить по паролю
(LoginGuard), убрать из меню
- общий ящик: без своего входа (веб/SMTP/IMAP), участники открывают; «прочитано» общее; ответ из веба → answered_by
- SMTP/IMAP: ящик*логин + пароль логина (как master user в Dovecot)
- открытый чужой ящик (общий, подключённый, OPEN админа): профиль и пароль не меняются (403)
- админ: создать shared, участники ящика (PUT /{id}/members); служебное API: PUT /shared/{address};
выключение аккаунта убирает и из общих ящиков
- UI: MAILBOXES в левом меню (переключение, ⊕ подключить, × убрать), shared/участники в настройках,
«Answered by» у письма
- 88 тестов; живой прогон на Postgres 17 (апгрейд V6→V7 на данных), скриншоты UI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import com.mailserver.repository.MessageRepository;
|
||||
import com.mailserver.repository.UserRepository;
|
||||
import com.mailserver.service.LocalDelivery;
|
||||
import com.mailserver.service.MailService;
|
||||
import com.mailserver.service.MailboxAccess;
|
||||
import com.mailserver.service.MessageSources;
|
||||
import com.mailserver.service.UserService;
|
||||
import jakarta.mail.Session;
|
||||
@@ -45,10 +46,12 @@ public class DbImapStore implements ImapStore {
|
||||
private final AttachmentRepository attachments;
|
||||
private final MessageSources sources;
|
||||
private final String hostname;
|
||||
private final MailboxAccess access;
|
||||
|
||||
public DbImapStore(DatabaseClient db, UserRepository users, UserService userService, MailService mailService,
|
||||
MessageRepository messages, AttachmentRepository attachments, MessageSources sources,
|
||||
String hostname) {
|
||||
String hostname, MailboxAccess access) {
|
||||
this.access = access;
|
||||
this.db = db;
|
||||
this.users = users;
|
||||
this.userService = userService;
|
||||
@@ -61,11 +64,9 @@ public class DbImapStore implements ImapStore {
|
||||
|
||||
@Override
|
||||
public Account authenticate(String username, String password) {
|
||||
User user = users.findByEmail(username.trim().toLowerCase(Locale.ROOT)).block();
|
||||
if (user == null || !user.isActive() || !userService.checkPassword(user, password)) {
|
||||
return null;
|
||||
}
|
||||
return new Account(user.getId(), user.getEmail());
|
||||
// login or mailbox*login (shared / attached mailbox in a mail program)
|
||||
User user = access.login(username, password);
|
||||
return user == null ? null : new Account(user.getId(), user.getEmail());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user