Warning, /pim/kimap2/README.md is written in an unsupported language. File is not indexed.
0001 # KIMAP2 #
0002
0003 This library provides a job-based API for interacting with an IMAP4rev1 server.
0004 It manages connections, encryption and parameter quoting and encoding, but
0005 otherwise provides quite a low-level interface to the protocol. This library
0006 does not implement an IMAP client; it merely makes it easier to do so.
0007
0008 Users should be familiar with [RFC 3501](http://www.apps.ietf.org/rfc/rfc3501.html "IMAP 4rev1")
0009 as well as [other related RFCs](http://www.iana.org/assignments/imap4-capabilities)
0010 although the library hides some of the nastier details like the encoding and quoting of
0011 strings.
0012
0013 For development coordination see: https://phabricator.kde.org/tag/kimap2/
0014
0015 ## Porting from KIMAP(1) ##
0016 The following changes can affect you when porting from KIMAP (this is probably an incomplete list, so beware)
0017 * Reading from the socket and parsing no longer happens in a separate thread. If you don't want to block the main process execute the complete job in a thread.
0018 * Most deprecated API's have been removed. See especially SearchJob, ListJob and FetchJob.
0019 * Due to the removal of KTcpSocket we no longer integrate with KSslCertificateManager. If that is wanted use Session::sslErrors signal to react to ssl problems:
0020
0021 QObject::connect(mSession, &KIMAP2::Session::sslErrors, [this](const QList<QSslError> &errors) {
0022 SinkLog() << "Received ssl error: " << errors;
0023 mSession->ignoreErrors(errors);
0024 });
0025
0026 QSslSocket::addDefaultCaCertificate can be used to add additional certificates to be used.
0027
0028 * The LoginJob API changed.
0029
0030 ## Versioning and branching ##
0031 Development happens in master. There is one release branch per minor version (if required).
0032 Every release is tagged with a tag of the form "v.$MAJOR.$MINOR.$PATCH".
0033
0034 ## Releases ##
0035 KIMAP2 is released as required and does not follow a specific release schedule.
0036 Releases *always* happen directly from a release tag.
0037
0038 A tarball can be created like so:
0039 git archive --format=tar.xz --prefix=kimap2-0.1.1/ v0.1.1 > kimap2-0.1.1.tar.xz
0040
0041 You may need to add the following to your ~/.gitconfig for the xz compression to be available:
0042 [tar "tar.xz"]
0043 command = xz -c
0044
0045 Generate a checksum to be included in the announcement:
0046 sha256sum kimap2-0.1.1.tar.xz
0047
0048 Tarballs should be uploaded to unstable/kimap2/$VERSION/src/kimap2-$version.tar.xz
0049 curl -T kimap2-0.1.0.tar.xz ftp://upload.kde.org/incoming/
0050
0051 Request the move to the target location via sysadmin ticket.
0052
0053 See ftp://upload.kde.org/README
0054
0055 For more information see techbase.kde.org/ReleasingExtragearSoftware
0056
0057 ## Key changes from KIMAP(1) ##
0058
0059 These are some of larger changes that spawned KIMAP2:
0060
0061 * KIMAP2 is now threading free:
0062 There no longer is a dedicated thread for each socket. The reasoning for
0063 this is manyfold:
0064 * The threading strategy should be up to the application. The
0065 current design imposes additional threads in any case.
0066 * The threading resulted in lot's of subtle bugs and code-complexity
0067 overhead for the synchronization.
0068 * The whole design revolved around the idea that by running the
0069 parser in a thread the parser can be blocking and the network will
0070 always be the limiting factor. That assumption is not necessarily
0071 true and the parser starts to behave very badly if we get data
0072 faster than we can process it (The internal buffer will get large
0073 and a majority of time will be spent on memcopying during the trim()
0074 call).
0075 * This design doesn't allow the consumer to regulate the amount of
0076 data that enters the system. It reads as much into memory as it can,
0077 which again assumes the network is the slowest part.
0078 * During benchmarking of Sink the parser actually became the
0079 bottleneck of the imap resource (because of the pathological
0080 behaviour with memcopy in trim()).
0081 All of this directly leads to the next point.
0082
0083 * We have now a non-blocking parser:
0084 * The parser operates with two buffers to emulate a ringbuffer =>
0085 fixed memory usage (except for some dynamic allocation for large
0086 literals).
0087 * The parser never reads more data than it can process => If we
0088 can't process fast enough the socket buffer will eventually fill up,
0089 resulting in the server eventually stopping to send more data. Which
0090 is how the network stack is supposed to work IMO.
0091 * We open up possibilities for new streaming API to directly stream
0092 i.e. attachments to disk.
0093 * This resulted in the parser mostly vanishing from benchmarks and
0094 memcpy to vanish entirely.
0095
0096 * We no longer depend on ki18n:
0097 * This is a protocol implementation and not a place for translated
0098 strings.
0099
0100 * We no longer depend on kio:
0101 * This was used for ktcpsocket only, and the only remaining benefit
0102 of that was the KSslCertificateManager integration. This can easily
0103 be readded externally by implementing the Session::sslErrors
0104 callback and the Session::ignoreErrors function, as well as
0105 QSslSOckets default ca certificate functions. (We may want to extend
0106 the API there a bit).
0107 * KIO has a whole slew of unrelated dependencies so this was an
0108 important step to make KIMAP2 more selfcontained.
0109
0110 * I got rid of a lot of the result batching code:
0111 * It complicated the code and was an optimization at the wrong level
0112 IMO to save a couple of function calls.
0113
0114 * Less overloaded result signals with lot's of parameters. One signal
0115 with a result struct containing all data.
0116
0117 * The login job has received an overhaul.
0118 * Removed the slightly confused EncryptionMode names that sometime
0119 mixed the excryption and the use of starttls (which are two largely
0120 unrelated things).
0121 * Cleaned up the login logic which was a very complex statemachine
0122 scattered accross different classes and is now only a complex
0123 statemachine scattered over fewer classes =(
0124 * Fixed a potential race-condition where we would send a CAPABILITY
0125 request before receiving the greeting, which some servers seem to
0126 handle anyways but some don't.
0127 * Removed the encryption negotation which is handled by QSslSocket
0128 according to the provided settings, and otherwise fails as it
0129 should.
0130