[Web] Add archive module classes

This commit is contained in:
FreddleSpl0it committed 2026-11-07 00:15:08 +01:00
1 parent 329bca1d46
commit 2ac2edf0ad
17 files changed
+1685

No files matched your search

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace Mailcow\Archive\Legacy;
/**
* Bridge to the legacy mailq() (Postfix queue through dockerapi) until it is converted.
*/
class LegacyQueue
{
/**
* @return array[] queue entries of $sender: queue_id, queue_name, arrival_time, message_size,
* recipients ("address (delay reason)")
*/
public function entries(string $sender): array
{
if (!function_exists('mailq')) {
return [];
}
$list = json_decode((string)mailq('get'), true);
if (!is_array($list)) {
return [];
}
return array_values(array_filter($list, fn(mixed $entry): bool => is_array($entry) && ($entry['sender'] ?? '') === $sender));
}
}