Correctly storing netmail flags (intransit, local, recv) with senders ID and packet name

This commit is contained in:
2023-07-15 10:46:19 +10:00
parent 7bf957df3a
commit 61ab0614b6
7 changed files with 187 additions and 36 deletions

View File

@@ -19,7 +19,7 @@ class PacketProcess extends Command
protected $signature = 'packet:process'
.' {file : Packet to process}'
.' {--N|nobot : Dont process bots}'
.' {ftn? : System the packet is from}';
.' {ftn : System the packet is from}';
/**
* The console command description.
@@ -37,18 +37,18 @@ class PacketProcess extends Command
public function handle()
{
$f = new File($this->argument('file'));
$s = $this->argument('ftn') ? Address::findFTN($this->argument('ftn'))->system : NULL;
$a = Address::findFTN($this->argument('ftn'));
foreach ($f as $packet) {
foreach (Packet::process($packet,$f->itemName(),$f->itemSize(),$s) as $msg) {
foreach (Packet::process($packet,$f->itemName(),$f->itemSize(),$a->system) as $msg) {
// @todo Quick check that the packet should be processed by us.
// @todo validate that the packet's zone is in the domain.
$this->info(sprintf('Processing message from [%s] with msgid [%s] in (%s)',$msg->fboss,$msg->msgid,$f->pktName()));
// Dispatch job.
Job::dispatchSync($msg,$f->pktName(),$this->option('nobot'));
Job::dispatchSync($msg,$f->pktName(),$a,$this->option('nobot'));
}
}
}
}
}