{"id":28511168,"url":"https://github.com/zone-eu/zone-wildduck-php-client","last_synced_at":"2026-06-11T09:00:17.317Z","repository":{"id":38146872,"uuid":"191536026","full_name":"zone-eu/zone-wildduck-php-client","owner":"zone-eu","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-30T09:35:54.000Z","size":630,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-04-30T11:22:56.598Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zone-eu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-06-12T09:03:34.000Z","updated_at":"2026-04-30T09:35:26.000Z","dependencies_parsed_at":"2024-05-22T13:57:04.200Z","dependency_job_id":"ad5691fc-295b-4560-b985-ef61a0a131fd","html_url":"https://github.com/zone-eu/zone-wildduck-php-client","commit_stats":{"total_commits":191,"total_committers":7,"mean_commits":"27.285714285714285","dds":0.4397905759162304,"last_synced_commit":"7eba5cb159264341c3d1101f0c9c83d2e7d920e9"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/zone-eu/zone-wildduck-php-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zone-eu%2Fzone-wildduck-php-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zone-eu%2Fzone-wildduck-php-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zone-eu%2Fzone-wildduck-php-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zone-eu%2Fzone-wildduck-php-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zone-eu","download_url":"https://codeload.github.com/zone-eu/zone-wildduck-php-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zone-eu%2Fzone-wildduck-php-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34190585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-08T23:37:36.941Z","updated_at":"2026-06-11T09:00:17.266Z","avatar_url":"https://github.com/zone-eu.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wildduck API PHP Client\n\nA modern PHP client for the [Wildduck email server](https://github.com/nodemailer/wildduck) API with full type safety and DTO support.\n\n[![PHP Version](https://img.shields.io/badge/PHP-8.3%2B-blue)](https://php.net)\n[![License](https://img.shields.io/badge/License-EUPL--1.2-green)](LICENSE)\n\n## Features\n\n- 🔒 **Type-Safe**: Full PHP 8.3+ type hints with strict types\n- 📦 **DTOs**: Request and response Data Transfer Objects for IDE autocomplete\n- 🎯 **Modern PHP**: Readonly properties, named parameters, union types\n- 🔄 **EventSource**: Real-time updates via server-sent events\n- 📚 **Comprehensive**: All 17 WildDuck API services covered\n\n## Requirements\n\n* PHP 8.3 or newer\n* Composer\n\n## Installation\n\n```bash\ncomposer require zone-eu/wildduck-php-client\n```\n\n## Quick Start\n\n```php\nuse Zone\\Wildduck\\WildduckClient;\nuse Zone\\Wildduck\\Dto\\User\\CreateUserDto;\n\n// Initialize client\n$client = new WildduckClient([\n    'accessToken' =\u003e 'your-api-token',\n    'apiUrl' =\u003e 'https://api.wildduck.email',\n]);\n\n// Create a user\n$createDto = new CreateUserDto(\n    username: 'john.doe',\n    password: 'SecurePass123!',\n    address: 'john.doe@example.com',\n    name: 'John Doe'\n);\n\n$result = $client-\u003eusers()-\u003ecreate($createDto);\necho \"User created with ID: {$result-\u003eid}\\n\";\n\n// Get user details\n$user = $client-\u003eusers()-\u003eget($result-\u003eid);\necho \"Username: {$user-\u003eusername}\\n\";\necho \"Email: {$user-\u003eaddress}\\n\";\n\n// Update user\n$updateDto = new UpdateUserDto(\n    name: 'John Updated Doe'\n);\n$client-\u003eusers()-\u003eupdate($result-\u003eid, $updateDto);\n\n// Delete user\n$client-\u003eusers()-\u003edelete($result-\u003eid);\n```\n\n## Available Services\n\nAll services are accessed via the `WildduckClient` instance:\n\n- `$client-\u003eusers()` - User management\n- `$client-\u003eaddresses()` - Email address management\n- `$client-\u003emailboxes()` - Mailbox operations\n- `$client-\u003emessages()` - Message handling\n- `$client-\u003efilters()` - Email filters\n- `$client-\u003eautoreply()` - Auto-reply settings\n- `$client-\u003eapplicationPasswords()` - App-specific passwords\n- `$client-\u003eauthentication()` - Authentication endpoints\n- `$client-\u003etwoFactorAuthentication()` - 2FA management\n- `$client-\u003earchive()` - Message archiving\n- `$client-\u003eaudit()` - Audit logs\n- `$client-\u003edkim()` - DKIM key management\n- `$client-\u003edomainAliases()` - Domain alias operations\n- `$client-\u003eevents()` - Event streaming\n- `$client-\u003estorage()` - File storage\n- `$client-\u003esubmission()` - Message submission\n- `$client-\u003ewebhooks()` - Webhook management\n\nSee [MIGRATION.md](MIGRATION.md) for complete migration guide from v1.x.\n\n## Examples\n\n### Managing Messages\n\n```php\nuse Zone\\Wildduck\\Dto\\Message\\UploadMessageDto;\n\n// Upload a message\n$uploadDto = new UploadMessageDto(\n    raw: base64_encode($emailSource),\n    mailbox: $mailboxId\n);\n\n$result = $client-\u003emessages()-\u003eupload($userId, $mailboxId, $uploadDto);\n\n// Search messages\n$messages = $client-\u003emessages()-\u003esearch($userId, [\n    'q' =\u003e 'from:sender@example.com',\n    'limit' =\u003e 10\n]);\n\nforeach ($messages-\u003eresults as $message) {\n    echo \"Subject: {$message-\u003esubject}\\n\";\n}\n```\n\n### Working with Filters\n\n```php\nuse Zone\\Wildduck\\Dto\\Filter\\CreateFilterDto;\nuse Zone\\Wildduck\\Dto\\Shared\\FilterQueryDto;\nuse Zone\\Wildduck\\Dto\\Shared\\FilterActionDto;\n\n$createDto = new CreateFilterDto(\n    name: 'Spam Filter',\n    query: new FilterQueryDto(from: 'spam@example.com'),\n    action: new FilterActionDto(delete: true)\n);\n\n$client-\u003efilters()-\u003ecreate($userId, $createDto);\n```\n\n### Event Streaming\n\n```php\n// Stream user mailbox updates\n$response = $client-\u003eevents()-\u003eforUser($userId);\n// Returns StreamedResponse that can be processed with EventSource\n```\n\n## Testing\n\nThe library includes comprehensive structure tests. See [TESTING.md](TESTING.md) for:\n- Running tests\n- Writing integration tests\n- Test coverage information\n\n```bash\n# Run structure tests\nvendor/bin/phpunit tests/Unit/Service/ServiceStructureTest.php\n```\n\n## Configuration\n\n### Environment Variables\n\n- `WDPC_REQUEST_LOGGING` (true/false) - Enable request logging\n- `WDPC_REQUEST_LOGGING_FOLDER_PERMISSIONS` (0755) - Log folder permissions\n- `WDPC_REQUEST_LOGGING_PATTERN` - RegEx for requests to log\n- `WDPC_REQUEST_LOGGING_DIRECTORY` - Base directory for logs\n\n### Client Options\n\n```php\n$client = new WildduckClient([\n    'accessToken' =\u003e 'your-token',       // Required\n    'apiUrl' =\u003e 'https://api.example.com', // Optional\n    'apiVersion' =\u003e 'v1',                 // Optional\n    'httpClient' =\u003e $customClient,        // Optional custom HTTP client\n]);\n```\n\n## Architecture\n\n### DTOs (Data Transfer Objects)\n\nAll requests and responses use strongly-typed DTOs:\n\n```php\n// Request DTOs\nuse Zone\\Wildduck\\Dto\\User\\CreateUserDto;\nuse Zone\\Wildduck\\Dto\\User\\UpdateUserDto;\n\n// Response DTOs\nuse Zone\\Wildduck\\Dto\\User\\UserDto;\nuse Zone\\Wildduck\\Dto\\User\\UserInfoDto;\nuse Zone\\Wildduck\\Dto\\PaginatedResultDto;\n```\n\nDTOs provide:\n- ✅ IDE autocomplete\n- ✅ Type safety at compile time\n- ✅ Clear API contracts\n- ✅ Validation support\n\n### Service Layer\n\nServices extend `AbstractService` and provide typed methods:\n\n```php\nclass UserService extends AbstractService\n{\n    public function create(CreateUserDto|null $params = null): UserInfoDto\n    {\n        return $this-\u003erequestDto('post', '/users', $params, UserInfoDto::class);\n    }\n\n    public function get(string $id): UserDto\n    {\n        return $this-\u003erequestDto('get', \"/users/{$id}\", null, UserDto::class);\n    }\n}\n```\n\n## Upgrading from v1.x\n\nSee [MIGRATION.md](MIGRATION.md) for detailed upgrade instructions. Key changes:\n\n1. **DTOs instead of arrays**: All requests now use DTOs\n2. **Service access**: `$client-\u003eusers()` instead of `$client-\u003eusers`\n3. **Return types**: Typed DTOs instead of generic arrays\n4. **PHP 8.3+**: Modern PHP features throughout\n\n## Contributing\n\nContributions are welcome! Please see our contributing guidelines:\n\n1. Fork the repository\n2. Create a feature branch\n3. Add tests for new features\n4. Ensure all tests pass\n5. Submit a pull request\n\n## License\n\n[EUPL-1.2](LICENSE) - European Union Public License\n\n## Resources\n\n- [WildDuck API Documentation](https://docs.wildduck.email/api/)\n- [Migration Guide](MIGRATION.md)\n- [Testing Guide](TESTING.md)\n- [Changelog](CHANGELOG.md)\n\n## Credits\n\nHeavily inspired by [stripe/stripe-php](https://github.com/stripe/stripe-php).\n\nMade with ❤️ by [Zone Media OÜ](https://github.com/zone-eu)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzone-eu%2Fzone-wildduck-php-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzone-eu%2Fzone-wildduck-php-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzone-eu%2Fzone-wildduck-php-client/lists"}