EMSI Continue sending mail until no more mail to send

This commit is contained in:
Deon George
2022-12-03 01:09:41 +11:00
parent e78b5975b0
commit 09fe65a8db
2 changed files with 16 additions and 8 deletions

View File

@@ -1177,14 +1177,14 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
// Add our mail to the queue if we have authenticated
if ($this->node->aka_authed)
foreach ($this->node->aka_remote_authed as $ao) {
$this->send->mail($ao);
while ($this->send->mail($ao)) {
$z = new Zmodem;
if (! $z->zmodem_sendinit($this->client,$zap) && $this->send->total_count)
$z->zmodem_sendfile($this->send);
}
}
$z = new Zmodem;
if (! $z->zmodem_sendinit($this->client,$zap) && $this->send->total_count)
$z->zmodem_sendfile($this->send);
Log::debug(sprintf('%s:- Finished sending',self::LOGKEY));
return ($z->zmodem_senddone()<0);
}