Compare commits

..

No commits in common. "2316663dac25cfa40e52d449a09552d2ddafc0d0" and "e802fe503003c3b9e36c2b0f672774a6dda71b7d" have entirely different histories.

5 changed files with 7 additions and 16 deletions

View File

@ -874,9 +874,6 @@ class Message extends FTNBase
); );
$validator->after(function($validator) { $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->flatten) {
if (! $this->zone->domain->zones->pluck('zone_id')->contains($this->fz)) 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)); $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));

View File

@ -89,11 +89,10 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
* @param string $name * @param string $name
* @param int $size * @param int $size
* @param System|null $so - The system that sent us the packet, used to figure out domains if the packet is for a different zone * @param System|null $so - The system that sent us the packet, used to figure out domains if the packet is for a different zone
* @param bool $process
* @return Packet * @return Packet
* @throws InvalidPacketException * @throws InvalidPacketException
*/ */
public static function process(mixed $f,string $name,int $size,System $so=NULL,bool $process=TRUE): self public static function process(mixed $f,string $name,int $size,System $so=NULL): self
{ {
Log::debug(sprintf('%s:+ Opening Packet [%s] with size [%d]',self::LOGKEY,$name,$size)); Log::debug(sprintf('%s:+ Opening Packet [%s] with size [%d]',self::LOGKEY,$name,$size));
@ -184,7 +183,7 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
{ {
// Parse our message // Parse our message
Log::debug(sprintf('%s:- Message at offset [%d] in [%s]',self::LOGKEY,$read_ptr-strlen($readbuf),$name)); Log::debug(sprintf('%s:- Message at offset [%d] in [%s]',self::LOGKEY,$read_ptr-strlen($readbuf),$name));
$o->parseMessage(substr($msgbuf,0,$end),$process); $o->parseMessage(substr($msgbuf,0,$end));
$msgbuf = substr($msgbuf,$end+3); $msgbuf = substr($msgbuf,$end+3);
continue; continue;
@ -381,17 +380,16 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
* Parse a message in a mail packet * Parse a message in a mail packet
* *
* @param string $message * @param string $message
* @param bool $process * @throws InvalidPacketException|\Exception
* @throws \Exception
*/ */
private function parseMessage(string $message,bool $process): void private function parseMessage(string $message): void
{ {
Log::info(sprintf('%s:+ Processing packet message [%d] bytes',self::LOGKEY,strlen($message))); Log::info(sprintf('%s:+ Processing packet message [%d] bytes',self::LOGKEY,strlen($message)));
$msg = Message::parseMessage($message,$this->zone); $msg = Message::parseMessage($message,$this->zone);
// If the message is invalid, we'll ignore it // If the message is invalid, we'll ignore it
if ($process && $msg->errors->count()) { if ($msg->errors->count()) {
Log::info(sprintf('%s:- Message [%s] has [%d] errors',self::LOGKEY,$msg->msgid ?: 'No ID',$msg->errors->count())); Log::info(sprintf('%s:- Message [%s] has [%d] errors',self::LOGKEY,$msg->msgid ?: 'No ID',$msg->errors->count()));
// If the messages is not for the right zone, we'll ignore it // If the messages is not for the right zone, we'll ignore it

View File

@ -104,7 +104,7 @@ class HomeController extends Controller
$f = new File($file); $f = new File($file);
foreach ($f as $packet) foreach ($f as $packet)
$pkt->push([$f->itemName()=>Packet::process($packet,$f->itemName(),$f->itemSize(),NULL,FALSE)]); $pkt->push([$f->itemName()=>Packet::process($packet,$f->itemName(),$f->itemSize())]);
} catch (\Exception $e) { } catch (\Exception $e) {
return redirect()->back()->withErrors(sprintf('%s (%s:%d)',$e->getMessage(),$e->getFile(),$e->getLine())); return redirect()->back()->withErrors(sprintf('%s (%s:%d)',$e->getMessage(),$e->getFile(),$e->getLine()));

View File

@ -82,10 +82,6 @@ strong.success {
color: #0e0; color: #0e0;
} }
strong.info {
color: #7cc;
}
strong.gray { strong.gray {
color: #565656; color: #565656;
} }

View File

@ -70,7 +70,7 @@ use App\Models\{Echomail,Netmail};
if ($item->pivot->sent_at) if ($item->pivot->sent_at)
return sprintf('<strong class="success" title="Sent: %s Packet: %s">%s</strong>',$item->pivot->sent_at,$item->pivot->sent_pkt,$item->ftn2d); return sprintf('<strong class="success" title="Sent: %s Packet: %s">%s</strong>',$item->pivot->sent_at,$item->pivot->sent_pkt,$item->ftn2d);
else else
return sprintf('<strong class="info">%s</strong>',$item->ftn2d); return sprintf('<strong class="danger">%s</strong>',$item->ftn2d);
} else { } else {
return sprintf('<strong class="highlight">%s</strong>',$item->ftn2d); return sprintf('<strong class="highlight">%s</strong>',$item->ftn2d);