зеркало из https://github.com/mozilla/pjs.git
fix 311657, for SMTP, don't fall back to insecure auth, allow user to specify secure auth, and first time user connects to smtp server, set use secure auth based on server capabilities, patch by ch.ey@gmx.net, r=bienvenu, sr=mscott
This commit is contained in:
Родитель
fa1fd98099
Коммит
3b00bf24f6
|
@ -20,3 +20,4 @@
|
|||
<!ENTITY serverPort.label "Port: ">
|
||||
<!ENTITY userName.label "User Name: ">
|
||||
<!ENTITY useSecureConnection.label "Secure Connection: ">
|
||||
<!ENTITY useSecureAuthentication.label "Secure Authentication: ">
|
||||
|
|
|
@ -134,6 +134,8 @@ smtpServer-SecureConnection-Type_0=No
|
|||
smtpServer-SecureConnection-Type_1=STARTTLS, if available
|
||||
smtpServer-SecureConnection-Type_2=STARTTLS
|
||||
smtpServer-SecureConnection-Type_3=SMTP-over-SSL
|
||||
smtpServer-SecureAuthentication-Type-false=No
|
||||
smtpServer-SecureAuthentication-Type-true=Yes
|
||||
smtpServers-confirmServerDeletionTitle=Delete Server
|
||||
smtpServers-confirmServerDeletion=Are you sure you want to delete the server: \n %S?
|
||||
|
||||
|
|
|
@ -253,6 +253,15 @@ sendAnyway=Send anyway
|
|||
## @name NS_ERROR_SENDING_RCPT_COMMAND
|
||||
12575=An error occurred while sending mail. The mail server responded: %1$s. Please check the message recipient %2$s and try again.
|
||||
|
||||
## @name NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_AUTH
|
||||
12576=An error occurred sending mail: Unable to authenticate to SMTP server %S. We failed with the available authentication mechanisms.
|
||||
|
||||
## @name NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_INSECAUTH
|
||||
12577=An error occurred sending mail: Unable to authenticate to SMTP server %S. The server does not support any compatible insecure authentication mechanism but you have chosen insecure authentication.
|
||||
|
||||
## @name NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_SECAUTH
|
||||
12578=An error occurred sending mail: Unable to authenticate to SMTP server %S. The server does not support any compatible secure authentication mechanism but you have chosen secure authentication.
|
||||
|
||||
## Strings use for the save message dialog shown when the user close a message compose window
|
||||
saveDlogTitle=Save Message
|
||||
saveDlogMessage=Message has not been sent. Do you want to save the message in the Drafts folder?
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
<!ENTITY alwaysUseUsername.accesskey "U">
|
||||
<!ENTITY userName.label "User Name:">
|
||||
<!ENTITY userName.accesskey "m">
|
||||
<!ENTITY useSecAuth.label "Use secure authentication">
|
||||
<!ENTITY useSecAuth.accesskey "i">
|
||||
<!ENTITY isSecure.label "Use secure connection:">
|
||||
<!ENTITY neverSecure.label "No">
|
||||
<!ENTITY neverSecure.accesskey "N">
|
||||
|
|
|
@ -140,6 +140,8 @@ var gSmtpServerListWindow =
|
|||
document.getElementById('userNameValue').value = aServer.username || noneSelected;
|
||||
document.getElementById('useSecureConnectionValue').value = this.mBundle.getString("smtpServer-SecureConnection-Type_" +
|
||||
aServer.trySSL);
|
||||
document.getElementById('useSecureAuthenticationValue').value = this.mBundle.getString("smtpServer-SecureAuthentication-Type-" +
|
||||
aServer.useSecAuth);
|
||||
},
|
||||
|
||||
refreshServerList: function(aServerKeyToSelect, aFocusList)
|
||||
|
|
|
@ -65,6 +65,10 @@
|
|||
<hbox pack="end"><label id="userNameLabel" value="&userName.label;"/></hbox>
|
||||
<textbox id="userNameValue" readonly="true" class="plain"/>
|
||||
</row>
|
||||
<row align="center">
|
||||
<hbox pack="end"><label id="useSecureAuthenticationLabel" value="&useSecureAuthentication.label;"/></hbox>
|
||||
<textbox id="useSecureAuthenticationValue" readonly="true" class="plain"/>
|
||||
</row>
|
||||
<row align="center">
|
||||
<hbox pack="end"><label id="useSecureConnectionLabel" value="&useSecureConnection.label;"/></hbox>
|
||||
<textbox id="useSecureConnectionValue" readonly="true" class="plain"/>
|
||||
|
|
|
@ -65,6 +65,7 @@ function initSmtpSettings(server) {
|
|||
gSmtpUseUsername = document.getElementById("smtp.useUsername");
|
||||
gSmtpAuthMethod = document.getElementById("smtp.authMethod");
|
||||
gSmtpTrySSL = document.getElementById("smtp.trySSL");
|
||||
gSmtpUseSecAuth = document.getElementById("smtp.useSecAuth");
|
||||
gDefaultPort = document.getElementById("smtp.defaultPort");
|
||||
gPort = document.getElementById("smtp.port");
|
||||
|
||||
|
@ -75,6 +76,7 @@ function initSmtpSettings(server) {
|
|||
gSmtpUsername.value = server.username;
|
||||
gSmtpAuthMethod.setAttribute("value", server.authMethod);
|
||||
gSmtpTrySSL.value = (server.trySSL < 4) ? server.trySSL : 1;
|
||||
gSmtpUseSecAuth.checked = server.useSecAuth == "1";
|
||||
} else {
|
||||
gSmtpAuthMethod.setAttribute("value", "1");
|
||||
gSmtpTrySSL.value = 1;
|
||||
|
@ -139,6 +141,7 @@ function saveSmtpSettings(server)
|
|||
// " but checked = " + gSmtpUseUsername.checked + "\n");
|
||||
server.username = gSmtpUsername.value;
|
||||
server.trySSL = gSmtpTrySSL.value;
|
||||
server.useSecAuth = gSmtpUseSecAuth.checked;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,6 +153,7 @@ function onUseUsername(checkbox, dofocus)
|
|||
if (!checkbox.disabled) {
|
||||
gSmtpUsername.removeAttribute("disabled");
|
||||
gSmtpUsernameLabel.removeAttribute("disabled");
|
||||
gSmtpUseSecAuth.removeAttribute("disabled");
|
||||
}
|
||||
if (dofocus)
|
||||
gSmtpUsername.focus();
|
||||
|
@ -160,6 +164,7 @@ function onUseUsername(checkbox, dofocus)
|
|||
gSmtpUsername.value = "";
|
||||
gSmtpUsername.setAttribute("disabled", "true");
|
||||
gSmtpUsernameLabel.setAttribute("disabled", "true");
|
||||
gSmtpUseSecAuth.setAttribute("disabled", "true");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
oncommand="onUseUsername(event.target,true);"
|
||||
prefattribute="value"
|
||||
prefstring="mail.smtpserver.%serverkey%.use_username"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
<vbox class="indent">
|
||||
<hbox align="center">
|
||||
<label id="smtpusernamelabel" value="&userName.label;"
|
||||
|
@ -103,6 +103,11 @@
|
|||
preftype="string"
|
||||
prefstring="mail.smtpserver.%serverkey%.username"/>
|
||||
</hbox>
|
||||
<checkbox id="smtp.useSecAuth"
|
||||
label="&useSecAuth.label;"
|
||||
accesskey="&useSecAuth.accesskey;"
|
||||
prefattribute="value"
|
||||
prefstring="mail.smtpserver.%serverkey%.useSecAuth"/>
|
||||
</vbox>
|
||||
</vbox>
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
interface nsIAuthPrompt;
|
||||
|
||||
[scriptable, uuid(eef39b32-9050-11db-92fa-000c6e0abfac)]
|
||||
[scriptable, uuid(5d03ff0f-90f3-11db-86bf-000c6e0abfac)]
|
||||
interface nsISmtpServer : nsISupports {
|
||||
|
||||
attribute string key; // unique identifier
|
||||
|
@ -56,7 +56,8 @@ interface nsISmtpServer : nsISupports {
|
|||
attribute string redirectorType;
|
||||
|
||||
attribute long authMethod;
|
||||
readonly attribute boolean trySecAuth;
|
||||
attribute boolean useSecAuth;
|
||||
attribute boolean trySecAuth;
|
||||
attribute long trySSL;
|
||||
readonly attribute string helloArgument;
|
||||
|
||||
|
|
|
@ -91,4 +91,8 @@
|
|||
#define NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_WITH_STARTTLS2 NS_MSG_GENERATE_FAILURE(12574)
|
||||
#define NS_ERROR_SENDING_RCPT_COMMAND NS_MSG_GENERATE_FAILURE(12575)
|
||||
|
||||
#endif /* _nsComposeStringBundle_H__ */
|
||||
#define NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_AUTH NS_MSG_GENERATE_FAILURE(12576)
|
||||
#define NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_INSECAUTH NS_MSG_GENERATE_FAILURE(12577)
|
||||
#define NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_SECAUTH NS_MSG_GENERATE_FAILURE(12578)
|
||||
|
||||
#endif /* _nsComposeStrings_H__ */
|
||||
|
|
|
@ -3754,7 +3754,10 @@ nsMsgComposeAndSend::DoDeliveryExitProcessing(nsIURI * aUri, nsresult aExitCode,
|
|||
if (aExitCode == NS_ERROR_SMTP_SEND_FAILED ||
|
||||
aExitCode == NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER ||
|
||||
aExitCode == NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_WITH_STARTTLS1 ||
|
||||
aExitCode == NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_WITH_STARTTLS2)
|
||||
aExitCode == NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_WITH_STARTTLS2 ||
|
||||
aExitCode == NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_AUTH ||
|
||||
aExitCode == NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_INSECAUTH ||
|
||||
aExitCode == NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_SECAUTH)
|
||||
FormatStringWithSMTPHostNameByID(aExitCode, getter_Copies(eMsg));
|
||||
else
|
||||
mComposeBundle->GetStringFromID(NS_ERROR_GET_CODE(aExitCode), getter_Copies(eMsg));
|
||||
|
|
|
@ -259,7 +259,8 @@ void nsSmtpProtocol::Initialize(nsIURI * aURL)
|
|||
m_prefAuthMethod = PREF_AUTH_NONE;
|
||||
m_usernamePrompted = PR_FALSE;
|
||||
m_prefTrySSL = PREF_SECURE_TRY_STARTTLS;
|
||||
m_prefTrySecAuth = PR_TRUE;
|
||||
m_prefUseSecAuth = PR_TRUE;
|
||||
m_prefTrySecAuth = PR_FALSE;
|
||||
m_tlsInitiated = PR_FALSE;
|
||||
|
||||
m_urlErrorState = NS_ERROR_FAILURE;
|
||||
|
@ -313,6 +314,7 @@ void nsSmtpProtocol::Initialize(nsIURI * aURL)
|
|||
if (smtpServer) {
|
||||
smtpServer->GetAuthMethod(&m_prefAuthMethod);
|
||||
smtpServer->GetTrySSL(&m_prefTrySSL);
|
||||
smtpServer->GetUseSecAuth(&m_prefUseSecAuth);
|
||||
smtpServer->GetTrySecAuth(&m_prefTrySecAuth);
|
||||
smtpServer->GetHelloArgument(getter_Copies(m_helloArgument));
|
||||
}
|
||||
|
@ -744,16 +746,7 @@ PRInt32 nsSmtpProtocol::SendEhloResponse(nsIInputStream * inputStream, PRUint32
|
|||
}
|
||||
else if (responseLine.Compare("AUTH", PR_TRUE, 4) == 0)
|
||||
{
|
||||
if (responseLine.Find("PLAIN", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_PLAIN_ENABLED);
|
||||
|
||||
if (responseLine.Find("LOGIN", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_LOGIN_ENABLED);
|
||||
|
||||
if (responseLine.Find("EXTERNAL", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_EXTERNAL_ENABLED);
|
||||
|
||||
if(m_prefTrySecAuth)
|
||||
if (m_prefUseSecAuth || m_prefTrySecAuth)
|
||||
{
|
||||
if (responseLine.Find("GSSAPI", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_GSSAPI_ENABLED);
|
||||
|
@ -764,7 +757,7 @@ PRInt32 nsSmtpProtocol::SendEhloResponse(nsIInputStream * inputStream, PRUint32
|
|||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
if (responseLine.Find("CRAM-MD5", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_CRAM_MD5_ENABLED);
|
||||
SetFlag(SMTP_AUTH_CRAM_MD5_ENABLED);
|
||||
|
||||
if (responseLine.Find("NTLM", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_NTLM_ENABLED);
|
||||
|
@ -772,6 +765,35 @@ PRInt32 nsSmtpProtocol::SendEhloResponse(nsIInputStream * inputStream, PRUint32
|
|||
if (responseLine.Find("MSN", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_MSN_ENABLED);
|
||||
}
|
||||
|
||||
if (m_prefTrySecAuth)
|
||||
{
|
||||
// use it instantly so that it isn't reprobed in case of STARTTLS
|
||||
m_prefTrySecAuth = PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsISmtpServer> smtpServer;
|
||||
m_runningURL->GetSmtpServer(getter_AddRefs(smtpServer));
|
||||
if (smtpServer)
|
||||
{
|
||||
// if we are in probe mode, save what we found out for the future
|
||||
m_prefUseSecAuth = TestFlag(SMTP_AUTH_SEC_ENABLED);
|
||||
smtpServer->SetUseSecAuth(m_prefUseSecAuth);
|
||||
// then disable probing
|
||||
smtpServer->SetTrySecAuth(m_prefTrySecAuth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_prefUseSecAuth)
|
||||
{
|
||||
if (responseLine.Find("PLAIN", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_PLAIN_ENABLED);
|
||||
|
||||
if (responseLine.Find("LOGIN", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_LOGIN_ENABLED);
|
||||
|
||||
if (responseLine.Find("EXTERNAL", PR_TRUE, 5) >= 0)
|
||||
SetFlag(SMTP_AUTH_EXTERNAL_ENABLED);
|
||||
}
|
||||
|
||||
// for use after mechs disabled fallbacks when login failed
|
||||
|
@ -787,7 +809,29 @@ PRInt32 nsSmtpProtocol::SendEhloResponse(nsIInputStream * inputStream, PRUint32
|
|||
startPos = endPos + 1;
|
||||
} while (endPos >= 0);
|
||||
|
||||
if(TestFlag(SMTP_EHLO_SIZE_ENABLED) &&
|
||||
/* check if the server supports at least one of the mechanisms
|
||||
the user wants us to use */
|
||||
if (m_prefAuthMethod == PREF_AUTH_ANY)
|
||||
{
|
||||
if (m_prefUseSecAuth)
|
||||
{
|
||||
if (!TestFlag(SMTP_AUTH_SEC_ENABLED))
|
||||
m_urlErrorState = NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_SECAUTH;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!TestFlag(SMTP_AUTH_INSEC_ENABLED))
|
||||
m_urlErrorState = NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_INSECAUTH;
|
||||
}
|
||||
|
||||
if (m_urlErrorState != NS_ERROR_FAILURE)
|
||||
{
|
||||
m_nextState = SMTP_ERROR_DONE;
|
||||
return NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER;
|
||||
}
|
||||
}
|
||||
|
||||
if (TestFlag(SMTP_EHLO_SIZE_ENABLED) &&
|
||||
m_sizelimit > 0 && (PRInt32)m_totalMessageSize > m_sizelimit)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
|
@ -879,7 +923,7 @@ PRInt32 nsSmtpProtocol::ProcessAuth()
|
|||
{
|
||||
m_nextState = SMTP_ERROR_DONE;
|
||||
m_urlErrorState = NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_WITH_STARTTLS2;
|
||||
return(NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER);
|
||||
return NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -899,22 +943,17 @@ PRInt32 nsSmtpProtocol::ProcessAuth()
|
|||
if (TestFlag(SMTP_AUTH_GSSAPI_ENABLED))
|
||||
m_nextState = SMTP_SEND_AUTH_GSSAPI_FIRST;
|
||||
else if (TestFlag(SMTP_AUTH_CRAM_MD5_ENABLED) ||
|
||||
TestFlag(SMTP_AUTH_NTLM_ENABLED) ||
|
||||
TestFlag(SMTP_AUTH_PLAIN_ENABLED))
|
||||
TestFlag(SMTP_AUTH_NTLM_ENABLED) ||
|
||||
TestFlag(SMTP_AUTH_PLAIN_ENABLED))
|
||||
m_nextState = SMTP_SEND_AUTH_LOGIN_STEP1;
|
||||
else if (TestFlag(SMTP_AUTH_LOGIN_ENABLED) ||
|
||||
TestFlag(SMTP_AUTH_MSN_ENABLED))
|
||||
else if (TestFlag(SMTP_AUTH_MSN_ENABLED) ||
|
||||
TestFlag(SMTP_AUTH_LOGIN_ENABLED))
|
||||
m_nextState = SMTP_SEND_AUTH_LOGIN_STEP0;
|
||||
/* potential security flaw when using DIGEST_MD5 (and maybe GSSAPI)
|
||||
* where not only the client is authenticated by the server
|
||||
* but also vice versa. Faked server could just not advertise
|
||||
* any mechanism to bypass authentication process.
|
||||
*/
|
||||
else
|
||||
{
|
||||
m_nextState = SMTP_SEND_HELO_RESPONSE;
|
||||
// fake to 250 because SendHeloResponse() tests for this
|
||||
m_responseCode = 250;
|
||||
m_nextState = SMTP_ERROR_DONE;
|
||||
m_urlErrorState = NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_AUTH;
|
||||
return NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_AUTH;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -990,8 +1029,8 @@ PRInt32 nsSmtpProtocol::AuthLoginResponse(nsIInputStream * stream, PRUint32 leng
|
|||
if (m_usernamePrompted)
|
||||
smtpServer->SetUsername("");
|
||||
|
||||
// Let's restore the original auth flags from SendEhloResponse so we can
|
||||
// try them again with new password and username
|
||||
// Let's restore the original auth flags from SendEhloResponse
|
||||
// so we can try them again with new password and username
|
||||
RestoreAuthFlags();
|
||||
// except for gssapi, which doesn't care about the new password.
|
||||
ClearFlag(SMTP_AUTH_GSSAPI_ENABLED);
|
||||
|
|
|
@ -83,33 +83,36 @@ SMTP_SEND_AUTH_GSSAPI_STEP // 25
|
|||
// state information about the connection (authentication, have we sent
|
||||
// commands, etc. I do not intend it to refer to protocol state)
|
||||
#define SMTP_PAUSE_FOR_READ 0x00000001 /* should we pause for the next read */
|
||||
#define SMTP_EHLO_DSN_ENABLED 0x00000002
|
||||
#define SMTP_AUTH_LOGIN_ENABLED 0x00000004
|
||||
#define SMTP_AUTH_PLAIN_ENABLED 0x00000008
|
||||
#define SMTP_AUTH_EXTERNAL_ENABLED 0x00000010
|
||||
#define SMTP_EHLO_STARTTLS_ENABLED 0x00000020
|
||||
#define SMTP_ESMTP_SERVER 0x00000002
|
||||
#define SMTP_EHLO_DSN_ENABLED 0x00000004
|
||||
#define SMTP_EHLO_STARTTLS_ENABLED 0x00000008
|
||||
#define SMTP_EHLO_SIZE_ENABLED 0x00000010
|
||||
|
||||
// if we are using a login redirection
|
||||
// and we are waiting for it to give us the
|
||||
// host and port to connect to, then this flag
|
||||
// will be set...
|
||||
#define SMTP_WAIT_FOR_REDIRECTION 0x00000040
|
||||
#define SMTP_WAIT_FOR_REDIRECTION 0x00000020
|
||||
// if we are using login redirection and we received a load Url
|
||||
// request while we were stil waiting for the redirection information
|
||||
// then we'll look in this field
|
||||
#define SMTP_LOAD_URL_PENDING 0x00000080
|
||||
#define SMTP_LOAD_URL_PENDING 0x00000040
|
||||
// if we are using login redirection, then this flag will be set.
|
||||
// Note, this is different than the flag for whether we are waiting
|
||||
// for login redirection information.
|
||||
#define SMTP_USE_LOGIN_REDIRECTION 0x00000100
|
||||
#define SMTP_ESMTP_SERVER 0x00000200
|
||||
#define SMTP_AUTH_CRAM_MD5_ENABLED 0x00000400
|
||||
#define SMTP_AUTH_DIGEST_MD5_ENABLED 0x00000800
|
||||
#define SMTP_AUTH_NTLM_ENABLED 0x00001000
|
||||
#define SMTP_AUTH_MSN_ENABLED 0x00002000
|
||||
#define SMTP_AUTH_ANY_ENABLED 0x0000BC1C
|
||||
#define SMTP_EHLO_SIZE_ENABLED 0x00004000
|
||||
#define SMTP_AUTH_GSSAPI_ENABLED 0x00008000
|
||||
#define SMTP_USE_LOGIN_REDIRECTION 0x00000080
|
||||
|
||||
#define SMTP_AUTH_LOGIN_ENABLED 0x00000100
|
||||
#define SMTP_AUTH_PLAIN_ENABLED 0x00000200
|
||||
#define SMTP_AUTH_EXTERNAL_ENABLED 0x00000400
|
||||
#define SMTP_AUTH_GSSAPI_ENABLED 0x00000800
|
||||
#define SMTP_AUTH_DIGEST_MD5_ENABLED 0x00001000
|
||||
#define SMTP_AUTH_CRAM_MD5_ENABLED 0x00002000
|
||||
#define SMTP_AUTH_NTLM_ENABLED 0x00004000
|
||||
#define SMTP_AUTH_MSN_ENABLED 0x00008000
|
||||
#define SMTP_AUTH_ANY_ENABLED 0x0000FF00
|
||||
#define SMTP_AUTH_INSEC_ENABLED 0x00000700
|
||||
#define SMTP_AUTH_SEC_ENABLED 0x0000F800
|
||||
|
||||
typedef enum _PrefAuthMethod {
|
||||
PREF_AUTH_NONE = 0,
|
||||
|
@ -185,11 +188,12 @@ private:
|
|||
// *** the following should move to the smtp server when we support
|
||||
// multiple smtp servers
|
||||
PRInt32 m_prefAuthMethod;
|
||||
PRBool m_prefUseSecAuth;
|
||||
PRBool m_prefTrySecAuth;
|
||||
PRBool m_usernamePrompted;
|
||||
PRInt32 m_prefTrySSL;
|
||||
PRBool m_tlsEnabled;
|
||||
|
||||
|
||||
PRBool m_tlsInitiated;
|
||||
|
||||
PRBool m_sendDone;
|
||||
|
@ -200,7 +204,7 @@ private:
|
|||
PRInt32 m_totalAmountWritten;
|
||||
#endif /* UNREADY_CODE */
|
||||
PRInt64 m_totalMessageSize;
|
||||
|
||||
|
||||
char *m_dataBuf;
|
||||
PRUint32 m_dataBufSize;
|
||||
|
||||
|
|
|
@ -214,18 +214,40 @@ nsSmtpServer::SetTrySSL(PRInt32 trySSL)
|
|||
return mPrefBranch->SetIntPref("try_ssl", trySSL);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSmtpServer::GetUseSecAuth(PRBool *useSecAuth)
|
||||
{
|
||||
nsresult rv;
|
||||
NS_ENSURE_ARG_POINTER(useSecAuth);
|
||||
rv = mPrefBranch->GetBoolPref("useSecAuth", useSecAuth);
|
||||
if (NS_FAILED(rv))
|
||||
mDefPrefBranch->GetBoolPref("useSecAuth", useSecAuth);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSmtpServer::SetUseSecAuth(const PRBool useSecAuth)
|
||||
{
|
||||
return mPrefBranch->SetBoolPref("useSecAuth", useSecAuth);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSmtpServer::GetTrySecAuth(PRBool *trySecAuth)
|
||||
{
|
||||
nsresult rv;
|
||||
NS_ENSURE_ARG_POINTER(trySecAuth);
|
||||
*trySecAuth = PR_TRUE;
|
||||
rv = mPrefBranch->GetBoolPref("trySecAuth", trySecAuth);
|
||||
if (NS_FAILED(rv))
|
||||
mDefPrefBranch->GetBoolPref("trySecAuth", trySecAuth);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSmtpServer::SetTrySecAuth(const PRBool trySecAuth)
|
||||
{
|
||||
return mPrefBranch->SetBoolPref("trySecAuth", trySecAuth);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSmtpServer::GetHelloArgument(char * *aHelloArgument)
|
||||
{
|
||||
|
|
|
@ -109,13 +109,13 @@ pref("mail.auth_login", true);
|
|||
pref("mail.default_drafts", ""); // empty string use default Drafts name;
|
||||
pref("mail.default_templates", ""); // empty string use default Templates name
|
||||
|
||||
// set to 0 if you don't want to ignore timestamp differences between
|
||||
// local mail folders and the value stored in the corresponding .msf file.
|
||||
// 0 was the default up to and including 1.5. I've made the default
|
||||
// be greater than one hour so daylight savings time changes don't affect us.
|
||||
// We will still always regenerate .msf files if the file size changes.
|
||||
pref("mail.db_timestamp_leeway", 4000);
|
||||
|
||||
// set to 0 if you don't want to ignore timestamp differences between
|
||||
// local mail folders and the value stored in the corresponding .msf file.
|
||||
// 0 was the default up to and including 1.5. I've made the default
|
||||
// be greater than one hour so daylight savings time changes don't affect us.
|
||||
// We will still always regenerate .msf files if the file size changes.
|
||||
pref("mail.db_timestamp_leeway", 4000);
|
||||
|
||||
// check all folders for new mail
|
||||
pref("mail.check_all_imap_folders_for_new", false);
|
||||
|
||||
|
@ -490,6 +490,7 @@ pref("mail.smtp.useMatchingDomainServer", false);
|
|||
pref("mail.smtp.useMatchingHostNameServer", false);
|
||||
|
||||
pref("mail.smtpserver.default.auth_method", 1); // auth any
|
||||
pref("mail.smtpserver.default.useSecAuth", false);
|
||||
pref("mail.smtpserver.default.trySecAuth", true);
|
||||
pref("mail.smtpserver.default.try_ssl", 0);
|
||||
|
||||
|
|
|
@ -4319,11 +4319,16 @@ to filter unwanted mail, and how phishing detection works.</p>
|
|||
<ol>
|
||||
<li>Click on any Mail window.</li>
|
||||
<li>From the Edit menu, choose Mail & Newsgroup Account Settings.</li>
|
||||
<li>Select Outgoing Server (SMTP) and set up as follows (If you are not sure
|
||||
which option to choose, check with your ISP or system administrator):</li>
|
||||
<li>Select Outgoing Server (SMTP) and either edit an existing server or
|
||||
add a new one. If you are not sure which option to choose, check with
|
||||
your ISP or system administrator)<br/>
|
||||
You can choose from these servers via the Outgoing Server dropdown in
|
||||
the <a href="#account_settings">Identity Settings</a>.</li>
|
||||
</ol>
|
||||
|
||||
<ul>
|
||||
<li><strong>Description</strong>: A short freetext description of that server
|
||||
configuration. This will show up as first part in the server list.</li>
|
||||
<li><strong>Server name</strong>: The SMTP server that will deliver your
|
||||
outgoing mail. To use a different SMTP server, change this field.</li>
|
||||
<li><strong>Port</strong>: The port on which the SMTP server will be
|
||||
|
@ -4335,6 +4340,10 @@ to filter unwanted mail, and how phishing detection works.</p>
|
|||
The first time you send mail, you will be prompted for your password. At
|
||||
that time you can instruct &brandShortName; to save your password for
|
||||
future sessions.</li>
|
||||
<li><strong>Use secure authentication</strong>: Choose this setting if you
|
||||
want to use secure mechanisms for logging in like CRAM-MD5. If you are
|
||||
unsure if your service supports this, contact your service provider or
|
||||
system administrator.</li>
|
||||
<li><strong>Use secure connection</strong>: There are two methods for
|
||||
establishing a secure connection to your outgoing server. Pick the one your
|
||||
server supports (if you make a choice for which your server is not configured,
|
||||
|
@ -4350,8 +4359,6 @@ to filter unwanted mail, and how phishing detection works.</p>
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Advanced</strong>: Click this button to set up additional SMTP
|
||||
servers or to change the default SMTP server.</li>
|
||||
</ul>
|
||||
|
||||
<p>[<a href="#mail_and_newsgroups_account_settings">Return to beginning of
|
||||
|
|
|
@ -253,6 +253,15 @@ sendAnyway=Send anyway
|
|||
## @name NS_ERROR_SENDING_RCPT_COMMAND
|
||||
12575=An error occurred while sending mail. The mail server responded: %1$s. Please check the message recipient %2$s and try again.
|
||||
|
||||
## @name NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_AUTH
|
||||
12576=An error occurred sending mail: Unable to authenticate to SMTP server %S. We failed with the available authentication mechanisms.
|
||||
|
||||
## @name NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_INSECAUTH
|
||||
12577=An error occurred sending mail: Unable to authenticate to SMTP server %S. The server does not support any compatible insecure authentication mechanism but you haven chosen insecure authentication.
|
||||
|
||||
## @name NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER_SECAUTH
|
||||
12578=An error occurred sending mail: Unable to authenticate to SMTP server %S. The server does not support any compatible secure authentication mechanism but you have chosen secure authentication.
|
||||
|
||||
## Strings use for the save message dialog shown when the user close a message compose window
|
||||
saveDlogTitle=Save Message
|
||||
saveDlogMessage=Message has not been sent. Do you want to save the message in the Drafts folder?
|
||||
|
|
|
@ -135,6 +135,8 @@ smtpServer-SecureConnection-Type_0=No
|
|||
smtpServer-SecureConnection-Type_1=STARTTLS, if available
|
||||
smtpServer-SecureConnection-Type_2=STARTTLS
|
||||
smtpServer-SecureConnection-Type_3=SMTP-over-SSL
|
||||
smtpServer-SecureAuthentication-Type-false=No
|
||||
smtpServer-SecureAuthentication-Type-true=Yes
|
||||
smtpServers-confirmServerDeletionTitle=Delete Server
|
||||
smtpServers-confirmServerDeletion=Are you sure you want to delete the server: \n %S?
|
||||
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
<!ENTITY serverPort.label "Port: ">
|
||||
<!ENTITY userName.label "User Name: ">
|
||||
<!ENTITY useSecureConnection.label "Secure Connection: ">
|
||||
|
||||
<!ENTITY useSecureAuthentication.label "Secure Authentication: ">
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
<!ENTITY alwaysUseUsername.accesskey "U">
|
||||
<!ENTITY userName.label "User Name:">
|
||||
<!ENTITY userName.accesskey "m">
|
||||
<!ENTITY useSecAuth.label "Use secure authentication">
|
||||
<!ENTITY useSecAuth.accesskey "i">
|
||||
<!ENTITY isSecure.label "Use secure connection:">
|
||||
<!ENTITY neverSecure.label "No">
|
||||
<!ENTITY neverSecure.accesskey "N">
|
||||
|
|
Загрузка…
Ссылка в новой задаче