Improvements for finding intransit netmails to upstream and peer hubs
This commit is contained in:
parent
abd956069c
commit
d0e251737a
@ -277,7 +277,7 @@ class Node
|
|||||||
public function originate(Address $o): void
|
public function originate(Address $o): void
|
||||||
{
|
{
|
||||||
$this->originate = $o;
|
$this->originate = $o;
|
||||||
$this->ftns_authed = $o->system->match($o->zone);
|
$this->ftns_authed = $o->system->match($o->zone,Address::NODE_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,7 +67,6 @@ class MailSend #implements ShouldQueue
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
->filter(function($item) {
|
->filter(function($item) {
|
||||||
if ($item->ftn3d === '1337:1/100') dump(['item'=>$item,'ftn'=>$item->ftn,'autohold'=>$item->system->authold,'pollmode'=>$item->system->pollmode,'crash'=>$this->crash]);
|
|
||||||
if ($item->system->autohold)
|
if ($item->system->autohold)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1193,10 +1193,17 @@ class Address extends Model
|
|||||||
*/
|
*/
|
||||||
public function netmailWaiting(): Builder
|
public function netmailWaiting(): Builder
|
||||||
{
|
{
|
||||||
|
// Addresses that our downstream of this address, except anybody that has session details with us
|
||||||
|
$ours = our_nodes($this->zone->domain)->pluck('id');
|
||||||
|
|
||||||
|
$addresses = $this->downstream()
|
||||||
|
->filter(fn($item)=>! $ours->contains($item->id))
|
||||||
|
->merge($this->system->match($this->zone,Address::NODE_ALL));
|
||||||
|
|
||||||
$netmails = $this
|
$netmails = $this
|
||||||
->UncollectedNetmail()
|
->UncollectedNetmail()
|
||||||
->select('netmails.id')
|
->select('netmails.id')
|
||||||
->whereIn('addresses.id',$this->downlinks()->add($this)->pluck('id'))
|
->whereIn('addresses.id',$addresses->pluck('id'))
|
||||||
->groupBy(['netmails.id'])
|
->groupBy(['netmails.id'])
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user