Validation to make sure netmails have an INTL kludge, needed to determine address details. Update Packet View to not trigger validation netmails

This commit is contained in:
2024-11-17 21:37:26 +11:00
parent e802fe5030
commit 59af68dca8
3 changed files with 11 additions and 6 deletions

View File

@@ -874,6 +874,9 @@ class Message extends FTNBase
);
$validator->after(function($validator) {
if (($this->mo instanceof Netmail) && (! $this->mo->kludges->has('INTL')))
$validator->errors()->add('no-intl','Netmail message is missing INTL KLUDGE.');
if ($this->zone->domain->flatten) {
if (! $this->zone->domain->zones->pluck('zone_id')->contains($this->fz))
$validator->errors()->add('invalid-zone',sprintf('Message from zone [%d] doesnt match any zone in domain for packet zone [%d].',$this->fz,$this->zone->zone_id));