Better handling of badly addressed packets for netmails
This commit is contained in:
@@ -878,11 +878,17 @@ class Message extends FTNBase
|
||||
$validator->after(function($validator) {
|
||||
if ($this->zone->domain->flatten) {
|
||||
if (! $this->zone->domain->zones->pluck('zone_id')->contains($this->fz))
|
||||
$validator->errors()->add('invalid-zone',sprintf('Message zone [%d] doesnt match any zone in domain for packet zone [%d].',$this->fz,$this->zone->zone_id));
|
||||
$validator->errors()->add('invalid-zone',sprintf('Message from zone [%d] doesnt match any zone in domain for packet zone [%d].',$this->fz,$this->zone->zone_id));
|
||||
|
||||
if (! $this->zone->domain->zones->pluck('zone_id')->contains($this->tz))
|
||||
$validator->errors()->add('invalid-zone',sprintf('Message to zone [%d] doesnt match any zone in domain for packet zone [%d].',$this->fz,$this->zone->zone_id));
|
||||
|
||||
} else {
|
||||
if ($this->zone->zone_id !== $this->fz)
|
||||
$validator->errors()->add('invalid-zone',sprintf('Message zone [%d] doesnt match packet zone [%d].',$this->fz,$this->zone->zone_id));
|
||||
$validator->errors()->add('invalid-zone',sprintf('Message from zone [%d] doesnt match packet zone [%d].',$this->fz,$this->zone->zone_id));
|
||||
|
||||
if ($this->zone->zone_id !== $this->tz)
|
||||
$validator->errors()->add('invalid-zone',sprintf('Message to zone [%d] doesnt match packet zone [%d].',$this->tz,$this->zone->zone_id));
|
||||
}
|
||||
|
||||
if (! $this->fftn)
|
||||
|
@@ -386,9 +386,8 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
|
||||
|
||||
// If the messages is not for the right zone, we'll ignore it
|
||||
if ($msg->errors->has('invalid-zone')) {
|
||||
Log::alert(sprintf('%s:! Message [%s] is from an invalid zone [%s], packet is from [%s] - ignoring it',self::LOGKEY,$msg->msgid,$msg->set_fftn,$this->fz));
|
||||
Log::alert(sprintf('%s:! Message [%s] is from|to an invalid zone [%s|%s], packet is from [%s] - ignoring it',self::LOGKEY,$msg->msgid,$msg->get_fftn,$msg->get_tftn,$this->fz));
|
||||
|
||||
// @todo $msg might not be echomail
|
||||
if (! $msg->kludges->get('RESCANNED'))
|
||||
Notification::route('netmail',$this->fftn)->notify(($msg instanceof Echomail) ? new EchomailBadAddress($msg) : new NetmailBadAddress($msg));
|
||||
|
||||
|
Reference in New Issue
Block a user