ghanover / mailman-sync
Sync with mailman list
Requires
- php: ^8.2
- ext-json: *
- guzzlehttp/guzzle: ^7.8
- illuminate/filesystem: ^11.0
- illuminate/support: ^11.0
Requires (Dev)
- orchestra/testbench: ^9.0
- phpunit/phpunit: ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-28 17:33:03 UTC
README
Introduction
Basic subscribe/unsubscribe functionality to allow for keeping user lists in sync with a mailman list.
Requirements
- PHP 8.2 or newer (including PHP 8.4)
- Laravel 11
Installation
composer require ghanover/mailman-sync php artisan vendor:publish --tag=mailmansync-config
Laravel discovers the service provider and the MailmanGateway facade automatically. If discovery is disabled, register MailmanSync\SyncServiceProvider in bootstrap/providers.php and import MailmanSync\Facades\MailmanGateway where you call it.
Configuration
MAILMAN_ADMIN_URL=http://your.host:8001/3.1/
MAILMAN_LISTS="{\"examplelist.domain\":{\"user\":\"restadmin\",\"password\":\"securepassword\"}}"
Set MAILMAN_MOCK=true to store list membership in storage/app instead of calling Mailman. The mock does not simulate API failures.
Usage
MailmanGateway::subscribe('mylist', 'user@example.com');
The same gateway is available from the container as MailmanSync\MailmanGatewayInterface. When MAILMAN_MOCK is enabled, that binding is the file-backed mock.
A custom implementation of that interface must use the same typed signatures: string arguments, bool returns from subscribe, unsubscribe, and change, and an array return from roster.
Testing
composer test