ldap-rest 0.17.0 → 0.18.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 (76) hide show
  1. package/dist/abstract/ldapFlat.js +1 -1
  2. package/dist/abstract/twakePlugin.js +1 -1
  3. package/dist/bin/index.js +1 -1
  4. package/dist/config/args.js +1 -1
  5. package/dist/config/schema.js +1 -1
  6. package/dist/lib/ldapActions.js +1 -1
  7. package/dist/plugins/ldap/enterpriseRules.js +1 -1
  8. package/dist/plugins/ldap/groups.js +1 -1
  9. package/dist/plugins/ldap/onChange.js +1 -1
  10. package/dist/plugins/ldap/organizations.js +1 -1
  11. package/dist/plugins/twake/james.js +1 -1
  12. package/dist/src/abstract/ldapFlat.d.ts +9 -11
  13. package/dist/src/abstract/twakePlugin.d.ts +18 -1
  14. package/dist/src/bin/index.d.ts +10 -0
  15. package/dist/src/browser/ldap-group-editor/types.d.ts +2 -1
  16. package/dist/src/browser/ldap-resource-editor/types.d.ts +3 -2
  17. package/dist/src/browser/ldap-unit-editor/types.d.ts +2 -1
  18. package/dist/src/browser/ldap-user-editor/types.d.ts +3 -2
  19. package/dist/src/browser/shared/types/index.d.ts +7 -1
  20. package/dist/src/browser/shared/utils/schema.d.ts +20 -1
  21. package/dist/src/config/args.d.ts +2 -0
  22. package/dist/src/config/schema.d.ts +27 -4
  23. package/dist/src/hooks.d.ts +3 -1
  24. package/dist/src/plugins/ldap/organizations.d.ts +0 -8
  25. package/dist/src/plugins/twake/james.d.ts +12 -74
  26. package/docs/client-development/api/reference.md +1 -1
  27. package/docs/client-development/api/rest-api.md +11 -1
  28. package/docs/client-development/schemas/README.md +18 -13
  29. package/docs/plugin-development/dependencies.md +7 -3
  30. package/docs/presentations/en.md +0 -28
  31. package/docs/presentations/fr.md +0 -28
  32. package/docs/usage/configuration.md +14 -10
  33. package/docs/usage/plugins/integrations/james-mail.md +51 -115
  34. package/docs/usage/plugins/integrations/james-mailboxes.md +58 -78
  35. package/docs/usage/plugins/ldap/flat-generic.md +23 -5
  36. package/docs/usage/plugins/ldap/on-change.md +6 -0
  37. package/docs/usage/plugins/utilities/weblogs.md +1 -1
  38. package/docs/usage/upgrading.md +30 -0
  39. package/package.json +1 -1
  40. package/static/browser/ldap-resource-editor/api/ResourceApiClient.js +2 -1
  41. package/static/browser/ldap-resource-editor/api/ResourceApiClient.js.map +1 -1
  42. package/static/browser/ldap-user-editor/api/UserApiClient.js +2 -1
  43. package/static/browser/ldap-user-editor/api/UserApiClient.js.map +1 -1
  44. package/static/browser/ldap-user-editor/components/UserEditor.js +11 -8
  45. package/static/browser/ldap-user-editor/components/UserEditor.js.map +1 -1
  46. package/static/browser/ldap-user-editor/components/UserList.js +3 -1
  47. package/static/browser/ldap-user-editor/components/UserList.js.map +1 -1
  48. package/static/browser/ldap-user-editor.esm.js +52 -10
  49. package/static/browser/ldap-user-editor.esm.js.map +1 -1
  50. package/static/browser/ldap-user-editor.js +52 -10
  51. package/static/browser/ldap-user-editor.js.map +1 -1
  52. package/static/browser/ldap-user-editor.min.js +1 -1
  53. package/static/browser/ldap-user-editor.min.js.map +1 -1
  54. package/static/browser/shared/index.js +1 -1
  55. package/static/browser/shared/types/index.js.map +1 -1
  56. package/static/browser/shared/utils/form.js +2 -1
  57. package/static/browser/shared/utils/form.js.map +1 -1
  58. package/static/browser/shared/utils/schema.js +33 -1
  59. package/static/browser/shared/utils/schema.js.map +1 -1
  60. package/static/browser/shared.esm.js +153 -121
  61. package/static/browser/shared.esm.js.map +1 -1
  62. package/static/browser/shared.js +154 -120
  63. package/static/browser/shared.js.map +1 -1
  64. package/static/browser/shared.min.js +1 -1
  65. package/static/browser/shared.min.js.map +1 -1
  66. package/static/schemas/standard/groups.json +1 -1
  67. package/static/schemas/twake/groups.json +25 -7
  68. package/static/schemas/twake/nomenclature/twakeAccountStatus.json +10 -2
  69. package/static/schemas/twake/nomenclature/twakeDeliveryMode.json +10 -2
  70. package/static/schemas/twake/nomenclature/twakeDomain.json +9 -3
  71. package/static/schemas/twake/nomenclature/twakeListType.json +10 -2
  72. package/static/schemas/twake/nomenclature/twakeMailboxType.json +10 -2
  73. package/static/schemas/twake/nomenclature/twakeTitle.json +10 -2
  74. package/static/schemas/twake/organizations.json +4 -1
  75. package/static/schemas/twake/positions.json +4 -1
  76. package/static/schemas/twake/users.json +36 -9
@@ -1075,6 +1075,16 @@ curl -X POST \
1075
1075
  }
1076
1076
  ```
1077
1077
 
1078
+ A member that does not exist answers 400 naming it, and none of the members
1079
+ is added (unless `--group-allow-unexistent-members` is set). Group creation
1080
+ checks its `member` list the same way:
1081
+
1082
+ ```json
1083
+ {
1084
+ "error": "Member uid=nobody,ou=users,dc=example,dc=com not found"
1085
+ }
1086
+ ```
1087
+
1078
1088
  ### Remove Group Member
1079
1089
 
1080
1090
  Remove a user from a group.
@@ -1146,7 +1156,7 @@ All errors return a JSON object with an error message:
1146
1156
 
1147
1157
  ```json
1148
1158
  {
1149
- "error": "Invalid value for attribute \"uid\": must match ^[a-zA-Z0-9._-]{1,255}$"
1159
+ "error": "Invalid value for attribute \"uid\""
1150
1160
  }
1151
1161
  ```
1152
1162
 
@@ -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
  {
@@ -18,6 +18,12 @@ dependencies = {
18
18
  };
19
19
  ```
20
20
 
21
+ A dependency is loaded when the plugin registers, unless a plugin of that
22
+ name already is. A module requested again under the same name and without
23
+ overrides — a dependency also given to `--plugin`, or an entry listed twice —
24
+ is loaded once: the second request waits for the first. Only an entry with
25
+ overrides builds a second instance, and it needs a name of its own.
26
+
21
27
  ### Hook Dependencies
22
28
 
23
29
  **Hook Providers**: Plugins that implement hooks (via `hooks: Hooks = { ... }`)
@@ -194,9 +200,7 @@ dependencies = {
194
200
  - `onLdapForwardChange` - Syncs forwarding
195
201
  - `onLdapChange` - General LDAP change handling
196
202
  - `onLdapDisplayNameChange` - Syncs display name
197
- - `ldapgroupadddone` - After group added
198
- - `ldapgroupmodifydone` - After group modified
199
- - `ldapgroupdeletedone` - After group deleted
203
+ - `onLdapEntryChange` - Follows team mailboxes
200
204
  - **Consumes Hooks**: (Hooks provided by `onLdapChange`)
201
205
  - **Notes**: Synchronizes LDAP users/groups with Apache James mail server
202
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,16 +452,20 @@ 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-mailing-list-branch` | `--james-mailing-list-branches` | `DM_JAMES_MAILING_LIST_BRANCHES` | `[]` | Mailing list branches |
463
- | `--james-mailbox-type-attribute` | | `DM_JAMES_MAILBOX_TYPE_ATTRIBUTE` | `twakeMailboxType` | Mailbox type attribute |
464
- | `--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
+ | `--ldap-concurrency` | | `DM_LDAP_CONCURRENCY` | `10` | LDAP operations concurrency |
467
+
468
+ 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.
465
469
 
466
470
  #### `core/twake/calendar`
467
471
 
@@ -40,60 +40,29 @@ DM_JAMES_WEBADMIN_TOKEN="your-admin-token"
40
40
  - `--quota-attribute`: LDAP attribute for quota (default: `mailQuotaSize`)
41
41
  - `--alias-attribute`: LDAP attribute for email aliases (default: `mailAlternateAddress`)
42
42
  - `--james-mailbox-type-attribute`: LDAP attribute for mailbox type (default: `twakeMailboxType`)
43
+ - `--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
+ - `--james-retry-delay`: base delay between those attempts, in ms (default: `1000`); the total wait is delay × n(n−1)/2 for n attempts
43
45
 
44
46
  ## How It Works
45
47
 
46
48
  ### Mailing Lists
47
49
 
48
- When a group with a `mail` attribute is created or modified:
50
+ Mailing lists are not synchronized: Twake Mail reads them from LDAP, see
51
+ [Mailing lists](james-mailboxes.md#mailing-lists). Groups whose
52
+ `twakeMailboxType` is `teamMailbox` become James team mailboxes, see
53
+ [James Team Mailboxes](james-mailboxes.md).
49
54
 
50
- 1. **Create mailing list**
55
+ ### Groups
51
56
 
52
- ```bash
53
- POST /api/v1/ldap/groups
54
- {
55
- "cn": "engineering",
56
- "mail": "engineering@company.com",
57
- "member": [
58
- "uid=alice,ou=users,dc=example,dc=com",
59
- "uid=bob,ou=users,dc=example,dc=com"
60
- ]
61
- }
62
- ```
63
-
64
- 2. **James plugin** creates address group and adds all members:
65
-
66
- ```http
67
- PUT /address/groups/engineering@company.com/alice@company.com
68
- PUT /address/groups/engineering@company.com/bob@company.com
69
- ```
57
+ James has accounts for users only. An entry whose classes include
58
+ `groupOfNames`, `groupOfUniqueNames` or `groupOfURLs` is a group: the plugin
59
+ creates no identity, quota, alias, forward or delegation for its address, and
60
+ does not rename it in James when its `mail` changes. Its address is a mailing
61
+ list or a team mailbox, as above.
70
62
 
71
- 3. **Add/remove members** - when group members change:
72
-
73
- ```bash
74
- POST /api/v1/ldap/groups/engineering/members
75
- {"member": "uid=charlie,ou=users,dc=example,dc=com"}
76
- ```
77
-
78
- James plugin automatically syncs:
79
-
80
- ```http
81
- PUT /address/groups/engineering@company.com/charlie@company.com
82
- ```
83
-
84
- 4. **Delete mailing list** - when group is deleted:
85
-
86
- ```http
87
- DELETE /address/groups/engineering@company.com
88
- ```
89
-
90
- **Notes:**
91
-
92
- - Only groups with a `mail` attribute are synchronized to James
93
- - Groups without `mail` are ignored (regular LDAP groups)
94
- - James Address Groups are simple distribution lists
95
- - All group members receive emails sent to the group address
96
- - List type attributes (open/restricted) are stored in LDAP but not enforced by James
63
+ A deployment whose groups (`--group-class`) carry none of these classes has
64
+ its groups handled as users. So is an entry whose classes cannot be read when
65
+ the change is followed.
97
66
 
98
67
  ### Mail Address Changes
99
68
 
@@ -573,18 +542,15 @@ const type = await james.getGroupMailboxType(
573
542
 
574
543
  ### Endpoints Used
575
544
 
576
- | Operation | Endpoint | Method |
577
- | ------------------- | ------------------------------------------ | ------ |
578
- | Rename account | `/users/{old}/rename/{new}?action=rename` | POST |
579
- | Update quota | `/quota/users/{mail}/size` | PUT |
580
- | Get quota | `/quota/users/{mail}` | GET |
581
- | Add delegation | `/users/{mail}/authorizedUsers/{delegate}` | PUT |
582
- | Remove delegation | `/users/{mail}/authorizedUsers/{delegate}` | DELETE |
583
- | Add alias | `/address/aliases/{mail}/sources/{alias}` | PUT |
584
- | Remove alias | `/address/aliases/{mail}/sources/{alias}` | DELETE |
585
- | Add group member | `/address/groups/{group}/{member}` | PUT |
586
- | Remove group member | `/address/groups/{group}/{member}` | DELETE |
587
- | Delete group | `/address/groups/{group}` | DELETE |
545
+ | Operation | Endpoint | Method |
546
+ | ----------------- | ------------------------------------------ | ------ |
547
+ | Rename account | `/users/{old}/rename/{new}?action=rename` | POST |
548
+ | Update quota | `/quota/users/{mail}/size` | PUT |
549
+ | Get quota | `/quota/users/{mail}` | GET |
550
+ | Add delegation | `/users/{mail}/authorizedUsers/{delegate}` | PUT |
551
+ | Remove delegation | `/users/{mail}/authorizedUsers/{delegate}` | DELETE |
552
+ | Add alias | `/address/aliases/{mail}/sources/{alias}` | PUT |
553
+ | Remove alias | `/address/aliases/{mail}/sources/{alias}` | DELETE |
588
554
 
589
555
  ### Authentication
590
556
 
@@ -707,6 +673,32 @@ The plugin logs all operations:
707
673
 
708
674
  ## Error Handling
709
675
 
676
+ ### Replication lag
677
+
678
+ James reads its users from LDAP, and may read them from a replica that has
679
+ not received the latest write yet: for up to a few seconds after a user is
680
+ created or renamed, James does not know the new address. A call about that
681
+ address fails meanwhile, with 400 (rename) or 404 (quota, alias, identity).
682
+
683
+ The calls that need James to know the user are therefore retried on 400 and
684
+ 404: the rename, the quota, an alias or a forward added, a delegation added,
685
+ and the identity. Each failed attempt logs a warning
686
+ (`"result": "retry"`, with the attempt number); the error is logged when the
687
+ last attempt fails. With the defaults, 5 attempts, the waits are 1, 2, 3 and
688
+ 4 seconds: `--james-retry-delay` times the number of attempts made, so
689
+ `--james-retry-delay` × n(n−1)/2 in all for n attempts: 10 seconds with the
690
+ defaults, 190 seconds with 20 attempts. `--james-retry-attempts 1` disables
691
+ the retries. Other
692
+ failures, such as 401 or 500, are not retried, nor are deletions.
693
+
694
+ The team mailbox calls are not retried: their member routes do not check
695
+ the user in James's users repository; their only 404 is a missing team
696
+ mailbox, which is avoided by creating it before adding the members.
697
+
698
+ The retries run in the background, after the LDAP write has answered; a
699
+ call waiting for its next attempt does not take a slot of
700
+ `--james-concurrency`.
701
+
710
702
  ### Non-Existent User
711
703
 
712
704
  If mail account doesn't exist in James:
@@ -816,68 +808,12 @@ Quota values are in **bytes**:
816
808
  3. If user is over new quota, James may block incoming mail
817
809
  4. User must delete mail to get under quota
818
810
 
819
- ## Mailing List Examples
820
-
821
- ### Creating a Mailing List
822
-
823
- ```bash
824
- # Create a group with mail attribute
825
- curl -X POST http://localhost:8081/api/v1/ldap/groups \
826
- -H "Authorization: Bearer admin-token" \
827
- -H "Content-Type: application/json" \
828
- -d '{
829
- "cn": "engineering",
830
- "mail": "engineering@company.com",
831
- "member": [
832
- "uid=alice,ou=users,dc=example,dc=com",
833
- "uid=bob,ou=users,dc=example,dc=com"
834
- ],
835
- "twakeDepartmentLink": "ou=organization,dc=example,dc=com",
836
- "twakeDepartmentPath": "Engineering"
837
- }'
838
- ```
839
-
840
- The James plugin automatically creates the mailing list and adds all members.
841
-
842
- ### Adding a Member
843
-
844
- ```bash
845
- # Add member to existing group
846
- curl -X POST http://localhost:8081/api/v1/ldap/groups/engineering/members \
847
- -H "Authorization: Bearer admin-token" \
848
- -H "Content-Type: application/json" \
849
- -d '{"member": "uid=charlie,ou=users,dc=example,dc=com"}'
850
- ```
851
-
852
- James is automatically updated to include charlie@company.com in the distribution list.
853
-
854
- ### Removing a Member
855
-
856
- ```bash
857
- # Remove member from group
858
- curl -X DELETE http://localhost:8081/api/v1/ldap/groups/engineering/members/uid=alice,ou=users,dc=example,dc=com \
859
- -H "Authorization: Bearer admin-token"
860
- ```
861
-
862
- James removes alice@company.com from the mailing list.
863
-
864
- ### Deleting a Mailing List
865
-
866
- ```bash
867
- # Delete the entire group
868
- curl -X DELETE http://localhost:8081/api/v1/ldap/groups/engineering \
869
- -H "Authorization: Bearer admin-token"
870
- ```
871
-
872
- James deletes the entire address group.
873
-
874
811
  ## Limitations
875
812
 
876
813
  1. **One-way sync**: LDAP → James only. James changes don't sync back to LDAP.
877
814
  2. **No account creation**: Plugin doesn't create James accounts, only updates existing ones.
878
- 3. **No user deletion**: Plugin doesn't delete James accounts when LDAP users are deleted.
815
+ 3. **No user deletion**: deleting an LDAP user leaves its James data (mailboxes, quota, aliases) as it is; purging it is left to James.
879
816
  4. **Synchronous**: James API calls block LDAP response. Slow James = slow LDAP.
880
- 5. **No send restrictions**: James doesn't enforce list type restrictions (open/member/owner-only). These are metadata in LDAP only.
881
817
 
882
818
  ## Advanced Configuration
883
819