ldap-rest 0.17.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/abstract/ldapFlat.js +1 -1
  2. package/dist/abstract/twakePlugin.js +1 -1
  3. package/dist/config/args.js +1 -1
  4. package/dist/config/schema.js +1 -1
  5. package/dist/lib/ldapActions.js +1 -1
  6. package/dist/plugins/ldap/enterpriseRules.js +1 -1
  7. package/dist/plugins/ldap/externalUsersInGroups.js +1 -1
  8. package/dist/plugins/ldap/groups.js +1 -1
  9. package/dist/plugins/ldap/organizations.js +1 -1
  10. package/dist/plugins/twake/james.js +1 -1
  11. package/dist/src/abstract/ldapFlat.d.ts +9 -11
  12. package/dist/src/browser/ldap-group-editor/types.d.ts +2 -1
  13. package/dist/src/browser/ldap-resource-editor/types.d.ts +3 -2
  14. package/dist/src/browser/ldap-unit-editor/types.d.ts +2 -1
  15. package/dist/src/browser/ldap-user-editor/types.d.ts +3 -2
  16. package/dist/src/browser/shared/types/index.d.ts +7 -1
  17. package/dist/src/browser/shared/utils/schema.d.ts +20 -1
  18. package/dist/src/config/args.d.ts +1 -0
  19. package/dist/src/config/schema.d.ts +27 -4
  20. package/dist/src/plugins/ldap/externalUsersInGroups.d.ts +11 -0
  21. package/dist/src/plugins/ldap/organizations.d.ts +0 -8
  22. package/dist/src/plugins/twake/james.d.ts +63 -75
  23. package/docs/client-development/api/reference.md +1 -1
  24. package/docs/client-development/api/rest-api.md +13 -1
  25. package/docs/client-development/schemas/README.md +18 -13
  26. package/docs/plugin-development/dependencies.md +1 -3
  27. package/docs/presentations/en.md +0 -28
  28. package/docs/presentations/fr.md +0 -28
  29. package/docs/usage/configuration.md +13 -12
  30. package/docs/usage/plugins/integrations/james-mail.md +92 -129
  31. package/docs/usage/plugins/integrations/james-mailboxes.md +70 -83
  32. package/docs/usage/plugins/ldap/external-users.md +23 -2
  33. package/docs/usage/plugins/ldap/flat-generic.md +23 -5
  34. package/docs/usage/plugins/utilities/weblogs.md +1 -1
  35. package/docs/usage/upgrading.md +48 -0
  36. package/package.json +1 -1
  37. package/static/browser/ldap-resource-editor/api/ResourceApiClient.js +2 -1
  38. package/static/browser/ldap-resource-editor/api/ResourceApiClient.js.map +1 -1
  39. package/static/browser/ldap-user-editor/api/UserApiClient.js +2 -1
  40. package/static/browser/ldap-user-editor/api/UserApiClient.js.map +1 -1
  41. package/static/browser/ldap-user-editor/components/UserEditor.js +11 -8
  42. package/static/browser/ldap-user-editor/components/UserEditor.js.map +1 -1
  43. package/static/browser/ldap-user-editor/components/UserList.js +3 -1
  44. package/static/browser/ldap-user-editor/components/UserList.js.map +1 -1
  45. package/static/browser/ldap-user-editor.esm.js +52 -10
  46. package/static/browser/ldap-user-editor.esm.js.map +1 -1
  47. package/static/browser/ldap-user-editor.js +52 -10
  48. package/static/browser/ldap-user-editor.js.map +1 -1
  49. package/static/browser/ldap-user-editor.min.js +1 -1
  50. package/static/browser/ldap-user-editor.min.js.map +1 -1
  51. package/static/browser/shared/index.js +1 -1
  52. package/static/browser/shared/types/index.js.map +1 -1
  53. package/static/browser/shared/utils/form.js +2 -1
  54. package/static/browser/shared/utils/form.js.map +1 -1
  55. package/static/browser/shared/utils/schema.js +33 -1
  56. package/static/browser/shared/utils/schema.js.map +1 -1
  57. package/static/browser/shared.esm.js +153 -121
  58. package/static/browser/shared.esm.js.map +1 -1
  59. package/static/browser/shared.js +154 -120
  60. package/static/browser/shared.js.map +1 -1
  61. package/static/browser/shared.min.js +1 -1
  62. package/static/browser/shared.min.js.map +1 -1
  63. package/static/schemas/standard/groups.json +1 -1
  64. package/static/schemas/twake/groups.json +53 -18
  65. package/static/schemas/twake/nomenclature/twakeAccountStatus.json +24 -8
  66. package/static/schemas/twake/nomenclature/twakeDeliveryMode.json +22 -7
  67. package/static/schemas/twake/nomenclature/twakeDomain.json +21 -8
  68. package/static/schemas/twake/nomenclature/twakeListType.json +22 -7
  69. package/static/schemas/twake/nomenclature/twakeMailboxType.json +22 -7
  70. package/static/schemas/twake/nomenclature/twakeTitle.json +32 -12
  71. package/static/schemas/twake/organizations.json +29 -13
  72. package/static/schemas/twake/positions.json +13 -5
  73. package/static/schemas/twake/users.json +103 -38
@@ -335,18 +335,23 @@ Complete reference for all attribute properties.
335
335
 
336
336
  ### Attribute Properties Table
337
337
 
338
- | Property | Type | Applies To | Description | Example |
339
- | ---------- | ------------ | ------------------- | -------------------------------------------------------------------------------- | ----------------------------------- |
340
- | `type` | string | All | Attribute data type: `"string"`, `"array"`, `"pointer"`, `"number"`, `"integer"` | `"string"` |
341
- | `required` | boolean | All | Whether the attribute must be present | `true` |
342
- | `fixed` | boolean | All | Whether the attribute value cannot be changed after creation | `true` |
343
- | `role` | string | String | Semantic role for special handling (see [Semantic Roles](#semantic-roles)) | `"identifier"` |
344
- | `test` | string/regex | String, Array items | Regular expression for validation | `"^[a-zA-Z0-9._-]{1,255}$"` |
345
- | `branch` | string[] | Pointer | LDAP branches where referenced entries exist | `["ou=users,dc=example,dc=com"]` |
346
- | `ui` | object | Pointer | UI configuration for pointer selection (future feature) | `{}` |
347
- | `group` | string | All | UI grouping for form organization (future feature) | `"contact"` |
348
- | `default` | any | All | Default value for new entries | `["top", "person"]` |
349
- | `items` | object | Array | Schema for array element validation | `{"type": "string", "test": "..."}` |
338
+ | Property | Type | Applies To | Description | Example |
339
+ | ---------- | --------------- | ------------------- | ------------------------------------------------------------------------------------- | ----------------------------------- |
340
+ | `type` | string | All | Attribute data type: `"string"`, `"array"`, `"pointer"`, `"number"`, `"integer"` | `"string"` |
341
+ | `required` | boolean | All | Whether the attribute must be present | `true` |
342
+ | `fixed` | boolean | All | Whether the attribute value cannot be changed after creation | `true` |
343
+ | `role` | string/string[] | String | Semantic role, or roles, for special handling (see [Semantic Roles](#semantic-roles)) | `"identifier"` |
344
+ | `test` | string/regex | String, Array items | Regular expression for validation | `"^[a-zA-Z0-9._-]{1,255}$"` |
345
+ | `branch` | string[] | Pointer | LDAP branches where referenced entries exist | `["ou=users,dc=example,dc=com"]` |
346
+ | `ui` | object | Pointer | UI configuration for pointer selection (future feature) | `{}` |
347
+ | `hint` | text | String, Array items | What a valid value looks like, shown under the field and quoted in refusals | `"Expected pattern 999 9999"` |
348
+ | `group` | text | All | Form section the attribute is shown in | `"Mailbox Settings"` |
349
+ | `default` | any | All | Default value for new entries | `["top", "person"]` |
350
+ | `items` | object | Array | Schema for array element validation | `{"type": "string", "test": "..."}` |
351
+
352
+ A _text_ is a plain string or a map keyed by language tag,
353
+ `{ "en": "Mailbox Settings", "fr": "Paramètres de messagerie" }`, picked as
354
+ [labels are](../../usage/plugins/ldap/flat-generic.md#naming-things-in-the-readers-language).
350
355
 
351
356
  ### Property Details
352
357
 
@@ -394,7 +399,7 @@ Marks the attribute as immutable after creation. Useful for objectClass or ident
394
399
 
395
400
  #### `role` (Optional)
396
401
 
397
- Assigns semantic meaning to attributes for special handling by the application. See [Semantic Roles](#semantic-roles).
402
+ Assigns semantic meaning to attributes for special handling by the application. See [Semantic Roles](#semantic-roles). An attribute holding several roles lists them: `"role": ["domainName", "displayName"]`.
398
403
 
399
404
  ```json
400
405
  {
@@ -200,9 +200,7 @@ overrides builds a second instance, and it needs a name of its own.
200
200
  - `onLdapForwardChange` - Syncs forwarding
201
201
  - `onLdapChange` - General LDAP change handling
202
202
  - `onLdapDisplayNameChange` - Syncs display name
203
- - `ldapgroupadddone` - After group added
204
- - `ldapgroupmodifydone` - After group modified
205
- - `ldapgroupdeletedone` - After group deleted
203
+ - `onLdapEntryChange` - Follows team mailboxes
206
204
  - **Consumes Hooks**: (Hooks provided by `onLdapChange`)
207
205
  - **Notes**: Synchronizes LDAP users/groups with Apache James mail server
208
206
 
@@ -115,7 +115,6 @@ export default class MyPlugin extends DmPlugin {
115
115
  - 📧 **Automatic LDAP → James Sync**
116
116
  - 🔄 **Mail Address Changes** - Account renaming + data
117
117
  - 💾 **Quota Management** - Automatic updates
118
- - 👥 **Mailing Lists** - LDAP Groups → Address Groups
119
118
  - 📨 **Mail Aliases** - mailAlternateAddress → James aliases
120
119
  - 🎯 **WebAdmin API** - REST Communication
121
120
 
@@ -159,33 +158,6 @@ James WebAdmin: PUT /quota/users/alice@.../size
159
158
 
160
159
  <!-- end_slide -->
161
160
 
162
- # James Plugin - List Consistency
163
-
164
- ## LDAP Groups → James Address Groups
165
-
166
- ```bash
167
- # Create a group with mail attribute
168
- POST /api/v1/ldap/groups
169
- {
170
- "cn": "engineering",
171
- "mail": "engineering@company.com",
172
- "member": ["uid=alice,...", "uid=bob,..."]
173
- }
174
- ```
175
-
176
- ### Automatic List Consistency
177
-
178
- 1. ✅ **Creation** → Group created in James + members added
179
- 2. ✅ **Add Member** → Member added to James list
180
- 3. ✅ **Remove Member** → Member removed from James list
181
- 4. ✅ **Delete Group** → List deleted in James
182
-
183
- ### Guarantee
184
-
185
- **LDAP is the source of truth, James stays synchronized**
186
-
187
- <!-- end_slide -->
188
-
189
161
  # LDAP Consistency
190
162
 
191
163
  ## Automatic Consistency Plugins
@@ -115,7 +115,6 @@ export default class MyPlugin extends DmPlugin {
115
115
  - 📧 **Synchronisation automatique LDAP → James**
116
116
  - 🔄 **Changement d'adresse mail** - Renommage compte + données
117
117
  - 💾 **Gestion des quotas** - Mise à jour automatique
118
- - 👥 **Listes de diffusion** - Groupes LDAP → Address Groups
119
118
  - 📨 **Alias mail** - mailAlternateAddress → James aliases
120
119
  - 🎯 **WebAdmin API** - Communication via REST
121
120
 
@@ -159,33 +158,6 @@ James WebAdmin: PUT /quota/users/alice@.../size
159
158
 
160
159
  <!-- end_slide -->
161
160
 
162
- # Plugin James - Cohérence des listes
163
-
164
- ## Groupes LDAP → James Address Groups
165
-
166
- ```bash
167
- # Création d'un groupe avec attribut mail
168
- POST /api/v1/ldap/groups
169
- {
170
- "cn": "engineering",
171
- "mail": "engineering@company.com",
172
- "member": ["uid=alice,...", "uid=bob,..."]
173
- }
174
- ```
175
-
176
- ### Cohérence automatique des listes
177
-
178
- 1. ✅ **Création** → Groupe créé dans James + membres ajoutés
179
- 2. ✅ **Ajout membre** → Membre ajouté à la liste James
180
- 3. ✅ **Retrait membre** → Membre retiré de la liste James
181
- 4. ✅ **Suppression groupe** → Liste supprimée dans James
182
-
183
- ### Garantie
184
-
185
- **LDAP est la source de vérité, James reste synchronisé**
186
-
187
- <!-- end_slide -->
188
-
189
161
  # Cohérence LDAP
190
162
 
191
163
  ## Plugins de cohérence automatique
@@ -452,18 +452,19 @@ whichever of the two names it selects. A value other than `req.user` or
452
452
 
453
453
  #### `core/twake/james`
454
454
 
455
- | CLI | Plural | Env | Default | Description |
456
- | -------------------------------- | ------------------------------- | --------------------------------- | ----------------------- | --------------------------- |
457
- | `--james-webadmin-url` | | `DM_JAMES_WEBADMIN_URL` | `http://localhost:8000` | James WebAdmin API URL |
458
- | `--james-webadmin-token` | | `DM_JAMES_WEBADMIN_TOKEN` | | James authentication token |
459
- | `--james-signature-template` | | `DM_JAMES_SIGNATURE_TEMPLATE` | | Email signature template |
460
- | `--james-concurrency` | | `DM_JAMES_CONCURRENCY` | `10` | James API concurrency |
461
- | `--james-init-delay` | | `DM_JAMES_INIT_DELAY` | `1000` | Init delay (ms) |
462
- | `--james-retry-attempts` | | `DM_JAMES_RETRY_ATTEMPTS` | `5` | Attempts per user call |
463
- | `--james-retry-delay` | | `DM_JAMES_RETRY_DELAY` | `1000` | Base retry delay (ms) |
464
- | `--james-mailing-list-branch` | `--james-mailing-list-branches` | `DM_JAMES_MAILING_LIST_BRANCHES` | `[]` | Mailing list branches |
465
- | `--james-mailbox-type-attribute` | | `DM_JAMES_MAILBOX_TYPE_ATTRIBUTE` | `twakeMailboxType` | Mailbox type attribute |
466
- | `--ldap-concurrency` | | `DM_LDAP_CONCURRENCY` | `10` | LDAP operations concurrency |
455
+ | CLI | Plural | Env | Default | Description |
456
+ | -------------------------------- | ------------------------------- | --------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------- |
457
+ | `--james-webadmin-url` | | `DM_JAMES_WEBADMIN_URL` | `http://localhost:8000` | James WebAdmin API URL |
458
+ | `--james-webadmin-token` | | `DM_JAMES_WEBADMIN_TOKEN` | | James authentication token |
459
+ | `--james-signature-template` | | `DM_JAMES_SIGNATURE_TEMPLATE` | | Email signature template |
460
+ | `--james-concurrency` | | `DM_JAMES_CONCURRENCY` | `10` | James API concurrency |
461
+ | `--james-init-delay` | | `DM_JAMES_INIT_DELAY` | `1000` | Init delay (ms) |
462
+ | `--james-retry-attempts` | | `DM_JAMES_RETRY_ATTEMPTS` | `5` | Attempts per user call |
463
+ | `--james-retry-delay` | | `DM_JAMES_RETRY_DELAY` | `1000` | Base retry delay (ms) |
464
+ | `--james-mailing-list-branch` | `--james-mailing-list-branches` | `DM_JAMES_MAILING_LIST_BRANCHES` | `[]` | Branches refused to team mailboxes |
465
+ | `--james-mailbox-type-attribute` | | `DM_JAMES_MAILBOX_TYPE_ATTRIBUTE` | `twakeMailboxType` | Mailbox type attribute |
466
+ | `--james-sync-forwards` | | `DM_JAMES_SYNC_FORWARDS` | `false` | Copy LDAP forwards to Twake Mail — [details](plugins/integrations/james-mail.md#forwards) |
467
+ | `--ldap-concurrency` | | `DM_LDAP_CONCURRENCY` | `10` | LDAP operations concurrency |
467
468
 
468
469
  The wait before each retry grows with the attempt, so the total wait is `--james-retry-delay` × n(n−1)/2 for n attempts: 10 s with the defaults, 190 s with 20 attempts.
469
470
 
@@ -39,6 +39,8 @@ DM_JAMES_WEBADMIN_TOKEN="your-admin-token"
39
39
  - `--mail-attribute`: LDAP attribute for email (default: `mail`)
40
40
  - `--quota-attribute`: LDAP attribute for quota (default: `mailQuotaSize`)
41
41
  - `--alias-attribute`: LDAP attribute for email aliases (default: `mailAlternateAddress`)
42
+ - `--forward-attribute`: LDAP attribute for forwards (default: `mailForwardingAddress`)
43
+ - `--james-sync-forwards`: copy that attribute to Twake Mail's forwards (default: `false`), see [Forwards](#forwards)
42
44
  - `--james-mailbox-type-attribute`: LDAP attribute for mailbox type (default: `twakeMailboxType`)
43
45
  - `--james-retry-attempts`: attempts in all of a call about a user James may not see yet (default: `5`), see [Replication lag](#replication-lag)
44
46
  - `--james-retry-delay`: base delay between those attempts, in ms (default: `1000`); the total wait is delay × n(n−1)/2 for n attempts
@@ -47,55 +49,22 @@ DM_JAMES_WEBADMIN_TOKEN="your-admin-token"
47
49
 
48
50
  ### Mailing Lists
49
51
 
50
- When a group with a `mail` attribute is created or modified:
52
+ Mailing lists are not synchronized: Twake Mail reads them from LDAP, see
53
+ [Mailing lists](james-mailboxes.md#mailing-lists). Groups whose
54
+ `twakeMailboxType` is `teamMailbox` become James team mailboxes, see
55
+ [James Team Mailboxes](james-mailboxes.md).
51
56
 
52
- 1. **Create mailing list**
57
+ ### Groups
53
58
 
54
- ```bash
55
- POST /api/v1/ldap/groups
56
- {
57
- "cn": "engineering",
58
- "mail": "engineering@company.com",
59
- "member": [
60
- "uid=alice,ou=users,dc=example,dc=com",
61
- "uid=bob,ou=users,dc=example,dc=com"
62
- ]
63
- }
64
- ```
65
-
66
- 2. **James plugin** creates address group and adds all members:
67
-
68
- ```http
69
- PUT /address/groups/engineering@company.com/alice@company.com
70
- PUT /address/groups/engineering@company.com/bob@company.com
71
- ```
72
-
73
- 3. **Add/remove members** - when group members change:
74
-
75
- ```bash
76
- POST /api/v1/ldap/groups/engineering/members
77
- {"member": "uid=charlie,ou=users,dc=example,dc=com"}
78
- ```
79
-
80
- James plugin automatically syncs:
81
-
82
- ```http
83
- PUT /address/groups/engineering@company.com/charlie@company.com
84
- ```
85
-
86
- 4. **Delete mailing list** - when group is deleted:
87
-
88
- ```http
89
- DELETE /address/groups/engineering@company.com
90
- ```
91
-
92
- **Notes:**
59
+ James has accounts for users only. An entry whose classes include
60
+ `groupOfNames`, `groupOfUniqueNames` or `groupOfURLs` is a group: the plugin
61
+ creates no identity, quota, alias, forward or delegation for its address, and
62
+ does not rename it in James when its `mail` changes. Its address is a mailing
63
+ list or a team mailbox, as above.
93
64
 
94
- - Only groups with a `mail` attribute are synchronized to James
95
- - Groups without `mail` are ignored (regular LDAP groups)
96
- - James Address Groups are simple distribution lists
97
- - All group members receive emails sent to the group address
98
- - List type attributes (open/restricted) are stored in LDAP but not enforced by James
65
+ A deployment whose groups (`--group-class`) carry none of these classes has
66
+ its groups handled as users. So is an entry whose classes cannot be read when
67
+ the change is followed.
99
68
 
100
69
  ### Mail Address Changes
101
70
 
@@ -120,7 +89,29 @@ When a user's mail attribute changes:
120
89
  POST /users/old@company.com/rename/john.doe@company.com?action=rename
121
90
  ```
122
91
 
123
- 4. **James** renames the mail account and all associated data
92
+ 4. **James** renames the mail account and its mailboxes, and adds a forward
93
+ from the old address to the new one, so that mail sent to the old address
94
+ still arrives. It leaves the identities under the old address.
95
+
96
+ 5. **James plugin** moves the aliases (see
97
+ [Aliases and Mail Changes](#aliases-and-mail-changes)) and gives the new
98
+ address its [default identity](#display-name-and-identity) back, with the
99
+ signatures of the old one when `--james-signature-template` is not set.
100
+
101
+ #### Forwards Left on an Address
102
+
103
+ The forward a rename leaves outlives the account. When an address becomes the
104
+ `mail` or an alias of an account, at its creation, a rename, a mail added to
105
+ an existing entry or an alias add, the plugin removes the forwards James holds
106
+ from it, except the entry's own when the directory owns forwards
107
+ (`--forward-attribute`, with `--james-sync-forwards`):
108
+
109
+ ```http
110
+ GET /address/forwards/old@company.com
111
+ DELETE /address/forwards/old@company.com/targets/john.doe@company.com
112
+ ```
113
+
114
+ Otherwise the new owner of the address would not get its mail.
124
115
 
125
116
  ### Quota Changes
126
117
 
@@ -148,11 +139,33 @@ When a user's quota changes:
148
139
  5000000000
149
140
  ```
150
141
 
142
+ ### Forwards
143
+
144
+ Forwards are a setting of the user in Twake Mail, beside "keep a copy in my
145
+ mailbox", and Twake Mail Admin can change them too. By default the plugin
146
+ does not copy `--forward-attribute` to them. It still removes the
147
+ [forwards left](#forwards-left-on-an-address) on an address an account takes:
148
+ Twake Mail keeps a user's forwards under their own address, and none can have
149
+ been set on an address the account is only now taking.
150
+
151
+ With `--james-sync-forwards`, the directory owns them: each change of
152
+ `--forward-attribute` is applied to Twake Mail, and overwrites what the user
153
+ set there.
154
+
155
+ ```http
156
+ PUT /address/forwards/jdoe@company.com/targets/john@partner.com
157
+ DELETE /address/forwards/jdoe@company.com/targets/old@partner.com
158
+ ```
159
+
160
+ Only the change is applied: a forward the user added in Twake Mail stays
161
+ until the directory names it and removes it, and the directory is never told
162
+ about the forwards set in Twake Mail.
163
+
151
164
  ### Display Name and Identity
152
165
 
153
- When a user is added, or their display name changes, the plugin names their
154
- default identity in Twake Mail after the directory. The name is the first one
155
- found in `--display-name-attribute` (`displayName` by default), `cn`, then
166
+ When a user is added, renamed, or their display name changes, the plugin names
167
+ their default identity in Twake Mail after the directory. The name is the first
168
+ one found in `--display-name-attribute` (`displayName` by default), `cn`, then
156
169
  `givenName` and `sn`. The optional signature is `--james-signature-template`.
157
170
 
158
171
  1. **James plugin** reads the default identity, the deletable one with the
@@ -259,7 +272,8 @@ When the primary email address changes, all aliases are automatically updated:
259
272
  PUT /address/aliases/john.smith@company.com/sources/jdoe@company.com
260
273
  ```
261
274
 
262
- **Note:** James automatically creates an alias from the old address when renaming a user. The plugin attempts to create this alias explicitly, but handles the 409 Conflict response gracefully if it already exists.
275
+ James forwards the old address to the new one, see
276
+ [Forwards Left on an Address](#forwards-left-on-an-address).
263
277
 
264
278
  #### Active Directory Format Support
265
279
 
@@ -463,14 +477,19 @@ const signature = await james.generateSignature(
463
477
 
464
478
  ---
465
479
 
466
- ### updateJamesIdentity(dn, mail, displayName)
480
+ ### updateJamesIdentity(dn, mail, displayName, signatures?)
467
481
 
468
482
  Update a user's JMAP identity in James (name and optional signature).
469
483
 
470
484
  **Signature:**
471
485
 
472
486
  ```typescript
473
- async updateJamesIdentity(dn: string, mail: string, displayName: string): Promise<void>
487
+ async updateJamesIdentity(
488
+ dn: string,
489
+ mail: string,
490
+ displayName: string,
491
+ signatures?: { htmlSignature?: string; textSignature?: string }
492
+ ): Promise<void>
474
493
  ```
475
494
 
476
495
  **Parameters:**
@@ -478,6 +497,8 @@ async updateJamesIdentity(dn: string, mail: string, displayName: string): Promis
478
497
  - `dn` (string): LDAP Distinguished Name (used for signature generation)
479
498
  - `mail` (string): User's email address
480
499
  - `displayName` (string): New display name for the identity
500
+ - `signatures` (object, optional): written when `--james-signature-template`
501
+ is not set
481
502
 
482
503
  **Example:**
483
504
 
@@ -575,18 +596,17 @@ const type = await james.getGroupMailboxType(
575
596
 
576
597
  ### Endpoints Used
577
598
 
578
- | Operation | Endpoint | Method |
579
- | ------------------- | ------------------------------------------ | ------ |
580
- | Rename account | `/users/{old}/rename/{new}?action=rename` | POST |
581
- | Update quota | `/quota/users/{mail}/size` | PUT |
582
- | Get quota | `/quota/users/{mail}` | GET |
583
- | Add delegation | `/users/{mail}/authorizedUsers/{delegate}` | PUT |
584
- | Remove delegation | `/users/{mail}/authorizedUsers/{delegate}` | DELETE |
585
- | Add alias | `/address/aliases/{mail}/sources/{alias}` | PUT |
586
- | Remove alias | `/address/aliases/{mail}/sources/{alias}` | DELETE |
587
- | Add group member | `/address/groups/{group}/{member}` | PUT |
588
- | Remove group member | `/address/groups/{group}/{member}` | DELETE |
589
- | Delete group | `/address/groups/{group}` | DELETE |
599
+ | Operation | Endpoint | Method |
600
+ | ----------------- | ------------------------------------------ | ------ |
601
+ | Rename account | `/users/{old}/rename/{new}?action=rename` | POST |
602
+ | Update quota | `/quota/users/{mail}/size` | PUT |
603
+ | Get quota | `/quota/users/{mail}` | GET |
604
+ | Add delegation | `/users/{mail}/authorizedUsers/{delegate}` | PUT |
605
+ | Remove delegation | `/users/{mail}/authorizedUsers/{delegate}` | DELETE |
606
+ | Add alias | `/address/aliases/{mail}/sources/{alias}` | PUT |
607
+ | Remove alias | `/address/aliases/{mail}/sources/{alias}` | DELETE |
608
+ | List forwards | `/address/forwards/{mail}` | GET |
609
+ | Remove forward | `/address/forwards/{mail}/targets/{to}` | DELETE |
590
610
 
591
611
  ### Authentication
592
612
 
@@ -727,11 +747,9 @@ defaults, 190 seconds with 20 attempts. `--james-retry-attempts 1` disables
727
747
  the retries. Other
728
748
  failures, such as 401 or 500, are not retried, nor are deletions.
729
749
 
730
- The group calls are not retried: James does not look the members up in its
731
- users repository there. Address groups (`/address/groups`) accept any valid
732
- address, and the member routes of a TMail team mailbox do not check the user;
733
- their only 404 is a missing team mailbox, which is avoided by creating it
734
- before adding the members.
750
+ The team mailbox calls are not retried: their member routes do not check
751
+ the user in James's users repository; their only 404 is a missing team
752
+ mailbox, which is avoided by creating it before adding the members.
735
753
 
736
754
  The retries run in the background, after the LDAP write has answered; a
737
755
  call waiting for its next attempt does not take a slot of
@@ -821,9 +839,10 @@ Quota values are in **bytes**:
821
839
 
822
840
  ### Scenario 1: User Creation
823
841
 
824
- 1. Create user in LDAP with mail attribute
825
- 2. James plugin does nothing (user doesn't exist in James yet)
826
- 3. Create mail account in James manually or via provisioning script
842
+ 1. Create user in LDAP with mail attribute: James reads its users from LDAP
843
+ 2. James plugin sets the quota, the aliases and the default identity, after
844
+ dropping the [forwards left](#forwards-left-on-an-address) on its addresses
845
+ 3. A mail added later to an existing entry is handled the same way
827
846
  4. Future mail/quota changes are synced automatically
828
847
 
829
848
  ### Scenario 2: Mail Address Change
@@ -846,68 +865,12 @@ Quota values are in **bytes**:
846
865
  3. If user is over new quota, James may block incoming mail
847
866
  4. User must delete mail to get under quota
848
867
 
849
- ## Mailing List Examples
850
-
851
- ### Creating a Mailing List
852
-
853
- ```bash
854
- # Create a group with mail attribute
855
- curl -X POST http://localhost:8081/api/v1/ldap/groups \
856
- -H "Authorization: Bearer admin-token" \
857
- -H "Content-Type: application/json" \
858
- -d '{
859
- "cn": "engineering",
860
- "mail": "engineering@company.com",
861
- "member": [
862
- "uid=alice,ou=users,dc=example,dc=com",
863
- "uid=bob,ou=users,dc=example,dc=com"
864
- ],
865
- "twakeDepartmentLink": "ou=organization,dc=example,dc=com",
866
- "twakeDepartmentPath": "Engineering"
867
- }'
868
- ```
869
-
870
- The James plugin automatically creates the mailing list and adds all members.
871
-
872
- ### Adding a Member
873
-
874
- ```bash
875
- # Add member to existing group
876
- curl -X POST http://localhost:8081/api/v1/ldap/groups/engineering/members \
877
- -H "Authorization: Bearer admin-token" \
878
- -H "Content-Type: application/json" \
879
- -d '{"member": "uid=charlie,ou=users,dc=example,dc=com"}'
880
- ```
881
-
882
- James is automatically updated to include charlie@company.com in the distribution list.
883
-
884
- ### Removing a Member
885
-
886
- ```bash
887
- # Remove member from group
888
- curl -X DELETE http://localhost:8081/api/v1/ldap/groups/engineering/members/uid=alice,ou=users,dc=example,dc=com \
889
- -H "Authorization: Bearer admin-token"
890
- ```
891
-
892
- James removes alice@company.com from the mailing list.
893
-
894
- ### Deleting a Mailing List
895
-
896
- ```bash
897
- # Delete the entire group
898
- curl -X DELETE http://localhost:8081/api/v1/ldap/groups/engineering \
899
- -H "Authorization: Bearer admin-token"
900
- ```
901
-
902
- James deletes the entire address group.
903
-
904
868
  ## Limitations
905
869
 
906
870
  1. **One-way sync**: LDAP → James only. James changes don't sync back to LDAP.
907
871
  2. **No account creation**: Plugin doesn't create James accounts, only updates existing ones.
908
872
  3. **No user deletion**: deleting an LDAP user leaves its James data (mailboxes, quota, aliases) as it is; purging it is left to James.
909
873
  4. **Synchronous**: James API calls block LDAP response. Slow James = slow LDAP.
910
- 5. **No send restrictions**: James doesn't enforce list type restrictions (open/member/owner-only). These are metadata in LDAP only.
911
874
 
912
875
  ## Advanced Configuration
913
876