KIMAP::AppendJob Class

Appends a message to a mailbox. More...

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

Public Functions

AppendJob(KIMAP::Session *session)
virtual ~AppendJob() override
QByteArray content() const
QList<QByteArray> flags() const
QDateTime internalDate() const
QString mailBox() const
void setContent(const QByteArray &content)
void setFlags(const QList<QByteArray> &flags)
void setInternalDate(const QDateTime &internalDate)
void setMailBox(const QString &mailBox)
qint64 uid() const

Detailed Description

This job can only be run when the session is in the authenticated (or selected) state.

If the server supports ACLs, the user will need the Acl::Insert right on the mailbox.

If flags contains \Recent, it won't be pushed to the server. This is to protect clients from mistake making them violate the RFC which mandates that clients shouldn't fiddle with this flag.

Member Function Documentation

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

[override virtual noexcept] AppendJob::~AppendJob()

QByteArray AppendJob::content() const

The content that the message will have.

See also setContent().

QList<QByteArray> AppendJob::flags() const

The flags that will be set on the appended message.

See also setFlags().

QDateTime AppendJob::internalDate() const

The internal date that will be set on the appended message.

See also setInternalDate().

QString AppendJob::mailBox() const

The mailbox that the message will be appended to.

See also setMailBox().

void AppendJob::setContent(const QByteArray &content)

The content of the message.

This should be in RFC-2822 format, although some required header lines may be omitted in certain cases, for example when appending to a Drafts folder.

content usually an RFC-2822 message

See also content().

void AppendJob::setFlags(const QList<QByteArray> &flags)

Set the flags that should be applied to the appended message.

flags a list of flags

See also flags().

void AppendJob::setInternalDate(const QDateTime &internalDate)

Set the internal date that should be applied to the appended message.

This is the date/time the IMAP server should set internally for the appended message. See https://tools.ietf.org/html/rfc3501#section-6.3.11

If this is not set, the server will use the current date/time.

internalDate the internal date

See also internalDate().

void AppendJob::setMailBox(const QString &mailBox)

Set the mailbox to append the message to.

If the mailbox does not exist, it will not automatically be created and the command will fail.

mailBox the (unquoted) name of the mailbox

See also mailBox().

qint64 AppendJob::uid() const

The UID of the new message.

This will be zero if it is unknown.

The UID will not be known until the job has been successfully executed, and it will only be known at all if the server supports the UIDPLUS extension (RFC 4315).