cyberfusion / proxmox-mail-gateway
Library for Proxmox Mail Gateway.
2.0
2023-09-15 12:53 UTC
Requires
- php: >=8.1
- ext-json: *
- lib-curl: *
- guzzlehttp/guzzle: ^7.0
- illuminate/support: ^9.0|^10.0
- laravel/pint: ^1.7
Requires (Dev)
- mockery/mockery: ^1.4
- phpstan/phpstan: ^1.2
- phpunit/phpunit: ^10.0
README
Library for Proxmox Mail Gateway.
Proxmox Mail Gateway API documentation: https://pmg.proxmox.com/pmg-docs/api-viewer/index.html
Install
Composer
Run the following command to install the package from Packagist:
composer require cyberfusion/proxmox-mail-gateway
Usage
Example
use Cyberfusion\ProxmoxMGW\Client; use Cyberfusion\ProxmoxMGW\Endpoints\Config\DkimEndpoint; use Cyberfusion\ProxmoxMGW\Exceptions\AuthenticationException; use Cyberfusion\ProxmoxMGW\Models\DkimDomainData; use Cyberfusion\ProxmoxMGW\Requests\DkimGetRequest; try { $client = new Client('pmgtest.cyberfusion.nl'); $client->authenticate('apiuser', 'Super secret password.'); } catch (AuthenticationException $e) { // Handle authentication error } $dkimEndpoint = new DkimEndpoint($client); $result = $dkimEndpoint->get(new DkimGetRequest('example.com')); if ($result->failed()) { // Handle error } /** @var DkimDomainData $dkim */ $dkim = $result->getData('dkim'); // $dkim->domain -> example.com