Dont process messages from robots

This commit is contained in:
Deon George 2021-08-15 00:21:04 +10:00
parent 3badb895b0
commit b9abd17139
2 changed files with 26 additions and 0 deletions

View File

@ -52,6 +52,31 @@ class ProcessPacket implements ShouldQueue
}
}
// We'll ignore messages from *fix users
if (in_array(strtolower($this->msg->user_from),['filefix','areafix'])) {
Log::info(sprintf('Ignoring Netmail to the Hub from (%s) [%s] - its from a bot.',$this->msg->user_from,$this->msg->fftn));
$o = new Netmail;
$o->to = $this->msg->user_to;
$o->from = $this->msg->user_from;
$o->subject = $this->msg->subject;
$o->datetime = $this->msg->date;
$o->tzoffset = $this->msg->date->utcOffset();
$o->flags = $this->msg->flags;
$o->cost = $this->msg->cost;
$o->msgid = $this->msg->msgid;
$o->fftn_id = ($x=$this->msg->fftn_o) ? $x->id : NULL;
$o->tftn_id = ($x=$this->msg->tftn_o) ? $x->id : NULL;
$o->msg = $this->msg->message_src;
$o->local = TRUE;
$o->save();
$processed = TRUE;
}
// If not processed, no users here!
if (! $processed) {
$reject = [

View File

@ -335,6 +335,7 @@ class Address extends Model
return $q->whereNull('sent')
->orWhere('sent',FALSE);
}))
->whereNull('local')
->count())
{
return $this->getPacket($x->get());