Server settings → Plugins: the own-mail outbox cannot be switched off, though its code and the refusal say it can #608

Closed
opened 2026-10-01 10:48:21 +00:00 by tiagoagueda · 0 comments
Owner

Found on 2026-09-29 in a read-only review of postulo at 95348908d, listing what Server settings → Plugins draws and asking the policy about own-mail.

Checked again on 2026-10-01 against main at 0a5cad587: still present. The code is now at plugins/policy.py:51 (GOVERNED_KINDS), :61 (UNGOVERNED_KINDS) and :309-320 (plugins_for), core/server_views.py:1021-1042 and plugins/installing.py:932-948 (set_disabled); connected_plugins moved from the registry to plugins/policy.py:323 (#248). The other files have not moved.

The connected kind outbox is in neither GOVERNED_KINDS nor UNGOVERNED_KINDS. Server settings → Plugins therefore never shows or saves a policy for own-mail, the person's own Plugins page leaves it out, and plugins_for(person, "outbox") returns it unfiltered even if a policy row exists. Being a built-in, it cannot be switched off for the instance either: set_disabled refuses and sends the administrator to a page that does not list it. #149 asked that an administrator be able to switch the person's half of mail off, and the code says so in three places.

  • Where: plugins/policy.py:46 (GOVERNED_KINDS = ("source", "notifier", "store", "sync", "importer", "feature")) and :56 (UNGOVERNED_KINDS); plugins/policy.py:318-329 (plugins_for, which returns plugins(kind) for any kind outside GOVERNED_KINDS); core/server_views.py:1020-1041 (_governed_plugins, _ungoverned_plugins); plugins/installing.py:1106-1116 (set_disabled); plugins/kinds.py:25-34 (no outbox label or tone). The promises: plugins/own_mail/__init__.py:6-14 ("Switched off: by the person, or by an administrator") and core/correspondence.py:52-58 (outbox_for: "Governed like every other connected plugin: an administrator may switch it off, and then this returns nothing").
  • What happens: the page's governed list holds sixteen plugins and the ungoverned list identifiers and smtp; own-mail is in neither. installing.set_disabled("own-mail", True) raises "own-mail ships inside Postulo. Switch it off under Server settings → Plugins instead." With a hand-made PluginPolicy(plugin="own-mail", person=None, state=UNAVAILABLE), decide answers on=False, yet plugins_for(user, "outbox") still returns own-mail, so outbox_for keeps offering it.
  • Why it matters: an administrator who does not want accounts sending mail through servers they type has no control, and the refusal message points at a page that cannot do it.
  • Fix: add "outbox" to GOVERNED_KINDS, so its policy rows are drawn, saved and applied by plugins_for; add an outbox label and tone to plugins/kinds.py.

Done when

  • tests/test_plugin_policy.py has a test that own-mail appears among the rows of Server settings → Plugins, and that forcing it off removes it from connected_plugins(person) and makes correspondence.outbox_for(person) return None.

Related to #149 (closed), which asked for the administrator's switch.

Found on 2026-09-29 in a read-only review of postulo at 95348908d, listing what Server settings → Plugins draws and asking the policy about `own-mail`. Checked again on 2026-10-01 against `main` at `0a5cad587`: still present. The code is now at `plugins/policy.py:51` (`GOVERNED_KINDS`), `:61` (`UNGOVERNED_KINDS`) and `:309-320` (`plugins_for`), `core/server_views.py:1021-1042` and `plugins/installing.py:932-948` (`set_disabled`); `connected_plugins` moved from the registry to `plugins/policy.py:323` (#248). The other files have not moved. The connected kind `outbox` is in neither `GOVERNED_KINDS` nor `UNGOVERNED_KINDS`. Server settings → Plugins therefore never shows or saves a policy for `own-mail`, the person's own Plugins page leaves it out, and `plugins_for(person, "outbox")` returns it unfiltered even if a policy row exists. Being a built-in, it cannot be switched off for the instance either: `set_disabled` refuses and sends the administrator to a page that does not list it. #149 asked that an administrator be able to switch the person's half of mail off, and the code says so in three places. - **Where:** `plugins/policy.py:46` (`GOVERNED_KINDS = ("source", "notifier", "store", "sync", "importer", "feature")`) and `:56` (`UNGOVERNED_KINDS`); `plugins/policy.py:318-329` (`plugins_for`, which returns `plugins(kind)` for any kind outside `GOVERNED_KINDS`); `core/server_views.py:1020-1041` (`_governed_plugins`, `_ungoverned_plugins`); `plugins/installing.py:1106-1116` (`set_disabled`); `plugins/kinds.py:25-34` (no `outbox` label or tone). The promises: `plugins/own_mail/__init__.py:6-14` ("Switched off: by the person, or by an administrator") and `core/correspondence.py:52-58` (`outbox_for`: "Governed like every other connected plugin: an administrator may switch it off, and then this returns nothing"). - **What happens:** the page's governed list holds sixteen plugins and the ungoverned list `identifiers` and `smtp`; `own-mail` is in neither. `installing.set_disabled("own-mail", True)` raises "own-mail ships inside Postulo. Switch it off under Server settings → Plugins instead." With a hand-made `PluginPolicy(plugin="own-mail", person=None, state=UNAVAILABLE)`, `decide` answers `on=False`, yet `plugins_for(user, "outbox")` still returns `own-mail`, so `outbox_for` keeps offering it. - **Why it matters:** an administrator who does not want accounts sending mail through servers they type has no control, and the refusal message points at a page that cannot do it. - **Fix:** add `"outbox"` to `GOVERNED_KINDS`, so its policy rows are drawn, saved and applied by `plugins_for`; add an `outbox` label and tone to `plugins/kinds.py`. ## Done when - `tests/test_plugin_policy.py` has a test that `own-mail` appears among the rows of Server settings → Plugins, and that forcing it off removes it from `connected_plugins(person)` and makes `correspondence.outbox_for(person)` return `None`. Related to #149 (closed), which asked for the administrator's switch.
tiagoagueda added this to the 0.5.0 milestone 2026-10-01 10:48:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#608
No description provided.