diff --git a/app/Classes/FTN/Message.php b/app/Classes/FTN/Message.php index 86fcf56..a1c9632 100644 --- a/app/Classes/FTN/Message.php +++ b/app/Classes/FTN/Message.php @@ -252,9 +252,9 @@ class Message extends FTNBase // To Addresses // Echomail doesnt have a zone, so we'll use the source zone case 'tz': return Arr::get($this->echoarea ? $this->src : $this->dst,'z'); - case 'tn': return $this->echoarea ? Arr::get($this->header,'dnet') : Arr::get($this->dst,'n'); - case 'tf': return $this->echoarea ? Arr::get($this->header,'dnode') : Arr::get($this->dst,'f'); - case 'tp': return Arr::get($this->dst,'p'); + case 'tn': return Arr::get($this->header,'dnet'); + case 'tf': return Arr::get($this->header,'dnode'); + case 'tp': return Arr::get($this->dst,'p'); // @todo this wont work for netmails, since dst is not set for in transit messages case 'fftn': case 'fftn_o': @@ -757,7 +757,11 @@ class Message extends FTNBase // The message is the rest? } elseif (strlen($kl) > $retpos+1) { - $this->message .= substr($kl,$retpos+1); + // Since netmail doesnt have an origin - our source: + $this->message .= substr($message, 0, $msgpos); + + $this->message_src = substr($kl,$retpos+1); + $kl = substr($kl,0,$retpos); } diff --git a/app/Models/Echomail.php b/app/Models/Echomail.php index f0f96ed..2d3987b 100644 --- a/app/Models/Echomail.php +++ b/app/Models/Echomail.php @@ -35,6 +35,7 @@ final class Echomail extends Model implements Packet 'from', 'subject', 'msg', + 'msg_src', 'origin', 'tearline', 'tagline', diff --git a/app/Models/Netmail.php b/app/Models/Netmail.php index 78e11e2..9f62233 100644 --- a/app/Models/Netmail.php +++ b/app/Models/Netmail.php @@ -22,6 +22,7 @@ final class Netmail extends Model implements Packet 'from', 'subject', 'msg', + 'msg_src', 'origin', 'tearline', 'tagline', diff --git a/tests/Feature/PacketTest.php b/tests/Feature/PacketTest.php index 515bc5e..b39d13a 100644 --- a/tests/Feature/PacketTest.php +++ b/tests/Feature/PacketTest.php @@ -130,7 +130,7 @@ class PacketTest extends TestCase $this->assertNotTrue($msg->isNetmail()); $this->assertSame('21:1/151 6189F64C',$msg->msgid); - $this->assertSame('db727bd3778ddd457784ada4bf016010',md5($msg->message)); + $this->assertSame('a8791fd3d261734bb524bc5ed929aa4c',md5($msg->message)); $this->assertSame('5b627ab5936b0550a97b738f4deff419',md5($msg->message_src)); $this->assertCount(3,$msg->rogue_path); $this->assertCount(170,$msg->rogue_seenby); @@ -154,7 +154,7 @@ class PacketTest extends TestCase $this->assertNotTrue($msg->isNetmail()); $this->assertSame('21:1/126 eec6e958',$msg->msgid); - $this->assertSame('5a525cc1c393292dc65160a852d4d615',md5($msg->message)); + $this->assertSame('c0b00abfc3eff7e297bf14f5812a7261',md5($msg->message)); $this->assertSame('a3193edcc68521d4ed07da6db2aeb0b6',md5($msg->message_src)); $this->assertCount(3,$msg->rogue_path); $this->assertCount(161,$msg->rogue_seenby);