Decouple archive mailboxes from accounts

This commit is contained in:
DonVoo 2026-07-13 02:28:38 +02:00
parent 0bb49019b6
commit 8d2838aea7
4 changed files with 130 additions and 46 deletions

View file

@ -80,7 +80,11 @@ func migrateAccount(a Account) error {
return fmt.Errorf("open target %s: %w", a.Name, err)
}
defer dst.Close()
mboxDir := filepath.Join(Cfg.MboxRoot, a.MboxDir)
archiveName := accountMboxDir(a)
if archiveName == "" {
return fmt.Errorf("keine Archiv-Mailbox fuer %s ausgewaehlt", a.Name)
}
mboxDir := filepath.Join(Cfg.MboxRoot, archiveName)
mbox, err := NewMboxWriter(mboxDir)
if err != nil {
return err