feat: implement global autoresponder plugin
This commit is contained in:
@@ -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'));
|
||||
});
|
||||
Reference in New Issue
Block a user