docs: translate README and .gitignore to English
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
# Echte CSV's met credentials nooit committen
|
||||
# Never commit real credential CSVs
|
||||
accounts.csv
|
||||
accounts.*.csv
|
||||
!accounts.example.csv
|
||||
|
||||
82
README.md
82
README.md
@@ -1,36 +1,37 @@
|
||||
# Nextcloud-ConnectMail
|
||||
|
||||
Bulk-link IMAP/SMTP mailaccounts voor Nextcloud-gebruikers via `occ mail:account:create`.
|
||||
Bulk-link IMAP/SMTP mail accounts for Nextcloud users via `occ mail:account:create`.
|
||||
|
||||
Bedoeld voor admins die in één keer mail-accounts willen koppelen voor meerdere users —
|
||||
bijvoorbeeld bij onboarding, migratie, of provisioning op basis van een externe lijst.
|
||||
Intended for admins who need to link mail accounts for multiple users at once —
|
||||
for example during onboarding, migration, or provisioning from an external list.
|
||||
|
||||
## Wanneer dit script gebruiken
|
||||
## When to use this script
|
||||
|
||||
De Nextcloud Mail-app biedt **geen** REST-endpoint om als admin een account voor een
|
||||
andere user te koppelen. Wel bestaat `occ mail:account:create <userId> ...`, maar dat
|
||||
is positioneel en omslachtig voor bulk-werk. Dit script wrapt die call en leest een CSV.
|
||||
The Nextcloud Mail app provides **no** REST endpoint for an admin to link an
|
||||
account on behalf of another user. There is an `occ mail:account:create <userId> ...`
|
||||
command, but it is positional and cumbersome for bulk work. This script wraps that
|
||||
call and reads a CSV file.
|
||||
|
||||
Alternatieven:
|
||||
- **Provisioning-templates** (admin-UI in Mail): één template per domein, géén
|
||||
per-user credentials. Werkt alleen als alle users hetzelfde mail-cluster delen.
|
||||
- **Eigen REST-controller**: vereist een patch op de Mail-app.
|
||||
Alternatives:
|
||||
- **Provisioning templates** (Mail admin UI): one template per domain, no
|
||||
per-user credentials. Only works if all users share the same mail cluster.
|
||||
- **Custom REST controller**: requires patching the Mail app itself.
|
||||
|
||||
## Vereisten
|
||||
## Requirements
|
||||
|
||||
- Shell-toegang tot de Nextcloud-server (rechtstreeks of via SSH/docker exec)
|
||||
- `occ` uitvoerbaar als web-user (meestal `www-data`)
|
||||
- De Nextcloud Mail-app geïnstalleerd en geactiveerd
|
||||
- `python3` op de host waar het script draait (voor RFC-4180 CSV-parsing)
|
||||
- Shell access to the Nextcloud server (directly or via SSH / `docker exec`)
|
||||
- `occ` executable as the web user (usually `www-data`)
|
||||
- The Nextcloud Mail app installed and enabled
|
||||
- `python3` on the host running the script (for RFC-4180 CSV parsing)
|
||||
|
||||
## Gebruik
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
OCC_CMD="docker exec -u www-data nc-dev php occ" \
|
||||
./mail-bulk-link.sh accounts.csv
|
||||
```
|
||||
|
||||
Voor classic installs:
|
||||
Classic install:
|
||||
|
||||
```bash
|
||||
OCC_CMD="sudo -u www-data php /var/www/nextcloud/occ" \
|
||||
@@ -44,41 +45,40 @@ OCC_CMD="ssh hetzner-ax42 docker exec -u www-data nc-dev php occ" \
|
||||
./mail-bulk-link.sh accounts.csv
|
||||
```
|
||||
|
||||
## CSV-formaat
|
||||
## CSV format
|
||||
|
||||
Header verplicht, kolomvolgorde vrij. Verplichte kolommen:
|
||||
Header row required, column order flexible. Required columns:
|
||||
|
||||
```
|
||||
userId,name,email,imapHost,imapPort,imapSsl,imapUser,imapPass,smtpHost,smtpPort,smtpSsl,smtpUser,smtpPass
|
||||
```
|
||||
|
||||
Optionele kolom: `authMethod` (`password` of `xoauth2`, default `password`).
|
||||
Optional column: `authMethod` (`password` or `xoauth2`, defaults to `password`).
|
||||
|
||||
- `imapSsl` / `smtpSsl`: `ssl`, `tls`, of `none`
|
||||
- Regels die beginnen met `#` worden overgeslagen
|
||||
- Quote velden met komma's volgens RFC 4180 (`"foo,bar"`)
|
||||
- `imapSsl` / `smtpSsl`: `ssl`, `tls`, or `none`
|
||||
- Lines starting with `#` are skipped
|
||||
- Quote fields containing commas per RFC 4180 (`"foo,bar"`)
|
||||
|
||||
Zie [accounts.example.csv](accounts.example.csv) voor een voorbeeld.
|
||||
See [accounts.example.csv](accounts.example.csv) for a working example.
|
||||
|
||||
## Beperkingen
|
||||
## Limitations
|
||||
|
||||
- **Geen connectie-test.** De `occ`-command slaat blind op — foute credentials worden
|
||||
geaccepteerd. De user merkt het pas bij de eerste sync. De REST-route (`POST
|
||||
/api/accounts`) doet wel een live IMAP/SMTP-test, maar werkt alleen voor de
|
||||
ingelogde user zelf.
|
||||
- **Geen initial mailbox-sync.** Wordt door de REST-route wel getriggerd, door
|
||||
`occ` niet. Eerste sync gebeurt bij de eerstvolgende background-job of bij eerste
|
||||
login van de user.
|
||||
- **Wachtwoorden in CSV.** Plaintext op disk tijdens uitvoer. Na de run:
|
||||
`shred -u accounts.csv`. Nooit committen.
|
||||
- **No connection test.** The `occ` command stores blindly — invalid credentials
|
||||
are accepted silently. The user only finds out on the first sync. The REST
|
||||
route (`POST /api/accounts`) does a live IMAP/SMTP check, but only works for
|
||||
the currently logged-in user.
|
||||
- **No initial mailbox sync.** The REST route triggers one; `occ` does not.
|
||||
First sync happens on the next background job run or first user login.
|
||||
- **Plaintext passwords in the CSV.** They sit on disk during execution. After
|
||||
the run: `shred -u accounts.csv`. Never commit credential CSVs.
|
||||
|
||||
## Security
|
||||
|
||||
- Voeg `accounts.csv` (en varianten) toe aan `.gitignore` van je deploy-repo
|
||||
- Draai dit alleen vanuit een omgeving waar je sowieso admin-rechten hebt
|
||||
- Voor productie: overweeg de credentials uit een secrets-store te halen en de
|
||||
CSV on-the-fly te genereren in tmpfs
|
||||
- Add `accounts.csv` (and variants) to your deployment repo's `.gitignore`
|
||||
- Only run this from environments where you already hold admin rights
|
||||
- For production use: pull credentials from a secrets store and generate the
|
||||
CSV on the fly in `tmpfs`
|
||||
|
||||
## Licentie
|
||||
## License
|
||||
|
||||
AGPL-3.0-or-later (consistent met Nextcloud Mail).
|
||||
AGPL-3.0-or-later (consistent with Nextcloud Mail).
|
||||
|
||||
Reference in New Issue
Block a user