Further enhancement with #9063a2a - to ensure our message addressing and content picks the right address

This commit is contained in:
2023-12-18 15:13:16 +11:00
parent 1ded66990c
commit 13e51724c0
34 changed files with 68 additions and 93 deletions

View File

@@ -39,8 +39,7 @@ class EchomailChannel
if (! $echoarea = $notifiable->routeNotificationFor('echomail',$notification))
return;
$so = Setup::findOrFail(config('app.id'))->system;
$o = $notification->toEchomail($so,$notifiable);
$o = $notification->toEchomail($notifiable);
Log::info(sprintf('%s:= Posted echomail [%s] to [%s]',self::LOGKEY,$o->msgid,$echoarea));
}

View File

@@ -39,8 +39,7 @@ class NetmailChannel
if (! $ao = $notifiable->routeNotificationFor('netmail',$notification))
return;
$so = Setup::findOrFail(config('app.id'))->system;
$o = $notification->toNetmail($so,$notifiable);
$o = $notification->toNetmail($notifiable);
Log::info(sprintf('%s:= Sent netmail [%s] to [%s]',self::LOGKEY,$o->msgid,$ao->ftn));
}

View File

@@ -40,14 +40,13 @@ abstract class Echomails extends Notification //implements ShouldQueue
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Echomail
* @throws \Exception
*/
abstract public function toEchomail(System $so,object $notifiable): Echomail;
abstract public function toEchomail(object $notifiable): Echomail;
protected function setupEchomail(Message $mo,System $so,object $notifiable): Echomail
protected function setupEchomail(Message $mo,object $notifiable): Echomail
{
$echoarea = $notifiable->routeNotificationFor(static::via);
$eo = Echoarea::where('name',$echoarea)->singleOrFail();
@@ -61,7 +60,7 @@ abstract class Echomails extends Notification //implements ShouldQueue
$o->datetime = Carbon::now();
$o->tzoffset = $o->datetime->utcOffset();
$o->fftn_id = ($x=$so->match($mo->fboss_o->zone)->first())->id;
$o->fftn_id = ($x=our_address($mo->fboss_o->zone->domain,$mo->fboss_o))->id;
$o->flags = (Message::FLAG_LOCAL);
$o->tearline = sprintf('%s (%04X)',Setup::PRODUCT_NAME,Setup::PRODUCT_ID);

View File

@@ -34,14 +34,13 @@ class Test extends Echomails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Echomail
* @throws \Exception
*/
public function toEchomail(System $so,object $notifiable): Echomail
public function toEchomail(object $notifiable): Echomail
{
$o = $this->setupEchomail($this->mo,$so,$notifiable);
$o = $this->setupEchomail($this->mo,$notifiable);
$echoarea = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Creating test echomail to [%s]',self::LOGKEY,$echoarea));

View File

@@ -40,14 +40,13 @@ abstract class Netmails extends Notification //implements ShouldQueue
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
abstract public function toNetmail(System $so,object $notifiable): Netmail;
abstract public function toNetmail(object $notifiable): Netmail;
protected function setupNetmail(System $so,object $notifiable): Netmail
protected function setupNetmail(object $notifiable): Netmail
{
$ao = $notifiable->routeNotificationFor(static::via);
@@ -58,7 +57,7 @@ abstract class Netmails extends Notification //implements ShouldQueue
$o->datetime = Carbon::now();
$o->tzoffset = $o->datetime->utcOffset();
$o->fftn_id = $so->match($ao->zone)->first()->id;
$o->fftn_id = our_address($ao->zone->domain,$ao);
$o->tftn_id = $ao->id;
$o->flags = (Message::FLAG_LOCAL|Message::FLAG_PRIVATE);
$o->cost = 0;

View File

@@ -31,14 +31,13 @@ class AddressLink extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Sending a link code for address [%s]',self::LOGKEY,$ao->ftn));

View File

@@ -32,14 +32,13 @@ class Areafix extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Responding to areafix with netmail to [%s]',self::LOGKEY,$ao->ftn));

View File

@@ -32,14 +32,13 @@ class NotConfiguredHere extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] not configured here',self::LOGKEY,$ao->ftn));

View File

@@ -33,14 +33,13 @@ class EchoareaNoWrite extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Creating ECHOMAIL NO WRITE netmail to [%s]',self::LOGKEY,$ao->ftn));

View File

@@ -33,14 +33,13 @@ class EchoareaNotExist extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Creating ECHOMAIL NOT EXIST netmail to [%s]',self::LOGKEY,$ao->ftn));

View File

@@ -33,14 +33,13 @@ class EchoareaNotSubscribed extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Creating ECHOMAIL NOT SUBSCRIBED netmail to [%s]',self::LOGKEY,$ao->ftn));

View File

@@ -33,14 +33,13 @@ class EchomailBadAddress extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Creating ECHOMAIL BAD ADDRESS netmail to [%s]',self::LOGKEY,$ao->ftn));

View File

@@ -35,14 +35,13 @@ class NetmailForward extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Advising [%s@%s] that netmail to [%s] will be forwarded to [%s].',self::LOGKEY,$this->mo->user_from,$ao->ftn,$this->mo->user_to,$this->ao->ftn));

View File

@@ -31,10 +31,13 @@ class PacketPasswordInvalid extends Netmails
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Creating netmail to [%s] - system using invalid packet password',self::LOGKEY,$ao->ftn));

View File

@@ -34,14 +34,13 @@ class Ping extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Creating PING netmail to [%s]',self::LOGKEY,$ao->ftn));

View File

@@ -21,14 +21,13 @@ class PollingFailed extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Creating auto hold netmail to [%s]',self::LOGKEY,$ao->ftn));

View File

@@ -33,14 +33,13 @@ class Reject extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Creating reject netmail to [%s]',self::LOGKEY,$ao->ftn));

View File

@@ -17,14 +17,13 @@ class Test extends Netmails
/**
* Get the mail representation of the notification.
*
* @param System $so
* @param mixed $notifiable
* @return Netmail
* @throws \Exception
*/
public function toNetmail(System $so,object $notifiable): Netmail
public function toNetmail(object $notifiable): Netmail
{
$o = $this->setupNetmail($so,$notifiable);
$o = $this->setupNetmail($notifiable);
$ao = $notifiable->routeNotificationFor(static::via);
Log::info(sprintf('%s:+ Creating TEST netmail to [%s]',self::LOGKEY,$ao->ftn));