Alert message for echomails with security violations is using wrong address

This commit is contained in:
Deon George 2023-09-18 23:38:40 +10:00
parent f315c71ca9
commit 5e67be5ba1
2 changed files with 3 additions and 2 deletions

View File

@ -305,7 +305,7 @@ class MessageProcess implements ShouldQueue
// @todo Can the sender create it if it doesnt exist?
// Can the system send messages to this area?
if (! $ea->sec_write || ($this->pktsrc->security < $ea->sec_write)) {
Log::alert(sprintf('%s:! FTN [%s] is not allowed to post [%s] to [%s].',self::LOGKEY,$this->msg->fboss,$this->msg->msgid,$ea->name));
Log::alert(sprintf('%s:! FTN [%s] is not allowed to post [%s] to [%s].',self::LOGKEY,$this->pktsrc,$this->msg->msgid,$ea->name));
if (! $this->msg->rescanned->count())
Notification::route('netmail',$this->pktsrc)->notify(new EchoareaNoWrite($this->msg));
@ -314,7 +314,7 @@ class MessageProcess implements ShouldQueue
// If the node is not subscribed
if ($this->pktsrc->echoareas->search(function($item) use ($ea) { return $item->id === $ea->id; }) === FALSE) {
Log::alert(sprintf('%s:! FTN [%s] is not subscribed to [%s] for [%s].',self::LOGKEY,$this->msg->fboss,$ea->name,$this->msg->msgid));
Log::alert(sprintf('%s:! FTN [%s] is not subscribed to [%s] for [%s].',self::LOGKEY,$this->pktsrc,$ea->name,$this->msg->msgid));
if (! $this->msg->rescanned->count())
Notification::route('netmail',$this->pktsrc)->notify(new EchoareaNotSubscribed($this->msg));

View File

@ -209,6 +209,7 @@ class System extends Model
* @param Zone $o
* @param int $type
* @return Collection
* @todo This doesnt return sorted addresses, so it is possible that a node address is returned first, before a NC/HC, etc
*/
public function match(Zone $o,int $type=(Address::NODE_NC|Address::NODE_HC|Address::NODE_ACTIVE|Address::NODE_PVT|Address::NODE_POINT)): Collection
{