Improvements to working out region for new addresses, Bounce netmails to a invalid address (that we would host)
This commit is contained in:
@@ -17,8 +17,8 @@ use League\Flysystem\UnableToMoveFile;
|
||||
use App\Classes\File;
|
||||
use App\Classes\FTN\Packet;
|
||||
use App\Exceptions\InvalidPacketException;
|
||||
use App\Models\{Echomail,Netmail,System};
|
||||
use App\Notifications\Netmails\{PacketPasswordInvalid,UnexpectedPacketFromYou};
|
||||
use App\Models\{Address,Echomail,Netmail,System};
|
||||
use App\Notifications\Netmails\{NetmailNoDestination,PacketPasswordInvalid,UnexpectedPacketFromYou};
|
||||
|
||||
class PacketProcess implements ShouldQueue
|
||||
{
|
||||
@@ -119,10 +119,20 @@ class PacketProcess implements ShouldQueue
|
||||
|
||||
$count = 0;
|
||||
foreach ($pkt as $msg) {
|
||||
if ($msg instanceof Netmail)
|
||||
Log::info(sprintf('%s:- Netmail from [%s] to [%s]',self::LOGKEY,$msg->fftn->ftn,$msg->tftn->ftn));
|
||||
if ($msg instanceof Netmail) {
|
||||
Log::info(sprintf('%s:- Netmail from [%s] to [%s]',self::LOGKEY,$msg->fftn->ftn,$msg->tftn?->ftn ?: $msg->set_tftn));
|
||||
|
||||
elseif ($msg instanceof Echomail) {
|
||||
// If we dont have a destination, we need to bounce it, if we would be the parent of the address
|
||||
if ((! $msg->tftn) && our_address()->contains(Address::newFTN($msg->set_tftn)?->parent())) {
|
||||
Log::alert(sprintf('%s:! Netmail destination [%s] doesnt exist, bouncing back to [%s]',self::LOGKEY,$msg->set_tftn,$pkt->fftn->ftn));
|
||||
|
||||
Notification::route('netmail',$msg->fftn)->notify(new NetmailNoDestination($msg));
|
||||
$count++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
} elseif ($msg instanceof Echomail) {
|
||||
Log::info(sprintf('%s:- Echomail from [%s]',self::LOGKEY,$msg->fftn->ftn));
|
||||
|
||||
if ($netmail_only) {
|
||||
|
Reference in New Issue
Block a user