HostEntry final readonly class
Minn\Mail\HostEntry · public/minn/src/Minn/Mail/HostEntry.php · 66 lines
One entry of a mailer's Host setting ("host", "host:port", "ssl://host:465", "tls://host"; entries are separated by semicolons): the security prefix, the host and the port. Only ssl:// and tls:// are prefixes; anything else stays part of the host and fails the host check.
Constants and properties
| prop | readonly string $prefix | Promoted from the constructor. |
| prop | readonly string $host | Promoted from the constructor. |
| prop | readonly ?int $port | Promoted from the constructor. |
Public
| new | __construct(string $prefix, string $host, ?int $port)# | |
| static | parseAll(string $hosts): array# | The entries of a Host setting, null where one cannot be read. @return list<array{0: string, 1: self|null}> the trimmed entry text and its reading |
| method | portOr(int $default): int# | The port to connect on: the entry's own when it is one (1 to 65535), else the mailer's Port (probe db-mail-rewrite-doubts). |
| method | takesOfferedTls(): bool# | Whether a server's STARTTLS offer is taken on its own: never for localhost, nor without OpenSSL. |
| static | serverName(string $configured, ?string $serverName): string# | The name the mailer gives itself (serverHostname): the configured Hostname, else the request's SERVER_NAME when one is set (even empty), else the machine's; one that is not a valid host is localhost.localdomain. |
| static | validHost(mixed $host): bool# | Whether a host name, IPv4 address or bracketed IPv6 address is well formed. |
Nothing matches.