Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3e33add
IONOS(ionos-mail): feat(provider): implement external mail account pr…
printminion-co Dec 19, 2025
d6b8b7b
IONOS(ionos-mail): refactor(dtos): move DTOs to shared Common namespace
printminion-co Dec 19, 2025
96b5b9d
IONOS(ionos-mail): feat(provider): add provider availability check an…
printminion-co Dec 23, 2025
00736cc
IONOS(ionos-mail): refactor(service): allow optional user ID paramete…
printminion-co Dec 29, 2025
be86b0a
IONOS(ionos-mail): feat(provider): implement IONOS Nextcloud Workspac…
printminion-co Dec 23, 2025
b249d0d
IONOS(ionos-mail): feat(provider): register IonosProvider during appl…
printminion-co Dec 23, 2025
f505844
IONOS(ionos-mail): feat(frontend): add generic ExternalProviderTab co…
printminion-co Dec 22, 2025
109e81c
IONOS(ionos-mail): refactor(routes): remove legacy IONOS routes
printminion-co Dec 22, 2025
deddefd
IONOS(ionos-mail): refactor(services): move IONOS services to provide…
printminion-co Dec 22, 2025
b47da8d
IONOS(ionos-mail): feat(frontend): add retry logic for IMAP connectio…
printminion-co Dec 24, 2025
2b287ab
IONOS(ionos-mail): feat(commands): add occ commands for mail account …
printminion-co Dec 29, 2025
11bf7e0
IONOS(ionos-mail): chore(commands): register provider commands in inf…
printminion-co Dec 29, 2025
a01cacc
IONOS(ionos-mail): feat(provider): add endpoint to generate app passw…
printminion-co Dec 30, 2025
8394c73
IONOS(ionos-mail): feat(provider): implement IONOS Nextcloud Workspac…
printminion-co Dec 30, 2025
a897b1e
IONOS(ionos-mail): feat(commands): add occ command for mail account p…
printminion-co Dec 30, 2025
12443d0
IONOS(ionos-mail): chore(commands): register ProviderGenerateAppPassw…
printminion-co Dec 30, 2025
b3eee69
IONOS(ionos-mail): docs(commands): add comprehensive provider command…
printminion-co Dec 29, 2025
71923b4
IONOS(ionos-mail): refactor(provider): change AccountProviderService …
printminion-co Dec 30, 2025
f32622b
IONOS(ionos-mail): refactor(controller): enhance account creation res…
printminion-co Dec 30, 2025
96f8963
IONOS(ionos-mail): feat(frontend): add app password reset UI for prov…
printminion-co Dec 30, 2025
180468f
IONOS(i18n): manually add translation strings
bromiesTM Jan 8, 2026
503f0ce
IONOS(style): adjust external provider selector width
bromiesTM Jan 8, 2026
9682525
IONOS(ionos-mail): refactor: improve path construction in IonosConfig…
printminion-co Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ Learn more about the Nextcloud Ethical AI Rating [in our blog](https://nextcloud
<command>OCA\Mail\Command\ExportAccount</command>
<command>OCA\Mail\Command\ExportAccountThreads</command>
<command>OCA\Mail\Command\PredictImportance</command>
<command>OCA\Mail\Command\ProviderCreateAccount</command>
<command>OCA\Mail\Command\ProviderGenerateAppPassword</command>
<command>OCA\Mail\Command\ProviderList</command>
<command>OCA\Mail\Command\ProviderStatus</command>
<command>OCA\Mail\Command\SyncAccount</command>
<command>OCA\Mail\Command\Thread</command>
<command>OCA\Mail\Command\TrainAccount</command>
Expand Down
14 changes: 12 additions & 2 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,18 @@
'verb' => 'POST'
],
[
'name' => 'ionosAccounts#create',
'url' => '/api/ionos/accounts',
'name' => 'externalAccounts#getProviders',
'url' => '/api/providers',
'verb' => 'GET'
],
[
'name' => 'externalAccounts#create',
'url' => '/api/providers/{providerId}/accounts',
'verb' => 'POST'
],
[
'name' => 'externalAccounts#generatePassword',
'url' => '/api/providers/{providerId}/password',
'verb' => 'POST'
],
[
Expand Down
246 changes: 246 additions & 0 deletions doc/provider-commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
# Provider OCC Commands

This document describes the new OCC commands for managing external mail account providers (e.g., IONOS Mail).

## Available Commands

### 1. `mail:provider:list`

List all registered mail account providers and their capabilities.

**Usage:**
```bash
php occ mail:provider:list
```

**Example Output:**
```
Registered Mail Account Providers:

+--------+------------+---------+-------------------+--------------+----------------+--------------+
| ID | Name | Enabled | Multiple Accounts | App Passwords| Password Reset | Email Domain |
+--------+------------+---------+-------------------+--------------+----------------+--------------+
| ionos | IONOS Mail | Yes | No | Yes | Yes | example.com |
+--------+------------+---------+-------------------+--------------+----------------+--------------+

IONOS Mail (ionos):
Configuration Parameters:
- ionos_mailconfig_api_base_url (string, required): Base URL for the IONOS Mail Configuration API
- ionos_mailconfig_api_auth_user (string, required): Basic auth username for IONOS API
- ionos_mailconfig_api_auth_pass (string, required): Basic auth password for IONOS API
- ionos_mailconfig_api_allow_insecure (boolean): Allow insecure connections (for development)
- ncw.ext_ref (string, required): External reference ID (system config)
- ncw.customerDomain (string, required): Customer domain for email addresses (system config)
Account Creation Parameters:
- accountName (string, required): Name
- emailUser (string, required): User
```

---

### 2. `mail:provider:status`

Check the status and availability of a mail account provider.

**Usage:**
```bash
php occ mail:provider:status <provider-id> [<user-id>] [--verbose|-v]
```

**Arguments:**
- `provider-id` (required): Provider ID (e.g., "ionos")
- `user-id` (optional): User ID to check provider availability for specific user

**Options:**
- `-v, --verbose`: Show detailed information including capabilities

**Examples:**

Check provider status:
```bash
php occ mail:provider:status ionos
```

Check if provider is available for a specific user:
```bash
php occ mail:provider:status ionos alice
```

With verbose output:
```bash
php occ mail:provider:status ionos alice -v
```

**Example Output:**
```
Provider: IONOS Mail (ionos)

Enabled: Yes

User: alice
Available for User: Yes
```

---

### 3. `mail:provider:create-account`

Create a mail account via an external provider.

**Usage:**
```bash
php occ mail:provider:create-account <provider-id> <user-id> -p <key>=<value> ...
```

**Arguments:**
- `provider-id` (required): Provider ID (e.g., "ionos")
- `user-id` (required): User ID to create the account for

**Options:**
- `-p, --param`: Parameters in key=value format (can be used multiple times)

**Example:**
```bash
php occ mail:provider:create-account ionos alice \
-p emailUser=alice \
-p accountName="Alice Smith"
```

**Example Output:**
```
Creating account for user "alice" via provider "ionos"...

Account created successfully!

Account ID: 42
Email: alice@example.com
Name: Alice Smith
IMAP Host: imap.example.com:993
SMTP Host: smtp.example.com:587
```

---

### 4. `mail:provider:generate-app-password`

Generate a new app password for a provider-managed mail account.

**Usage:**
```bash
php occ mail:provider:generate-app-password <provider-id> <user-id>
```

**Arguments:**
- `provider-id` (required): Provider ID (e.g., "ionos")
- `user-id` (required): User ID to generate app password for

**Example:**
```bash
php occ mail:provider:generate-app-password ionos alice
```

**Example Output:**
```
Generating app password for user "alice" (email: alice@example.com)...

App password generated successfully!

New App Password: AbCd1234EfGh5678IjKl

IMPORTANT: This password will only be shown once. Make sure to save it securely.
The mail account in Nextcloud has been automatically updated with the new password.
```

---

## Common Workflows

### Initial Setup

1. **List available providers:**
```bash
php occ mail:provider:list
```

2. **Check provider configuration:**
```bash
php occ mail:provider:status ionos -v
```

### Account Management

1. **Create a new account:**
```bash
php occ mail:provider:create-account ionos alice \
-p emailUser=alice \
-p accountName="Alice Smith"
```

2. **Reset password (generate app password):**
```bash
php occ mail:provider:generate-app-password ionos alice
```

### Troubleshooting

1. **Check if provider is available for user:**
```bash
php occ mail:provider:status ionos alice
```

2. **Verify provider configuration:**
```bash
php occ mail:provider:list
```

---

## Error Handling

The commands provide clear error messages:

- **Provider not found:** Lists available providers
- **User does not exist:** Validates user existence
- **Provider not enabled:** Suggests checking configuration
- **Provider not available for user:** Explains why (e.g., account already exists)
- **Missing required parameters:** Shows what parameters are needed with descriptions

---

## Testing

All commands include comprehensive unit tests:
- `tests/Unit/Command/ProviderListTest.php`
- `tests/Unit/Command/ProviderStatusTest.php`
- `tests/Unit/Command/ProviderCreateAccountTest.php`
- `tests/Unit/Command/ProviderGenerateAppPasswordTest.php`

Run tests:
```bash
vendor/bin/phpunit -c tests/phpunit.unit.xml tests/Unit/Command/Provider*
```

---

## Implementation Details

### Architecture

All provider commands follow the same pattern:
1. Validate inputs (provider ID, user ID, parameters)
2. Check provider status and availability
3. Execute the operation via `ProviderRegistryService`
4. Provide detailed feedback to the user

### Dependencies

Commands use:
- `ProviderRegistryService`: Access to registered providers
- `IUserManager`: User validation
- Symfony Console components for CLI interaction

### Code Location

- Commands: `lib/Command/Provider*.php`
- Tests: `tests/Unit/Command/Provider*Test.php`
- Registration: `appinfo/info.xml`
7 changes: 6 additions & 1 deletion l10n/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,11 @@ OC.L10N.register(
"Manage S/MIME certificates" : "S/MIME Zertifikate verwalten",
"Mailvelope is a browser extension that enables easy OpenPGP encryption and decryption for emails." : "Mailvelope ist eine Browsererweiterung, die eine einfache OpenPGP-Ver- und -Entschlüsselung für E-Mails ermöglicht.",
"Step 1: Install Mailvelope browser extension" : "Schritt 1: Mailvelope-Browsererweiterung installieren",
"Step 2: Enable Mailvelope for the current domain" : "Schritt 2: Mailvelope für die aktuelle Domäne aktivieren"
"Step 2: Enable Mailvelope for the current domain" : "Schritt 2: Mailvelope für die aktuelle Domäne aktivieren",
"To access your mailbox via IMAP, you can generate an app-specific password. This password allows IMAP clients to connect to your account." : "Um über IMAP auf dein Postfach zuzugreifen, kannst du ein app-spezifisches Passwort generieren. Mit diesem Passwort können sich IMAP-Clients mit deinem Konto verbinden.",
"IMAP access / password" : "IMAP-Zugang/Passwort",
"Generate password" : "Passwort generieren",
"Copy password" : "Passwort kopieren",
"Please save this password now. For security reasons, it will not be shown again." : "Bitte speichere dieses Passwort jetzt. Aus Sicherheitsgründen wird es nicht erneut angezeigt."
},
"nplurals=2; plural=(n != 1);");
9 changes: 7 additions & 2 deletions l10n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,11 @@
"Manage S/MIME certificates" : "S/MIME Zertifikate verwalten",
"Mailvelope is a browser extension that enables easy OpenPGP encryption and decryption for emails." : "Mailvelope ist eine Browsererweiterung, die eine einfache OpenPGP-Ver- und -Entschlüsselung für E-Mails ermöglicht.",
"Step 1: Install Mailvelope browser extension" : "Schritt 1: Mailvelope-Browsererweiterung installieren",
"Step 2: Enable Mailvelope for the current domain" : "Schritt 2: Mailvelope für die aktuelle Domäne aktivieren"
"Step 2: Enable Mailvelope for the current domain" : "Schritt 2: Mailvelope für die aktuelle Domäne aktivieren",
"To access your mailbox via IMAP, you can generate an app-specific password. This password allows IMAP clients to connect to your account." : "Um über IMAP auf dein Postfach zuzugreifen, kannst du ein app-spezifisches Passwort generieren. Mit diesem Passwort können sich IMAP-Clients mit deinem Konto verbinden.",
"IMAP access / password" : "IMAP-Zugang/Passwort",
"Generate password" : "Passwort generieren",
"Copy password" : "Passwort kopieren",
"Please save this password now. For security reasons, it will not be shown again." : "Bitte speichere dieses Passwort jetzt. Aus Sicherheitsgründen wird es nicht erneut angezeigt."
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
}
7 changes: 6 additions & 1 deletion l10n/de_DE.js
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,11 @@ OC.L10N.register(
"Manage S/MIME certificates" : "S/MIME-Zertifikate verwalten",
"Mailvelope is a browser extension that enables easy OpenPGP encryption and decryption for emails." : "Mailvelope ist eine Browsererweiterung, die eine einfache OpenPGP-Ver- und -Entschlüsselung für E-Mails ermöglicht.",
"Step 1: Install Mailvelope browser extension" : "Schritt 1: Mailvelope-Browsererweiterung installieren",
"Step 2: Enable Mailvelope for the current domain" : "Schritt 2: Mailvelope für die aktuelle Domäne aktivieren"
"Step 2: Enable Mailvelope for the current domain" : "Schritt 2: Mailvelope für die aktuelle Domäne aktivieren",
"To access your mailbox via IMAP, you can generate an app-specific password. This password allows IMAP clients to connect to your account." : "Um über IMAP auf Ihr Postfach zuzugreifen, können Sie ein app-spezifisches Passwort generieren. Mit diesem Passwort können sich IMAP-Clients mit Ihrem Konto verbinden.",
"IMAP access / password" : "IMAP-Zugang/Passwort",
"Generate password" : "Passwort generieren",
"Copy password" : "Passwort kopieren",
"Please save this password now. For security reasons, it will not be shown again." : "Bitte speichern Sie dieses Passwort jetzt. Aus Sicherheitsgründen wird es nicht erneut angezeigt.",
},
"nplurals=2; plural=(n != 1);");
9 changes: 7 additions & 2 deletions l10n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,11 @@
"Manage S/MIME certificates" : "S/MIME-Zertifikate verwalten",
"Mailvelope is a browser extension that enables easy OpenPGP encryption and decryption for emails." : "Mailvelope ist eine Browsererweiterung, die eine einfache OpenPGP-Ver- und -Entschlüsselung für E-Mails ermöglicht.",
"Step 1: Install Mailvelope browser extension" : "Schritt 1: Mailvelope-Browsererweiterung installieren",
"Step 2: Enable Mailvelope for the current domain" : "Schritt 2: Mailvelope für die aktuelle Domäne aktivieren"
"Step 2: Enable Mailvelope for the current domain" : "Schritt 2: Mailvelope für die aktuelle Domäne aktivieren",
"To access your mailbox via IMAP, you can generate an app-specific password. This password allows IMAP clients to connect to your account." : "Um über IMAP auf Ihr Postfach zuzugreifen, können Sie ein app-spezifisches Passwort generieren. Mit diesem Passwort können sich IMAP-Clients mit Ihrem Konto verbinden.",
"IMAP access / password" : "IMAP-Zugang/Passwort",
"Generate password" : "Passwort generieren",
"Copy password" : "Passwort kopieren",
"Please save this password now. For security reasons, it will not be shown again." : "Bitte speichern Sie dieses Passwort jetzt. Aus Sicherheitsgründen wird es nicht erneut angezeigt.",
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
}
7 changes: 6 additions & 1 deletion l10n/en_GB.js
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,11 @@ OC.L10N.register(
"Manage S/MIME certificates" : "Manage S/MIME certificates",
"Mailvelope is a browser extension that enables easy OpenPGP encryption and decryption for emails." : "Mailvelope is a browser extension that enables easy OpenPGP encryption and decryption for emails.",
"Step 1: Install Mailvelope browser extension" : "Step 1: Install Mailvelope browser extension",
"Step 2: Enable Mailvelope for the current domain" : "Step 2: Enable Mailvelope for the current domain"
"Step 2: Enable Mailvelope for the current domain" : "Step 2: Enable Mailvelope for the current domain",
"To access your mailbox via IMAP, you can generate an app-specific password. This password allows IMAP clients to connect to your account." : "To access your mailbox via IMAP, you can generate an app-specific password. This password allows IMAP clients to connect to your account.",
"IMAP access / password" : "IMAP access / password",
"Generate password" : "Generate password",
"Copy password" : "Copy password",
"Please save this password now. For security reasons, it will not be shown again." : "Please save this password now. For security reasons, it will not be shown again."
},
"nplurals=2; plural=(n != 1);");
9 changes: 7 additions & 2 deletions l10n/en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,11 @@
"Manage S/MIME certificates" : "Manage S/MIME certificates",
"Mailvelope is a browser extension that enables easy OpenPGP encryption and decryption for emails." : "Mailvelope is a browser extension that enables easy OpenPGP encryption and decryption for emails.",
"Step 1: Install Mailvelope browser extension" : "Step 1: Install Mailvelope browser extension",
"Step 2: Enable Mailvelope for the current domain" : "Step 2: Enable Mailvelope for the current domain"
"Step 2: Enable Mailvelope for the current domain" : "Step 2: Enable Mailvelope for the current domain",
"To access your mailbox via IMAP, you can generate an app-specific password. This password allows IMAP clients to connect to your account." : "To access your mailbox via IMAP, you can generate an app-specific password. This password allows IMAP clients to connect to your account."
"IMAP access / password" : "IMAP access / password",
"Generate password" : "Generate password",
"Copy password" : "Copy password",
"Please save this password now. For security reasons, it will not be shown again." : "Please save this password now. For security reasons, it will not be shown again."
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
}
7 changes: 6 additions & 1 deletion l10n/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,11 @@ OC.L10N.register(
"Manage S/MIME certificates" : "Administrar certificados S/MIME",
"Mailvelope is a browser extension that enables easy OpenPGP encryption and decryption for emails." : "Mailvelope es una extensión para el navegador que permite habilitar fácilmente cifrado y descifrado OpenPGP para los correos electrónicos.",
"Step 1: Install Mailvelope browser extension" : "Paso 1: Instale la extensión del navegador Mailvelope",
"Step 2: Enable Mailvelope for the current domain" : "Paso 2: Habilite Mailvelope para el dominio actual"
"Step 2: Enable Mailvelope for the current domain" : "Paso 2: Habilite Mailvelope para el dominio actual",
"To access your mailbox via IMAP, you can generate an app-specific password. This password allows IMAP clients to connect to your account." : "Para acceder a tu buzón de correo a través de IMAP, puedes generar una contraseña específica para la aplicación. Esta contraseña permite a los clientes IMAP conectarse a tu cuenta.",
"IMAP access / password" : "Acceso IMAP / contraseña",
"Generate password" : "Generar contraseña",
"Copy password" : "Copiar contraseña",
"Please save this password now. For security reasons, it will not be shown again." : "Guarde esta contraseña ahora. Por motivos de seguridad, no se volverá a mostrar.",
},
"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;");
11 changes: 8 additions & 3 deletions l10n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,11 @@
"Manage S/MIME certificates" : "Administrar certificados S/MIME",
"Mailvelope is a browser extension that enables easy OpenPGP encryption and decryption for emails." : "Mailvelope es una extensión para el navegador que permite habilitar fácilmente cifrado y descifrado OpenPGP para los correos electrónicos.",
"Step 1: Install Mailvelope browser extension" : "Paso 1: Instale la extensión del navegador Mailvelope",
"Step 2: Enable Mailvelope for the current domain" : "Paso 2: Habilite Mailvelope para el dominio actual"
},"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"
}
"Step 2: Enable Mailvelope for the current domain" : "Paso 2: Habilite Mailvelope para el dominio actual",
"To access your mailbox via IMAP, you can generate an app-specific password. This password allows IMAP clients to connect to your account." : "Para acceder a tu buzón de correo a través de IMAP, puedes generar una contraseña específica para la aplicación. Esta contraseña permite a los clientes IMAP conectarse a tu cuenta.",
"IMAP access / password" : "Acceso IMAP / contraseña",
"Generate password" : "Generar contraseña",
"Copy password" : "Copiar contraseña",
"Please save this password now. For security reasons, it will not be shown again." : "Guarde esta contraseña ahora. Por motivos de seguridad, no se volverá a mostrar.",
,"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"
}
Loading
Loading