Improvements to working out region for new addresses, Bounce netmails to a invalid address (that we would host)
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 40s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m36s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
2025-01-07 14:55:57 +11:00
parent 058b4ac4b9
commit 2c1ab88bbd
8 changed files with 107 additions and 16 deletions

View File

@@ -189,7 +189,7 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
$msgbuf = substr($msgbuf,$end+3);
continue;
// If we have more to read
// If we have more to read
} elseif ($read_ptr < $size) {
continue;
}
@@ -430,10 +430,27 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
// If the $msg->tftn doesnt exist, we'll need to create it
if ($msg->errors->has('to') && $this->tftn && $this->tftn->zone_id) {
Log::debug(sprintf('%s:^ To address [%s] doesnt exist, it needs to be created',self::LOGKEY,$msg->set->get('set_tftn')));
$ao = Address::findFTN($msg->set->get('set_tftn'),TRUE,TRUE);
// If this is a netmail message, to a non existant address, we need to bounce it
if (($msg instanceof Netmail)) {
if ((! $ao) && our_address()->contains(Address::newFTN($msg->set_tftn)?->parent())) {
Log::alert(sprintf('%s:^ To address [%s] doesnt exist, netmail will be bounced',self::LOGKEY,$msg->set->get('set_tftn')));
$this->messages->push($msg);
return;
// If this is a netmail message, to a non existant address, we need to bounce it
} elseif ($ao && (! $ao->active) && our_address()->contains($ao->parent())) {
Log::alert(sprintf('%s:^ To address [%s] isnt active, netmail will be bounced',self::LOGKEY,$msg->set->get('set_tftn')));
$this->messages->push($msg);
return;
}
}
Log::debug(sprintf('%s:^ To address [%s] doesnt exist, it needs to be created',self::LOGKEY,$msg->set->get('set_tftn')));
if ($ao?->exists && ($ao->zone?->domain_id !== $this->tftn->zone->domain_id)) {
Log::alert(sprintf('%s:! To address [%s] domain [%d] doesnt match packet domain [%d]?',self::LOGKEY,$msg->set->get('set_tftn'),$ao->zone?->domain_id,$this->fftn->zone->domain_id));
@@ -442,7 +459,7 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
if (! $ao) {
$so = System::createUnknownSystem();
$ao = Address::createFTN($msg->set->get('set_fftn'),$so);
$ao = Address::createFTN($msg->set->get('set_tftn'),$so);
Log::alert(sprintf('%s:- To FTN [%s] is not defined, created new entry for (%d)',self::LOGKEY,$msg->set->get('set_tftn'),$ao->id));
}