зеркало из https://github.com/mozilla/gecko-dev.git
add pref for disabling secure auth on smtp servers, patch by ch.ey@gmx.net, r=me, sr=scott, a=asa 203785
This commit is contained in:
Родитель
58164df36e
Коммит
26d4f767e3
|
@ -37,6 +37,7 @@ interface nsISmtpServer : nsISupports {
|
|||
attribute string redirectorType;
|
||||
|
||||
attribute long authMethod;
|
||||
readonly attribute boolean trySecAuth;
|
||||
attribute long trySSL;
|
||||
|
||||
readonly attribute string serverURI;
|
||||
|
|
|
@ -247,6 +247,7 @@ void nsSmtpProtocol::Initialize(nsIURI * aURL)
|
|||
m_prefAuthMethod = PREF_AUTH_NONE;
|
||||
m_usernamePrompted = PR_FALSE;
|
||||
m_prefTrySSL = PREF_SSL_TRY;
|
||||
m_prefTrySecAuth = PR_TRUE;
|
||||
m_tlsInitiated = PR_FALSE;
|
||||
|
||||
m_urlErrorState = NS_ERROR_FAILURE;
|
||||
|
@ -294,6 +295,7 @@ void nsSmtpProtocol::Initialize(nsIURI * aURL)
|
|||
if (smtpServer) {
|
||||
smtpServer->GetAuthMethod(&m_prefAuthMethod);
|
||||
smtpServer->GetTrySSL(&m_prefTrySSL);
|
||||
smtpServer->GetTrySecAuth(&m_prefTrySecAuth);
|
||||
}
|
||||
|
||||
rv = RequestOverrideInfo(smtpServer);
|
||||
|
@ -686,6 +688,8 @@ PRInt32 nsSmtpProtocol::SendEhloResponse(nsIInputStream * inputStream, PRUint32
|
|||
if (m_responseText.Find("EXTERNAL", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_EXTERNAL_ENABLED);
|
||||
|
||||
if(m_prefTrySecAuth)
|
||||
{
|
||||
if (m_responseText.Find("CRAM-MD5", PR_TRUE, 5) >= 0)
|
||||
{
|
||||
nsresult rv;
|
||||
|
@ -693,6 +697,7 @@ PRInt32 nsSmtpProtocol::SendEhloResponse(nsIInputStream * inputStream, PRUint32
|
|||
// this checks if psm is installed...
|
||||
if (NS_SUCCEEDED(rv))
|
||||
SetFlag(SMTP_AUTH_CRAM_MD5_ENABLED);
|
||||
}
|
||||
}
|
||||
|
||||
// for use after mechs disabled fallbacks when login failed
|
||||
|
|
|
@ -177,6 +177,7 @@ private:
|
|||
// *** the following should move to the smtp server when we support
|
||||
// multiple smtp servers
|
||||
PRInt32 m_prefAuthMethod;
|
||||
PRBool m_prefTrySecAuth;
|
||||
PRBool m_usernamePrompted;
|
||||
PRInt32 m_prefTrySSL;
|
||||
PRBool m_tlsEnabled;
|
||||
|
|
|
@ -217,6 +217,22 @@ nsSmtpServer::SetTrySSL(PRInt32 trySSL)
|
|||
return prefs->SetIntPref(pref.get(), trySSL);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSmtpServer::GetTrySecAuth(PRBool *trySecAuth)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCAutoString pref;
|
||||
NS_ENSURE_ARG_POINTER(trySecAuth);
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
*trySecAuth = PR_TRUE;
|
||||
getPrefString("trySecAuth", pref);
|
||||
rv = prefs->GetBoolPref(pref.get(), trySecAuth);
|
||||
if (NS_FAILED(rv))
|
||||
prefs->GetBoolPref("mail.smtpserver.default.trySecAuth", trySecAuth);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSmtpServer::GetAuthMethod(PRInt32 *authMethod)
|
||||
{
|
||||
|
|
|
@ -383,6 +383,7 @@ pref("mail.server.default.manualMark",false);
|
|||
pref("mail.server.default.manualMarkMode",0); // 0 == "move to junk folder", 1 == "delete"
|
||||
|
||||
pref("mail.smtpserver.default.auth_method", 1); // auth any
|
||||
pref("mail.smtpserver.default.trySecAuth", true);
|
||||
pref("mail.smtpserver.default.try_ssl", 0);
|
||||
|
||||
// For the next 3 prefs, see <http://www.bucksch.org/1/projects/mozilla/16507>
|
||||
|
|
|
@ -383,6 +383,7 @@ pref("mail.server.default.manualMark",false);
|
|||
pref("mail.server.default.manualMarkMode",0); // 0 == "move to junk folder", 1 == "delete"
|
||||
|
||||
pref("mail.smtpserver.default.auth_method", 1); // auth any
|
||||
pref("mail.smtpserver.default.trySecAuth", true);
|
||||
pref("mail.smtpserver.default.try_ssl", 0);
|
||||
|
||||
// For the next 3 prefs, see <http://www.bucksch.org/1/projects/mozilla/16507>
|
||||
|
|
Загрузка…
Ссылка в новой задаче