Attempt to work out a packets domain from a nodes addresses for looking at a default
This commit is contained in:
@@ -17,7 +17,7 @@ use League\Flysystem\UnableToMoveFile;
|
||||
use App\Classes\File;
|
||||
use App\Classes\FTN\Packet;
|
||||
use App\Exceptions\InvalidPacketException;
|
||||
use App\Models\{Domain,Echomail,Netmail};
|
||||
use App\Models\{Echomail,Netmail,System};
|
||||
use App\Notifications\Netmails\PacketPasswordInvalid;
|
||||
|
||||
class PacketProcess implements ShouldQueue
|
||||
@@ -27,15 +27,15 @@ class PacketProcess implements ShouldQueue
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
private string $filename;
|
||||
private Domain $do;
|
||||
private System $so;
|
||||
private Carbon $rcvd_time;
|
||||
private bool $interactive;
|
||||
private bool $nobot;
|
||||
|
||||
public function __construct(string $filename,Domain $do,bool $interactive=TRUE,Carbon $rcvd_time=NULL,bool $nobot=FALSE)
|
||||
public function __construct(string $filename,System $so,bool $interactive=TRUE,Carbon $rcvd_time=NULL,bool $nobot=FALSE)
|
||||
{
|
||||
$this->filename = $filename;
|
||||
$this->do = $do;
|
||||
$this->so = $so;
|
||||
$this->interactive = $interactive;
|
||||
$this->rcvd_time = $rcvd_time ?: Carbon::now();
|
||||
$this->nobot = $nobot;
|
||||
@@ -71,7 +71,7 @@ class PacketProcess implements ShouldQueue
|
||||
|
||||
foreach ($f as $packet) {
|
||||
try {
|
||||
$pkt = Packet::process($packet,Arr::get(stream_get_meta_data($packet),'uri'),$f->itemSize(),$this->do);
|
||||
$pkt = Packet::process($packet,Arr::get(stream_get_meta_data($packet),'uri'),$f->itemSize(),$this->so);
|
||||
|
||||
// Check that the packet is from a system that is defined in the DB
|
||||
if (! $pkt->fftn) {
|
||||
@@ -81,7 +81,7 @@ class PacketProcess implements ShouldQueue
|
||||
}
|
||||
|
||||
if (! our_nodes($pkt->fftn->zone->domain)->contains($pkt->fftn)) {
|
||||
Log::error(sprintf('%s:! Packet [%s] is from a system that is not configured with us? [%s] for [%s]',self::LOGKEY,$this->filename,$pkt->fftn_t,$this->do->name));
|
||||
Log::error(sprintf('%s:! Packet [%s] is from a system that is not configured with us? [%s]',self::LOGKEY,$this->filename,$pkt->fftn_t));
|
||||
|
||||
// @todo Notification::route('netmail',$pkt->fftn)->notify(new UnexpectedPacketFromYou($this->filename));
|
||||
// @todo Parse the packet for netmails and process them. We'll only accept netmails to us, and ignore all others
|
||||
|
Reference in New Issue
Block a user