From 21236b68715c4edfd4eb2af92a98ebc9614c1977 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 4 Dec 2022 13:32:46 +1100 Subject: [PATCH] Command to list number of mail waiting for a system --- app/Console/Commands/PacketSystem.php | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 app/Console/Commands/PacketSystem.php diff --git a/app/Console/Commands/PacketSystem.php b/app/Console/Commands/PacketSystem.php new file mode 100644 index 0000000..1878164 --- /dev/null +++ b/app/Console/Commands/PacketSystem.php @@ -0,0 +1,46 @@ +argument('sid')); + + foreach ($so->addresses as $ao) { + $pkt = $ao->getEchomail(FALSE); + $this->info(sprintf('System address [%s] has [%d] messages.',$ao->ftn,$pkt?->count())); + + if ($pkt) { + foreach ($pkt as $msg) + $this->warn(sprintf('- %s',$msg->msgid)); + } + } + } +} \ No newline at end of file