KIMAP::LoginJob Class

The LoginJob class. More...

Header: #include <KIMAP/LoginJob>
CMake: find_package(KPim6IMAP REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::IMAP)
Inherits: KIMAP::Job

Public Types

enum AuthenticationMode { ClearText, Login, Plain, CramMD5, DigestMD5, …, XOAuth2 }
enum EncryptionMode { Unencrypted, SSLorTLS, STARTTLS }
enum ErrorCode { ERR_COULD_NOT_CONNECT }

Public Functions

LoginJob(KIMAP::Session *session)
QString authorizationName() const
KIMAP::LoginJob::EncryptionMode encryptionMode()
QString password() const
QString serverGreeting() const
void setAuthenticationMode(KIMAP::LoginJob::AuthenticationMode mode)
void setAuthorizationName(const QString &authorizationName)
void setEncryptionMode(KIMAP::LoginJob::EncryptionMode mode)
void setPassword(const QString &password)
void setUserName(const QString &userName)
QString userName() const

Detailed Description

Member Type Documentation

enum LoginJob::AuthenticationMode

ConstantValue
KIMAP::LoginJob::ClearText0
KIMAP::LoginJob::Login1
KIMAP::LoginJob::Plain2
KIMAP::LoginJob::CramMD53
KIMAP::LoginJob::DigestMD54
KIMAP::LoginJob::NTLM5
KIMAP::LoginJob::GSSAPI6
KIMAP::LoginJob::Anonymous7
KIMAP::LoginJob::XOAuth28

enum LoginJob::EncryptionMode

*

ConstantValueDescription
KIMAP::LoginJob::Unencrypted0*
KIMAP::LoginJob::SSLorTLS1Use SSL/TLS encryption, KIMAP will automatically negotiate the best supported encryption protocol. *
KIMAP::LoginJob::STARTTLS2Use STARTTLS to upgrade an initially plaintext connection to e ncrypted connection. KIMAP will automatically negotiate the best supported encryption protocol.

enum LoginJob::ErrorCode

ConstantValue
KIMAP::LoginJob::ERR_COULD_NOT_CONNECTKJob::UserDefinedError + 23

Member Function Documentation

[explicit] LoginJob::LoginJob(KIMAP::Session *session)

QString LoginJob::authorizationName() const

Get the authorization identity.

See also setAuthorizationName().

KIMAP::LoginJob::EncryptionMode LoginJob::encryptionMode()

Returns the currently active encryption mode

See also setEncryptionMode().

QString LoginJob::password() const

See also setPassword().

QString LoginJob::serverGreeting() const

Returns the server greeting, in case of a successful login.

If the login wasn't successful, this method returns an empty string. Use errorString() to get the error message in this case.

Note that the content of this response is not defined by the IMAP protocol and is implementation-dependent.

void LoginJob::setAuthenticationMode(KIMAP::LoginJob::AuthenticationMode mode)

void LoginJob::setAuthorizationName(const QString &authorizationName)

Set the authorization identity.

If set, proxy-authentication according to RFC4616 will be used.

Note that this feature only works with the "PLAIN" AuthenticationMode.

The authorizationName will be used together with the password() to get authenticated as userName() by the authorization of the provided credentials. This allows to login as a user using the admin credentials and the users name.

See also authorizationName().

void LoginJob::setEncryptionMode(KIMAP::LoginJob::EncryptionMode mode)

Set the encryption mode for the connection.

In case an encryption mode is set, the caller MUST check the encryptionMode() result after executing the job, to see if the connection is encrypted or not (e.g handshaking failed).

mode the encryption mode, see EncryptionModes

See also encryptionMode().

void LoginJob::setPassword(const QString &password)

See also password().

void LoginJob::setUserName(const QString &userName)

See also userName().

QString LoginJob::userName() const

See also setUserName().