Skip to content

Commit

Permalink
Trigger deprecation warning for CRAM-MD5, DIGEST-MD5, LOGIN and PLAIN…
Browse files Browse the repository at this point in the history
… in error-log
  • Loading branch information
schengawegga committed Aug 8, 2023
1 parent 2ad6318 commit 183cc29
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Net/SMTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,8 @@ public function setAuthMethod($name, $callback, $prepend = true)
*/
protected function authDigestMD5($uid, $pwd, $authz = '')
{
trigger_error(__CLASS__ . ' (' . $this->host . '): Authentication method DIGEST-MD5 is no longer secure and should be avoided.', E_USER_DEPRECATED);

if (PEAR::isError($error = $this->put('AUTH', 'DIGEST-MD5'))) {
return $error;
}
Expand Down Expand Up @@ -834,6 +836,8 @@ protected function authDigestMD5($uid, $pwd, $authz = '')
*/
protected function authCRAMMD5($uid, $pwd, $authz = '')
{
trigger_error(__CLASS__ . ' (' . $this->host . '): Authentication method CRAM-MD5 is no longer secure and should be avoided.', E_USER_DEPRECATED);

if (PEAR::isError($error = $this->put('AUTH', 'CRAM-MD5'))) {
return $error;
}
Expand Down Expand Up @@ -875,6 +879,8 @@ protected function authCRAMMD5($uid, $pwd, $authz = '')
*/
protected function authLogin($uid, $pwd, $authz = '')
{
trigger_error(__CLASS__ . ' (' . $this->host . '): Authentication method LOGIN is no longer secure and should be avoided.', E_USER_DEPRECATED);

if (PEAR::isError($error = $this->put('AUTH', 'LOGIN'))) {
return $error;
}
Expand Down Expand Up @@ -921,6 +927,8 @@ protected function authLogin($uid, $pwd, $authz = '')
*/
protected function authPlain($uid, $pwd, $authz = '')
{
trigger_error(__CLASS__ . ' (' . $this->host . '): Authentication method PLAIN is no longer secure and should be avoided.', E_USER_DEPRECATED);

if (PEAR::isError($error = $this->put('AUTH', 'PLAIN'))) {
return $error;
}
Expand Down

0 comments on commit 183cc29

Please sign in to comment.