function CramMd5Authenticator::authenticate
Overrides AuthenticatorInterface::authenticate
See also
https://www.ietf.org/rfc/rfc4954.txt
File
-
vendor/
symfony/ mailer/ Transport/ Smtp/ Auth/ CramMd5Authenticator.php, line 32
Class
- CramMd5Authenticator
- Handles CRAM-MD5 authentication.
Namespace
Symfony\Component\Mailer\Transport\Smtp\AuthCode
public function authenticate(EsmtpTransport $client) : void {
$challenge = $client->executeCommand("AUTH CRAM-MD5\r\n", [
334,
]);
$challenge = base64_decode(substr($challenge, 4));
$message = base64_encode($client->getUsername() . ' ' . $this->getResponse($client->getPassword(), $challenge));
$client->executeCommand(\sprintf("%s\r\n", $message), [
235,
]);
}