|
1 | | -# Abuse handling plugin for MyAdmin |
| 1 | +# MyAdmin Abuse Plugin |
2 | 2 |
|
3 | | -Abuse handling plugin for MyAdmin |
| 3 | +[](https://github.com/detain/myadmin-abuse-plugin/actions/workflows/tests.yml) |
| 4 | +[](https://packagist.org/packages/detain/myadmin-abuse-plugin) |
| 5 | +[](https://packagist.org/packages/detain/myadmin-abuse-plugin) |
| 6 | +[](https://packagist.org/packages/detain/myadmin-abuse-plugin) |
4 | 7 |
|
5 | | -## Build Status and Code Analysis |
| 8 | +Abuse handling plugin for the [MyAdmin](https://github.com/detain/myadmin) control panel. This plugin monitors IMAP mailboxes for incoming abuse complaints (spam reports, blacklist notifications, phishing alerts), matches the offending IP addresses to customer services, and automatically notifies the responsible account holders. |
6 | 9 |
|
7 | | -Site | Status |
8 | | ---------------|--------------------------- |
9 | | - | [](https://travis-ci.org/detain/myadmin-abuse-plugin) |
10 | | - | [](https://codeclimate.com/github/detain/myadmin-abuse-plugin) [](https://codeclimate.com/github/detain/myadmin-abuse-plugin/coverage) [](https://codeclimate.com/github/detain/myadmin-abuse-plugin) |
11 | | - | [](https://scrutinizer-ci.com/g/myadmin-plugins/abuse-plugin/?branch=master) [](https://scrutinizer-ci.com/g/myadmin-plugins/abuse-plugin/?branch=master) [](https://scrutinizer-ci.com/g/myadmin-plugins/abuse-plugin/build-status/master) |
12 | | - | [](https://www.codacy.com/app/detain/myadmin-abuse-plugin) [](https://www.codacy.com/app/detain/myadmin-abuse-plugin?utm_source=github.com&utm_medium=referral&utm_content=detain/myadmin-abuse-plugin&utm_campaign=Badge_Coverage) |
13 | | - | [](https://coveralls.io/github/detain/myadmin-abuse-plugin?branch=master) |
14 | | - | [](https://packagist.org/packages/detain/myadmin-abuse-plugin) [](https://packagist.org/packages/detain/myadmin-abuse-plugin) [](//packagist.org/packages/detain/myadmin-abuse-plugin) [](https://packagist.org/packages/detain/myadmin-abuse-plugin) [](https://packagist.org/packages/detain/myadmin-abuse-plugin) [](https://packagist.org/packages/detain/myadmin-abuse-plugin) |
| 10 | +## Features |
15 | 11 |
|
| 12 | +- **IMAP Abuse Monitoring** -- Connects to configurable IMAP mailboxes and parses abuse complaint emails using regex pattern matching to extract offending IP addresses. |
| 13 | +- **IP-to-Customer Resolution** -- Looks up IP addresses against the server inventory and client IP pools to identify the responsible customer. |
| 14 | +- **MailBaby Integration** -- Detects outbound mail abuse through ZoneMTA / MailBaby user matching and message ID correlation. |
| 15 | +- **Admin Dashboard** -- Provides an admin interface for manually reporting abuse, importing UCEProtect CSV data, and importing Trend Micro blocklist entries. |
| 16 | +- **Client Self-Service** -- Allows customers to view and respond to abuse complaints via authenticated or token-based URLs. |
| 17 | +- **Automated Notifications** -- Sends templated email notifications to affected customers with complaint details and response links. |
16 | 18 |
|
17 | 19 | ## Installation |
18 | 20 |
|
19 | | -Install with composer like |
| 21 | +Install with Composer: |
20 | 22 |
|
21 | 23 | ```sh |
22 | 24 | composer require detain/myadmin-abuse-plugin |
23 | 25 | ``` |
24 | 26 |
|
25 | | -## License |
| 27 | +The plugin registers itself with the MyAdmin event dispatcher and adds: |
| 28 | + |
| 29 | +- `system.settings` -- IMAP credential configuration fields |
| 30 | +- `ui.menu` -- Admin menu entry for the abuse dashboard |
| 31 | +- `function.requirements` -- Page and class autoload registrations |
| 32 | + |
| 33 | +## Usage |
| 34 | + |
| 35 | +### Plugin Registration |
| 36 | + |
| 37 | +The plugin hooks are registered automatically when loaded by the MyAdmin plugin system: |
| 38 | + |
| 39 | +```php |
| 40 | +$hooks = \Detain\MyAdminAbuse\Plugin::getHooks(); |
| 41 | +// Returns: ['system.settings' => ..., 'ui.menu' => ..., 'function.requirements' => ...] |
| 42 | +``` |
| 43 | + |
| 44 | +### IMAP Abuse Checker |
| 45 | + |
| 46 | +The `ImapAbuseCheck` class processes abuse mailboxes from cron: |
| 47 | + |
| 48 | +```php |
| 49 | +$abuse = new ImapAbuseCheck($imapServer, $username, $password, $db); |
| 50 | +$abuse->register_preg_match('/pattern with %IP%/', 'headers', 'ip'); |
| 51 | +$abuse->process('spam', 100); |
| 52 | +``` |
| 53 | + |
| 54 | +### Admin Interface |
26 | 55 |
|
27 | | -The Abuse handling plugin for MyAdmin class is licensed under the LGPL-v2.1 license. |
| 56 | +Navigate to the abuse admin page in MyAdmin to: |
| 57 | + |
| 58 | +- View abuse statistics (24-hour, 3-day, 7-day breakdowns) |
| 59 | +- Submit individual abuse reports by IP |
| 60 | +- Bulk-report multiple IPs |
| 61 | +- Import UCEProtect CSV files |
| 62 | +- Import Trend Micro blocklist data |
| 63 | + |
| 64 | +## Running Tests |
| 65 | + |
| 66 | +```sh |
| 67 | +composer install |
| 68 | +vendor/bin/phpunit |
| 69 | +``` |
| 70 | + |
| 71 | +To generate a coverage report: |
| 72 | + |
| 73 | +```sh |
| 74 | +vendor/bin/phpunit --coverage-text |
| 75 | +``` |
| 76 | + |
| 77 | +## License |
28 | 78 |
|
| 79 | +This package is licensed under the [LGPL-2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) license. |
0 commit comments