KIMAP::MoveJob Class

Moves messages from current mailbox to another. More...

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

Public Functions

MoveJob(KIMAP::Session *session)
virtual ~MoveJob() override
bool isUidBased() const
QString mailBox() const
KIMAP::ImapSet resultingUids() const
KIMAP::ImapSet sequenceSet() const
void setMailBox(const QString &mailbox)
void setSequenceSet(const KIMAP::ImapSet &set)
void setUidBased(bool uidBased)

Detailed Description

Note that move functionality is not specified in the base IMAP protocol and is defined as an extension in RFC6851. That means that the MoveJob can only be used when the server lists "MOVE" in response to CAPABILITY command.

Unlike the traditional emulation of moving messages, i.e. COPY + STORE + EXPUNGE, MOVE guarantees the transaction to be atomic on the server.

Member Function Documentation

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

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

bool MoveJob::isUidBased() const

How to interpret the sequence set.

Returns if true the result of sequenceSet() should be interpreted as UIDs, if false it should be interpreted as sequence numbers

QString MoveJob::mailBox() const

The destination mailbox

See also setMailBox().

KIMAP::ImapSet MoveJob::resultingUids() const

The UIDs of the moved messages in the destination mailbox.

This will be an empty set if no messages have been moved yet or if the server does not support the UIDPLUS extension.

KIMAP::ImapSet MoveJob::sequenceSet() const

The messages that will be moved.

isUidBased() can be used to check whether the ImapSet contains sequence numbers or UIDs.

Returns the sequence numbers or UIDs of the messages to be moved

See also setSequenceSet().

void MoveJob::setMailBox(const QString &mailbox)

Set the destination mailbox

If the mailbox does not exist, the server should not create it automatically and the job should fail. Note, however, that a conforming server may create the mailbox automatically.

mailbox the (unquoted) name of the mailbox where the messages should be moved to

See also mailBox().

void MoveJob::setSequenceSet(const KIMAP::ImapSet &set)

Sets the messages to be moved,

If sequence numbers are given, isUidBased() should be false. If UIDs are given, isUidBased() should be true.

set the sequence numbers or UIDs of the messages to be moved

See also sequenceSet().

void MoveJob::setUidBased(bool uidBased)

Set how the sequence set should be interpreted.

uidBased if true the argument to setSequenceSet will be interpreted as UIDs, if false it will be interpreted as sequence numbers

See also isUidBased().