Merge pull request #12175 from Shnoulle/develop
Close #12098 : allow usage of AUTH LOGIN in smtp
This commit is contained in:
commit
1b3d6d749a
@ -496,17 +496,31 @@ class SMTPs
|
|||||||
return $_retVal;
|
return $_retVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Default authentication method is LOGIN
|
||||||
|
if (empty($conf->global->MAIL_SMTP_AUTH_TYPE)) $conf->global->MAIL_SMTP_AUTH_TYPE = 'LOGIN';
|
||||||
|
|
||||||
// Send Authentication to Server
|
// Send Authentication to Server
|
||||||
// Check for errors along the way
|
// Check for errors along the way
|
||||||
$this->socket_send_str('AUTH LOGIN', '334');
|
switch ($conf->global->MAIL_SMTP_AUTH_TYPE) {
|
||||||
|
case 'PLAIN':
|
||||||
// User name will not return any error, server will take anything we give it.
|
$this->socket_send_str('AUTH PLAIN', '334');
|
||||||
$this->socket_send_str(base64_encode($this->_smtpsID), '334');
|
// The error here just means the ID/password combo doesn't work.
|
||||||
|
$_retVal = $this->socket_send_str(base64_encode("\0" . $this->_smtpsID . "\0" . $this->_smtpsPW), '235');
|
||||||
// The error here just means the ID/password combo doesn't work.
|
break;
|
||||||
// There is not a method to determine which is the problem, ID or password
|
case 'LOGIN':
|
||||||
if ( ! $_retVal = $this->socket_send_str(base64_encode($this->_smtpsPW), '235') )
|
default:
|
||||||
$this->_setErr(130, 'Invalid Authentication Credentials.');
|
$this->socket_send_str('AUTH LOGIN', '334');
|
||||||
|
// User name will not return any error, server will take anything we give it.
|
||||||
|
$this->socket_send_str(base64_encode($this->_smtpsID), '334');
|
||||||
|
// The error here just means the ID/password combo doesn't work.
|
||||||
|
// There is not a method to determine which is the problem, ID or password
|
||||||
|
$_retVal = $this->socket_send_str(base64_encode($this->_smtpsPW), '235');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (! $_retVal) {
|
||||||
|
$this->_setErr(130, 'Invalid Authentication Credentials.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user