diff --git a/app/Jobs/ProcessPacket.php b/app/Jobs/ProcessPacket.php index bd7239f..3118078 100644 --- a/app/Jobs/ProcessPacket.php +++ b/app/Jobs/ProcessPacket.php @@ -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 = [ diff --git a/app/Models/Address.php b/app/Models/Address.php index 707ea26..a93e410 100644 --- a/app/Models/Address.php +++ b/app/Models/Address.php @@ -335,6 +335,7 @@ class Address extends Model return $q->whereNull('sent') ->orWhere('sent',FALSE); })) + ->whereNull('local') ->count()) { return $this->getPacket($x->get());