mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-16 05:10:15 +00:00
[Web] Add archive module classes
This commit is contained in:
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));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user