Allow more than one mechanism after AUTH=.
This commit is contained in:
parent
a5de2571e3
commit
e801eac884
@ -223,6 +223,7 @@ void SMTPTransport::helo()
|
|||||||
m_extensions.clear();
|
m_extensions.clear();
|
||||||
|
|
||||||
// Get supported extensions from SMTP response
|
// Get supported extensions from SMTP response
|
||||||
|
// One extension per line, format is: EXT PARAM1 PARAM2...
|
||||||
for (int i = 1, n = resp->getLineCount() ; i < n ; ++i)
|
for (int i = 1, n = resp->getLineCount() ; i < n ; ++i)
|
||||||
{
|
{
|
||||||
const string line = resp->getLineAt(i).getText();
|
const string line = resp->getLineAt(i).getText();
|
||||||
@ -231,22 +232,20 @@ void SMTPTransport::helo()
|
|||||||
string ext;
|
string ext;
|
||||||
iss >> ext;
|
iss >> ext;
|
||||||
|
|
||||||
// Special case: some servers send "AUTH=LOGIN"
|
std::vector <string> params;
|
||||||
if (ext.length() == 10 && utility::stringUtils::toUpper(ext) == "AUTH=LOGIN")
|
string param;
|
||||||
{
|
|
||||||
m_extensions["AUTH"].push_back("LOGIN");
|
|
||||||
}
|
|
||||||
// Default case: EXT PARAM1 PARAM2...
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::vector <string> params;
|
|
||||||
string param;
|
|
||||||
|
|
||||||
while (iss >> param)
|
// Special case: some servers send "AUTH=MECH [MECH MECH...]"
|
||||||
params.push_back(utility::stringUtils::toUpper(param));
|
if (ext.length() >= 5 && utility::stringUtils::toUpper(ext.substr(0, 5)) == "AUTH=")
|
||||||
|
{
|
||||||
m_extensions[ext] = params;
|
params.push_back(utility::stringUtils::toUpper(ext.substr(5)));
|
||||||
|
ext = "AUTH";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (iss >> param)
|
||||||
|
params.push_back(utility::stringUtils::toUpper(param));
|
||||||
|
|
||||||
|
m_extensions[ext] = params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user