Check for duplicate echomails, validate system password

This commit is contained in:
Deon George
2021-08-19 00:20:34 +10:00
parent 6af466605a
commit bcf3297fdb
5 changed files with 47 additions and 9 deletions

View File

@@ -120,6 +120,19 @@ final class Receive extends Item
break;
}
// Check the messages are from the uplink
if ($this->ao->system->addresses->search(function($item) use ($po) { return $item->id == $po->fftn_o->id; }) === FALSE) {
Log::error(sprintf('%s: ! Packet [%s] is not from this link? [%d]',self::LOGKEY,$this->fftn_o->ftn,$this->ao->system_id));
break;
}
// Check the packet password
if ($this->ao->session('pktpass') !== $po->password) {
Log::error(sprintf('%s: ! Packet from [%s] with password [%s] is invalid (%s)',self::LOGKEY,$this->ao->ftn,$po->password));
// @todo Generate message to system advising invalid password - that message should be sent without a packet password!
break;
}
foreach ($po->messages as $msg) {
Log::info(sprintf('%s: - Mail from [%s] to [%s]',self::LOGKEY,$msg->fftn,$msg->tftn));
@@ -151,6 +164,7 @@ final class Receive extends Item
/**
* Open the file descriptor to receive a file
*
* @param Address $ao
* @param bool $check
* @return bool
* @throws Exception