refactor: use custom imap client

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-05-08 00:16:43 -04:00
parent a728aeb11c
commit a8764747fd
179 changed files with 6782 additions and 5907 deletions

View File

@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
namespace KTXM\ProviderImap\Client;
final class MessageAddress
{
public function __construct(
private readonly ?string $name,
private readonly ?string $mailbox,
private readonly ?string $host,
) {}
public function name(): ?string
{
return $this->name;
}
public function mailbox(): ?string
{
return $this->mailbox;
}
public function host(): ?string
{
return $this->host;
}
public function email(): ?string
{
if ($this->mailbox === null || $this->mailbox === '') {
return null;
}
if ($this->host === null || $this->host === '') {
return $this->mailbox;
}
return $this->mailbox . '@' . $this->host;
}
public function toArray(): array
{
return [
'address' => $this->email(),
'label' => $this->name,
];
}
}