Configure the invitation mailbox in the UI, not the environment
Putting IMAP settings in environment variables was my call to make and it was the wrong one: it meant editing a file on the server and restarting to change a folder name, and it was never offered as a choice. The mailbox is now a row in mailbox_accounts, edited under Settings → Admin: host, user, password, port, folder, interval, on/off. Administrators only — it is a shared forwarding target, not a per-user account. The password is never returned by any endpoint, the same as the CalDAV account routes, and leaving the field empty on edit keeps the stored one so changing a port does not mean retyping it. The panel shows when the mailbox was last read and what went wrong if it did, because a mailbox that quietly stopped working looks exactly like one that has no mail. Worth stating plainly: the password now lives in the database, in clear text, like the CalDAV, Google and Home Assistant credentials beside it. Unlike those three, an IMAP password opens an entire mailbox. The scheduler job is registered unconditionally now — whether a mailbox exists can change without a restart, and fetch_invites returns immediately when none does. test_scheduler knows about it. Also adds the requests list to the sidebar with accept and decline, 26 translation keys across all ten languages, and tests covering that the password is never returned, that an edit without one keeps it, and that a disabled mailbox counts as unconfigured. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
9bf7d3797d
commit
a67602dbc2
@@ -145,12 +145,11 @@ def install_default_jobs() -> None:
|
||||
ical_minutes = float(os.environ.get("ICAL_REFRESH_MINUTES", "15"))
|
||||
register("attachments.sweep", sweep_hours * 3600, sweep_attachments)
|
||||
register("ical.refresh", ical_minutes * 60, refresh_ical_subscriptions)
|
||||
# Only when a mailbox is configured: an unconditional job would log every
|
||||
# few minutes that it has nothing to do, and test_scheduler asserts the
|
||||
# exact job set.
|
||||
if os.environ.get("IMAP_HOST"):
|
||||
poll_minutes = float(os.environ.get("MAIL_POLL_MINUTES", "5"))
|
||||
register("mail.invites", poll_minutes * 60, fetch_mail_invites)
|
||||
# Always registered: the mailbox is configured in the UI, so whether there
|
||||
# is one to read can change without a restart. fetch_invites returns at once
|
||||
# when none is set up.
|
||||
mail_minutes = float(os.environ.get("MAIL_POLL_MINUTES", "5"))
|
||||
register("mail.invites", mail_minutes * 60, fetch_mail_invites)
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
|
||||
Reference in New Issue
Block a user