KIMAP::CopyJob Class

Copies one or more messages to another mailbox. More...

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

Public Functions

CopyJob(KIMAP::Session *session)
virtual ~CopyJob() 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)

Reimplemented Protected Functions

virtual void doStart() override
virtual void handleResponse(const KIMAP::Response &response) override

Detailed Description

This job can only be run when the session is in the selected state.

If the server supports ACLs, the user will need the Acl::Insert right on the target mailbox. In order to preserve message flags, the user may also need some combination of Acl::DeleteMessage, Acl::KeepSeen and Acl::Write on the target mailbox.

Member Function Documentation

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

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

[override virtual protected] void CopyJob::doStart()

[override virtual protected] void CopyJob::handleResponse(const KIMAP::Response &response)

bool CopyJob::isUidBased() const

How to interpret the sequence set.

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

QString CopyJob::mailBox() const

The destination mailbox

See also setMailBox().

KIMAP::ImapSet CopyJob::resultingUids() const

The UIDs of the new copies of the messages

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

KIMAP::ImapSet CopyJob::sequenceSet() const

The messages that will be copied.

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 copied

See also setSequenceSet().

void CopyJob::setMailBox(const QString &mailBox)

Sets 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 copied to

See also mailBox().

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

Sets the messages to be copied

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

RFC 3501 is unclear as to what should happen if invalid sequence numbers are passed. If non-existent UIDs are passed, they will be ignored.

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

See also sequenceSet().

void CopyJob::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().