diff options
Diffstat (limited to 'kmail/accountwizard.cpp')
-rw-r--r-- | kmail/accountwizard.cpp | 88 |
1 files changed, 45 insertions, 43 deletions
diff --git a/kmail/accountwizard.cpp b/kmail/accountwizard.cpp index b050275c7..f94dd0036 100644 --- a/kmail/accountwizard.cpp +++ b/kmail/accountwizard.cpp @@ -276,7 +276,8 @@ void AccountWizard::setupServerInformationPage() mIncomingServerWdg = new TQVBox( mServerInformationPage ); mIncomingServer = new KLineEdit( mIncomingServerWdg ); - mIncomingUseSSL = new TQCheckBox( i18n( "Use secure connection (SSL)" ), mIncomingServerWdg ); + mIncomingUseTLS = new TQCheckBox( i18n( "Use secure connection (SSL/TLS)" ), mIncomingServerWdg ); + mIncomingUseTLS->setChecked(true); mIncomingLocationWdg = new TQHBox( mServerInformationPage ); mIncomingLocation = new KLineEdit( mIncomingLocationWdg ); @@ -296,8 +297,9 @@ void AccountWizard::setupServerInformationPage() layout->addWidget( label, 1, 0 ); layout->addWidget( mOutgoingServer, 1, 1 ); - mOutgoingUseSSL = new TQCheckBox( i18n( "Use secure connection (SSL)" ), mServerInformationPage ); - layout->addWidget( mOutgoingUseSSL, 2, 1 ); + mOutgoingUseTLS = new TQCheckBox( i18n( "Use secure connection (SSL/TLS)" ), mServerInformationPage ); + mOutgoingUseTLS->setChecked(true); + layout->addWidget( mOutgoingUseTLS, 2, 1 ); mLocalDelivery = new TQCheckBox( i18n( "Use local delivery" ), mServerInformationPage ); @@ -394,7 +396,7 @@ void AccountWizard::createTransport() mTransportInfo->user = mLoginName->text(); mTransportInfo->setPasswd( mPassword->text() ); - int port = (mOutgoingUseSSL->isChecked() ? 465 : 25); + int port = (mOutgoingUseTLS->isChecked() ? 465 : 25); checkSmtpCapabilities( mTransportInfo->host, port ); } } @@ -449,7 +451,7 @@ void AccountWizard::createAccount() acct->setLogin( mLoginName->text() ); acct->setPasswd( mPassword->text() ); acct->setHost( mIncomingServer->text() ); - port = mIncomingUseSSL->isChecked() ? 995 : 110; + port = mIncomingUseTLS->isChecked() ? 995 : 110; break; } case AccountTypeBox::IMAP: @@ -459,7 +461,7 @@ void AccountWizard::createAccount() acct->setLogin( mLoginName->text() ); acct->setPasswd( mPassword->text() ); acct->setHost( mIncomingServer->text() ); - port = mIncomingUseSSL->isChecked() ? 993 : 143; + port = mIncomingUseTLS->isChecked() ? 993 : 143; break; } case AccountTypeBox::dIMAP: @@ -469,7 +471,7 @@ void AccountWizard::createAccount() acct->setLogin( mLoginName->text() ); acct->setPasswd( mPassword->text() ); acct->setHost( mIncomingServer->text() ); - port = mIncomingUseSSL->isChecked() ? 993 : 143; + port = mIncomingUseTLS->isChecked() ? 993 : 143; break; } case AccountTypeBox::Maildir: @@ -516,7 +518,7 @@ void AccountWizard::checkPopCapabilities( const TQString &server, int port ) connect( mServerTest, TQ_SIGNAL( capabilities( const TQStringList&, const TQStringList& ) ), this, TQ_SLOT( popCapabilities( const TQStringList&, const TQStringList& ) ) ); - mAuthInfoLabel = createInfoLabel( i18n( "Check for supported security capabilities of %1..." ).arg( server ) ); + mAuthInfoLabel = createInfoLabel( i18n( "Checking for supported security capabilities of %1..." ).arg( server ) ); } void AccountWizard::checkImapCapabilities( const TQString &server, int port ) @@ -527,7 +529,7 @@ void AccountWizard::checkImapCapabilities( const TQString &server, int port ) connect( mServerTest, TQ_SIGNAL( capabilities( const TQStringList&, const TQStringList& ) ), this, TQ_SLOT( imapCapabilities( const TQStringList&, const TQStringList& ) ) ); - mAuthInfoLabel = createInfoLabel( i18n( "Check for supported security capabilities of %1..." ).arg( server ) ); + mAuthInfoLabel = createInfoLabel( i18n( "Checking for supported security capabilities of %1..." ).arg( server ) ); } void AccountWizard::checkSmtpCapabilities( const TQString &server, int port ) @@ -540,29 +542,29 @@ void AccountWizard::checkSmtpCapabilities( const TQString &server, int port ) this, TQ_SLOT( smtpCapabilities( const TQStringList&, const TQStringList&, const TQString&, const TQString&, const TQString& ) ) ); - mAuthInfoLabel = createInfoLabel( i18n( "Check for supported security capabilities of %1..." ).arg( server ) ); + mAuthInfoLabel = createInfoLabel( i18n( "Checking for supported security capabilities of %1..." ).arg( server ) ); } void AccountWizard::popCapabilities( const TQStringList &capaNormalList, - const TQStringList &capaSSLList ) + const TQStringList &capaTLSList ) { uint capaNormal = popCapabilitiesFromStringList( capaNormalList ); - uint capaTLS = 0; + uint capaSTARTTLS = 0; if ( capaNormal & STLS ) - capaTLS = capaNormal; + capaSTARTTLS = capaNormal; - uint capaSSL = popCapabilitiesFromStringList( capaSSLList ); + uint capaTLS = popCapabilitiesFromStringList( capaTLSList ); KMail::NetworkAccount *account = static_cast<KMail::NetworkAccount*>( mAccount ); - bool useSSL = !capaSSLList.isEmpty(); - bool useTLS = capaTLS != 0; + bool useTLS = !capaTLSList.isEmpty(); + bool useSTARTTLS = capaSTARTTLS != 0; - account->setUseSSL( useSSL ); + account->setUseSTARTTLS( useSTARTTLS ); account->setUseTLS( useTLS ); - uint capa = (useSSL ? capaSSL : (useTLS ? capaTLS : capaNormal)); + uint capa = (useTLS ? capaTLS : (useSTARTTLS ? capaSTARTTLS : capaNormal)); if ( capa & Plain ) account->setAuth( "PLAIN" ); @@ -581,7 +583,7 @@ void AccountWizard::popCapabilities( const TQStringList &capaNormalList, else account->setAuth( "USER" ); - account->setPort( useSSL ? 995 : 110 ); + account->setPort( useTLS ? 995 : 110 ); mServerTest->deleteLater(); mServerTest = 0; @@ -594,24 +596,24 @@ void AccountWizard::popCapabilities( const TQStringList &capaNormalList, void AccountWizard::imapCapabilities( const TQStringList &capaNormalList, - const TQStringList &capaSSLList ) + const TQStringList &capaTLSList ) { uint capaNormal = imapCapabilitiesFromStringList( capaNormalList ); - uint capaTLS = 0; + uint capaSTARTTLS = 0; if ( capaNormal & STARTTLS ) - capaTLS = capaNormal; + capaSTARTTLS = capaNormal; - uint capaSSL = imapCapabilitiesFromStringList( capaSSLList ); + uint capaTLS = imapCapabilitiesFromStringList( capaTLSList ); KMail::NetworkAccount *account = static_cast<KMail::NetworkAccount*>( mAccount ); - bool useSSL = !capaSSLList.isEmpty(); - bool useTLS = (capaTLS != 0); + bool useTLS = !capaTLSList.isEmpty(); + bool useSTARTTLS = (capaSTARTTLS != 0); - account->setUseSSL( useSSL ); + account->setUseSTARTTLS( useSTARTTLS ); account->setUseTLS( useTLS ); - uint capa = (useSSL ? capaSSL : (useTLS ? capaTLS : capaNormal)); + uint capa = (useTLS ? capaTLS : (useSTARTTLS ? capaSTARTTLS : capaNormal)); if ( capa & CRAM_MD5 ) account->setAuth( "CRAM-MD5" ); @@ -630,7 +632,7 @@ void AccountWizard::imapCapabilities( const TQStringList &capaNormalList, else account->setAuth( "*" ); - account->setPort( useSSL ? 993 : 143 ); + account->setPort( useTLS ? 993 : 143 ); mServerTest->deleteLater(); mServerTest = 0; @@ -642,36 +644,36 @@ void AccountWizard::imapCapabilities( const TQStringList &capaNormalList, } void AccountWizard::smtpCapabilities( const TQStringList &capaNormal, - const TQStringList &capaSSL, + const TQStringList &capaTLS, const TQString &authNone, - const TQString &authSSL, - const TQString &authTLS ) + const TQString &authTLS, + const TQString &authSTARTTLS ) { - uint authBitsNone, authBitsSSL, authBitsTLS; + uint authBitsNone, authBitsTLS, authBitsSTARTTLS; - if ( authNone.isEmpty() && authSSL.isEmpty() && authTLS.isEmpty() ) { + if ( authNone.isEmpty() && authTLS.isEmpty() && authSTARTTLS.isEmpty() ) { // slave doesn't seem to support "* AUTH METHODS" metadata (or server can't do AUTH) authBitsNone = authMethodsFromStringList( capaNormal ); if ( capaNormal.findIndex( "STARTTLS" ) != -1 ) - authBitsTLS = authBitsNone; + authBitsSTARTTLS = authBitsNone; else - authBitsTLS = 0; - authBitsSSL = authMethodsFromStringList( capaSSL ); + authBitsSTARTTLS = 0; + authBitsTLS = authMethodsFromStringList( capaTLS ); } else { authBitsNone = authMethodsFromString( authNone ); - authBitsSSL = authMethodsFromString( authSSL ); authBitsTLS = authMethodsFromString( authTLS ); + authBitsSTARTTLS = authMethodsFromString( authSTARTTLS ); } uint authBits = 0; if ( capaNormal.findIndex( "STARTTLS" ) != -1 ) { - mTransportInfo->encryption = "TLS"; + mTransportInfo->encryption = KMTransportInfo::STARTTLSEncryption; + authBits = authBitsSTARTTLS; + } else if ( !capaTLS.isEmpty() ) { + mTransportInfo->encryption = KMTransportInfo::TLSEncryption; authBits = authBitsTLS; - } else if ( !capaSSL.isEmpty() ) { - mTransportInfo->encryption = "SSL"; - authBits = authBitsSSL; } else { - mTransportInfo->encryption = "NONE"; + mTransportInfo->encryption = KMTransportInfo::NoEncryption; authBits = authBitsNone; } @@ -688,7 +690,7 @@ void AccountWizard::smtpCapabilities( const TQStringList &capaNormal, else mTransportInfo->authType = "PLAIN"; - mTransportInfo->port = ( !capaSSL.isEmpty() ? "465" : "25" ); + mTransportInfo->port = ( !capaTLS.isEmpty() ? "465" : "25" ); mServerTest->deleteLater(); mServerTest = 0; |