Improvements to working out region for new addresses, Bounce netmails to a invalid address (that we would host)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user