Fix passthrough netmail.

This commit is contained in:
Deon George 2022-02-19 16:33:14 +11:00
parent daba4a78d3
commit 6db16712ee
4 changed files with 12 additions and 6 deletions

View File

@ -252,9 +252,9 @@ class Message extends FTNBase
// To Addresses // To Addresses
// Echomail doesnt have a zone, so we'll use the source zone // 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 '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 'tn': return Arr::get($this->header,'dnet');
case 'tf': return $this->echoarea ? Arr::get($this->header,'dnode') : Arr::get($this->dst,'f'); case 'tf': return Arr::get($this->header,'dnode');
case 'tp': return Arr::get($this->dst,'p'); 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':
case 'fftn_o': case 'fftn_o':
@ -757,7 +757,11 @@ class Message extends FTNBase
// The message is the rest? // The message is the rest?
} elseif (strlen($kl) > $retpos+1) { } 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); $kl = substr($kl,0,$retpos);
} }

View File

@ -35,6 +35,7 @@ final class Echomail extends Model implements Packet
'from', 'from',
'subject', 'subject',
'msg', 'msg',
'msg_src',
'origin', 'origin',
'tearline', 'tearline',
'tagline', 'tagline',

View File

@ -22,6 +22,7 @@ final class Netmail extends Model implements Packet
'from', 'from',
'subject', 'subject',
'msg', 'msg',
'msg_src',
'origin', 'origin',
'tearline', 'tearline',
'tagline', 'tagline',

View File

@ -130,7 +130,7 @@ class PacketTest extends TestCase
$this->assertNotTrue($msg->isNetmail()); $this->assertNotTrue($msg->isNetmail());
$this->assertSame('21:1/151 6189F64C',$msg->msgid); $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->assertSame('5b627ab5936b0550a97b738f4deff419',md5($msg->message_src));
$this->assertCount(3,$msg->rogue_path); $this->assertCount(3,$msg->rogue_path);
$this->assertCount(170,$msg->rogue_seenby); $this->assertCount(170,$msg->rogue_seenby);
@ -154,7 +154,7 @@ class PacketTest extends TestCase
$this->assertNotTrue($msg->isNetmail()); $this->assertNotTrue($msg->isNetmail());
$this->assertSame('21:1/126 eec6e958',$msg->msgid); $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->assertSame('a3193edcc68521d4ed07da6db2aeb0b6',md5($msg->message_src));
$this->assertCount(3,$msg->rogue_path); $this->assertCount(3,$msg->rogue_path);
$this->assertCount(161,$msg->rogue_seenby); $this->assertCount(161,$msg->rogue_seenby);