feat: implement global autoresponder plugin

This commit is contained in:
Marek Miklewicz
2026-06-02 19:19:00 +02:00
commit 6f989af278
62 changed files with 2018 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
require_once PLUGIN_ROOT . '/exec/lib/MailboxDirectory.php';
test('mailbox directory returns only pop imap mailboxes owned by user', function (): void {
$root = TEST_TMP . '/etc_virtual';
test_write($root . '/domainowners', "example.com: alice\nother.com: bob\n");
test_write($root . '/example.com/passwd', "info:x:1000:12::/home/alice/imap/example.com/info:/bin/false\nsales:x:1000:12::/home/alice/imap/example.com/sales:/bin/false\n");
test_write($root . '/example.com/aliases', "alias: info\n");
test_write($root . '/other.com/passwd', "info:x:1001:12::/home/bob/imap/other.com/info:/bin/false\n");
$dir = new MailboxDirectory($root);
$mailboxes = $dir->mailboxesForUser('alice');
assert_same(['info@example.com', 'sales@example.com'], array_column($mailboxes, 'email'));
});