Changeset View
Changeset View
Standalone View
Standalone View
libksieve/ksieveui/util/util.cpp
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | if ( interface->sieveReuseConfig() ) { | ||||
const QString resultSafety = interface->safety(); | const QString resultSafety = interface->safety(); | ||||
if ( resultSafety == QLatin1String("None")) | if ( resultSafety == QLatin1String("None")) | ||||
u.addQueryItem( QLatin1String("x-allow-unencrypted"), QLatin1String("true") ); | u.addQueryItem( QLatin1String("x-allow-unencrypted"), QLatin1String("true") ); | ||||
u.setFileName( interface->sieveVacationFilename() ); | u.setFileName( interface->sieveVacationFilename() ); | ||||
return u; | return u; | ||||
} else { | } else { | ||||
KUrl u( interface->sieveAlternateUrl() ); | KUrl u( interface->sieveAlternateUrl() ); | ||||
const QString resultSafety = interface->safety(); | const QString resultSafety = interface->safety(); | ||||
if (u.protocol().isEmpty() || u.port() < 1) { | |||||
kWarning() << "Invalid sieve url " << u; | |||||
mollekopf: This will clear the port even if it's set. So in this setup you'd even have to specify the… | |||||
Not Done Inline Actionsmoved this logic about fixing the alternateURL to the writer in kdepim-runtime, this makes it much more easier to handle it correctly. See D148 knauss: moved this logic about fixing the alternateURL to the writer in kdepim-runtime, this makes it… | |||||
Not Done Inline ActionskFatal will crash the application, definitely not what we want. mollekopf: kFatal will crash the application, definitely not what we want. | |||||
Not Done Inline ActionsPerhaps kWarning and return KUrl(); mollekopf: Perhaps kWarning and return KUrl(); | |||||
return KUrl(); | |||||
} | |||||
if ( u.protocol().toLower() == QLatin1String("sieve") && ( resultSafety == QLatin1String("None") ) && u.queryItem(QLatin1String("x-allow-unencrypted")).isEmpty() ) | if ( u.protocol().toLower() == QLatin1String("sieve") && ( resultSafety == QLatin1String("None") ) && u.queryItem(QLatin1String("x-allow-unencrypted")).isEmpty() ) | ||||
u.addQueryItem( QLatin1String("x-allow-unencrypted"), QLatin1String("true") ); | u.addQueryItem( QLatin1String("x-allow-unencrypted"), QLatin1String("true") ); | ||||
if (u.queryItem(QLatin1String("x-mech")).isEmpty()) { | |||||
QString authStr; | |||||
switch( interface->authentication() ) { | |||||
case MailTransport::Transport::EnumAuthenticationType::CLEAR: | |||||
case MailTransport::Transport::EnumAuthenticationType::PLAIN: | |||||
authStr = QLatin1String("PLAIN"); | |||||
break; | |||||
case MailTransport::Transport::EnumAuthenticationType::LOGIN: | |||||
authStr = QLatin1String("LOGIN"); | |||||
break; | |||||
case MailTransport::Transport::EnumAuthenticationType::CRAM_MD5: | |||||
authStr = QLatin1String("CRAM-MD5"); | |||||
break; | |||||
case MailTransport::Transport::EnumAuthenticationType::DIGEST_MD5: | |||||
authStr = QLatin1String("DIGEST-MD5"); | |||||
break; | |||||
case MailTransport::Transport::EnumAuthenticationType::GSSAPI: | |||||
authStr = QLatin1String("GSSAPI"); | |||||
break; | |||||
case MailTransport::Transport::EnumAuthenticationType::ANONYMOUS: | |||||
authStr = QLatin1String("ANONYMOUS"); | |||||
break; | |||||
default: | |||||
authStr = QLatin1String("PLAIN"); | |||||
break; | |||||
} | |||||
u.addQueryItem( QLatin1String("x-mech"), authStr ); | |||||
} | |||||
const QString resultCustomAuthentication = interface->sieveCustomAuthentification(); | const QString resultCustomAuthentication = interface->sieveCustomAuthentification(); | ||||
if (resultCustomAuthentication == QLatin1String("ImapUserPassword")) { | if (resultCustomAuthentication == QLatin1String("ImapUserPassword")) { | ||||
u.setUserName( interface->userName() ); | u.setUserName( interface->userName() ); | ||||
QDBusInterface resourceSettings( QLatin1String( "org.freedesktop.Akonadi.Resource." ) + identifier, QLatin1String("/Settings"), QLatin1String("org.kde.Akonadi.Imap.Wallet") ); | QDBusInterface resourceSettings( QLatin1String( "org.freedesktop.Akonadi.Resource." ) + identifier, QLatin1String("/Settings"), QLatin1String("org.kde.Akonadi.Imap.Wallet") ); | ||||
QString pwd; | QString pwd; | ||||
QDBusReply<QString> replyPass = resourceSettings.call( QLatin1String("password") ); | QDBusReply<QString> replyPass = resourceSettings.call( QLatin1String("password") ); | ||||
if ( replyPass.isValid() ) { | if ( replyPass.isValid() ) { | ||||
pwd = replyPass; | pwd = replyPass; | ||||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
QString n = name.split(QLatin1Char('.')).first().toLower(); | QString n = name.split(QLatin1Char('.')).first().toLower(); | ||||
if (n == QLatin1String("master") || | if (n == QLatin1String("master") || | ||||
n == QLatin1String("user") || | n == QLatin1String("user") || | ||||
n == QLatin1String("management")) { | n == QLatin1String("management")) { | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
No newline at end of file |
This will clear the port even if it's set. So in this setup you'd even have to specify the whole magic string, or hope that the default port is correct. Please keep the port even if the protocol is empty.