summaryrefslogtreecommitdiffstats
path: root/src/libraries
Commit message (Collapse)AuthorAgeFilesLines
...
* Reset parts when setting a bodyDamien Caliste2024-02-261-1/+10
| | | | | | | | | | | | | | | | | | | | | Currently, setBody() is called to set content to an empty part. Everywhere in the code, this method is called like an initializer, or behind a test checking that the part is indeed MultipartNone. But setBody() being in the public API, nothing restrain the user to call it on a part that already contains something, including several subparts. Ensure that subparts are removed when setting a body with content. Similar to what is done in addAttachmentsToMultipart(), unset the attachment flag if the part we set a body to is actually a message itself. Change-Id: I245c5543cd85afed1176987e190900ff930efdbb Reviewed-by: Pekka Vuorela <[email protected]>
* Exclude parts containing signature data only in multipart/signed contextsDamien Caliste2024-01-151-10/+9
| | | | | | | | | | | Allow to list *.asc and *.sig (i.e. signature data) as attachments when they are not used in a multipart/signed context. Only hide such files when they are used as second part in a multipart/signed email. Change-Id: Ie4ac7af88f30c817b10c044d986aba44e27faaf1 Reviewed-by: Pekka Vuorela <[email protected]>
* Mark overridden methods with keywordPekka Vuorela2023-12-1417-258/+347
| | | | | | | | | | | | | Avoiding a lot of compiler noise from -Wsuggest-override. Also removed the now even reduntant virtual keywords on overridden methods as per qt coding conventions. And wrapped some overly long lines touched by the changes. Change-Id: I4e7febfa9554dfa7f366a1aabba6133a9f6c5614 Reviewed-by: Matthew Vogt <[email protected]> Reviewed-by: Damien Caliste <[email protected]> Reviewed-by: Christopher Adams <[email protected]>
* Fix build on Qt6Pekka Vuorela2023-12-142-0/+9
| | | | | | | | | | | | | | | | | | | | Regression on the D-Bus ipc which introduced e.g. Q_DECLARE_USER_METATYPE(QMailMessagePart) on qmailmessage.h. On Qt6 the qRegisterMetaType() ends up instantiating template<QDebug> QMailMessagePartPrivate::serialize(type) which then fails to build due to not having << operator for combination of QDebug and QMailMessagePartContainer::Location. Compiler ends up spewing pages and pages of errors and warnings. Not entirely following what's causing the difference to Qt5, and how QDebug serialize() works with one class but not on other, but suppose this explicit operator should be clean enough and avoiding side-effects on the actually running code. Change-Id: I4939e89d625ac06c682adbb5e31803e1ef019fd1 Reviewed-by: Damien Caliste <[email protected]> Reviewed-by: Matthew Vogt <[email protected]>
* Avoid deprecated APIPekka Vuorela2023-12-141-1/+1
| | | | | | | | | | | QWARN() is deprecated in Qt6 and QByteArray::count() in Qt 6.4. Both easy to avoid. Translatable output in a unit test seems silly. Change-Id: I9fab798cff548534789bb2830c00c650bed84143 Reviewed-by: Damien Caliste <[email protected]> Reviewed-by: Matthew Vogt <[email protected]>
* Fix connecting to obsolete & removed signalPekka Vuorela2023-12-111-6/+6
| | | | | | | | Qt 5.15 replaced QAbstractSocket::error with errorOccurred, and the old name removed in Qt6. Change-Id: Id09b1594ea2e2c10b663ecdbb7380897c2d31725 Reviewed-by: Christopher Adams <[email protected]>
* Introduce acceptUntrustedCertificates() configurationPekka Vuorela2023-11-303-14/+56
| | | | | | | | | Allows connections to be made to servers even when the TLS certficiate is not trusted (e.g. broken certificate chain). Change-Id: If912be7d7e4824f243471b40ef5c4d5acb0c31ab Reviewed-by: Damien Caliste <[email protected]> Reviewed-by: Matthew Vogt <[email protected]>
* Make flushIpcNotifications a slotDamien Caliste2023-11-231-2/+1
| | | | | | | | This method is called by a timer and must be a slot. Change-Id: I3428174771320263d1fb667d55cff2a5c95878f7 Reviewed-by: Pekka Vuorela <[email protected]>
* Don't readd received IPC signals in the event loopDamien Caliste2023-11-213-96/+14
| | | | | | | | | | | | | | | With QCop IPC implementation, received signals where put in a message queue to be processed in the next event loop iteration. This is not needed anymore with the DBus implementation, since the receiving process lives in a different thread and already submit received signals in the event loop of the main thread. Change-Id: I4ebfb2b03f7ab21a27642d380b5dc2fe5c281791 Reviewed-by: Pekka Vuorela <[email protected]>
* Discover authentication for SMTP/IMAPDamien Caliste2023-11-212-0/+20
| | | | | | | | | | Use the announced capabilities in SMTP/IMAP plugin to setup the authentication method to use. Add handling for error 504 on authentication in SMTP. Change-Id: I556281895e650768537fc6169816c3e8e6a81362 Reviewed-by: Pekka Vuorela <[email protected]>
* Add QMailMessage::CalendarCancellation flagDavid Llewellyn-Jones2023-11-153-3/+33
| | | | | | | | | | | | | | | | | | | | | | Introduces a CalendarCancellation flag similar to the QMailMessage::CalendarInvitation to be matched against the QMailMessage::status() bitfield. While the CalendarInvitation flag indicates that the message contains an attachment of type text/calendar with "REQUEST" method, the CalendarCancellation flag indicates that there's an attachment of type text/calendar with "CANCEL" method type. In other words, a calendar event cancellation. For reference, the "CANCEL" method of the Content Type header is described in RFC2447 (iMIP) Section 2.4 [1] in combination with the RFC2446 (iTIP) sections 3.2 and 3.2.5 [2] [1] https://tools.ietf.org/html/rfc2447#section-2.4 [2] https://tools.ietf.org/html/rfc2446#section-3.2 Change-Id: I1ef1d8a070e527552dae1ebe1677156bc07ba04d Reviewed-by: Matthew Vogt <[email protected]>
* Fix some compiler warningsPekka Vuorela2023-11-131-1/+1
| | | | | | | | | Avoid unused variable, QString conversion from ascii and move fall through note so GCC detects it. Change-Id: Id50a2b90c8c8c345a117c713849f65f45515eddb Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: Damien Caliste <[email protected]>
* Handle encoded-word's containing partial charactersSlava Monich2023-11-081-18/+38
| | | | | | | | | | | | | | | | | | That's actually a violation of the spec (RFC 2047): https://tools.ietf.org/html/rfc2047#section-5 Each 'encoded-word' MUST represent an integral number of characters. A multi-octet character may not be split across adjacent 'encoded- word's. but if charsets match, the data can be concatenated first and then converted to characters. Which is what all other email clients seem to be doing - I haven't found a single one which wouldn't handle it. Change-Id: I5bbb785343ad60459fa6e52f5728fd796c7e5961 Reviewed-by: Pekka Vuorela <[email protected]> Reviewed-by: Christopher Adams <[email protected]>
* Switch to DBus for IPCDamien Caliste2023-11-0629-4266/+768
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two IPC mechanisms in QMF: - one between the messageserver and clients to perform actions like fetch emails, search, etc. - one between every mailstore instances to notify other instances of changes in the mail database. QCop being discontinued, this patch switchs to use DBus as an IPC transport layer. The first mechanism is implemented by registering an object on the session bus (/messageserver) providing a service (org.qt.messageserver). The second mechanism is implemented by registering each client as an object to the session bus (/mailstore/client) for the interface org.qt.mailstore. Other clients can then listen to updated() signal on this interface. DBus IPC requires to implement operator<<() and operator>>() with QDBusArgument for the objects that need to be transported. In all cases, each objects are serialised up to unitary elemental elements like int, byte arrays, etc. Except for the QMailKeyArgument that uses first a serialisation into a byte array before being sent. This is due to the recursive declaration of QMailKeyArgument with the subKeys members, not working well with QDBusArgument serialisation. Change-Id: I8f10b8b00f73d4b75dad778b591159a765e9fb89 Reviewed-by: Pekka Vuorela <[email protected]>
* Share message server with ActionInfoDamien Caliste2023-11-063-41/+46
| | | | | | | | | | | | | | | | | | The ActionObserver is responsible to spawn ActionInfo objects when actionStarted() is received from IPC. Then, the newly created ActionInfo listens as normal Action for update signals over IPC. But, depending when the ActionInfo creation is actually done, it may have missed IPC update signals. To avoid this, the observer is sharing its QMailMessageServer, and the newly created ActionInfo can connect to signals that are still pending in the message server. Change-Id: I152fdcbeee7a902a0c54b58a28476cdfb31d4dbc Reviewed-by: Pekka Vuorela <[email protected]>
* Listen to activityChanged in action observerDamien Caliste2023-10-182-27/+10
| | | | | | | | | | | | | | | | | | | | | | | There is a race condition in the way the observer is listening on activity change for the actions it is supervising. Indeed, the servicehandler is emitting actionStarted() signal, and then activityChanged(). The observer may receive these signals asynchronously. But with the current implementation, the observer starts listening at activityChanged() after it has received the actionStarted() one. The race condition appears then if the servicehandler emits the activityChanged before the observer received the actionStarted() one. This patch should correct this race condition by making the observer always listen to activityChanged() and deal with it if the activity corresponds to an action it is supervising. Change-Id: I339be274152e648dda50e8bb4667a8fdd70e4cba Reviewed-by: Pekka Vuorela <[email protected]>
* Remove client to server email addition via a fileDamien Caliste2023-10-172-34/+0
| | | | | | | | | | | | | The possibility to transfer from client to the mail server new or modified emails by file has been deprecated by the usage of QMailMessageMetaDataList. The client side implementation is already using only the new method. So remove the server side implementation and IPC interface. Change-Id: I50df8ab04692748e3a1b66341f3b4cd05cc58501 Reviewed-by: Pekka Vuorela <[email protected]>
* Flush the store cache on reconnectionDamien Caliste2023-10-164-3/+36
| | | | | | | | | | | | The QMailStorePrivate implementation is using cache for read account, emails... This patch makes this cache aware of a possible disconnection and reconnection to the other store clients. The cache is cleared on reconnection if the database was touched since the last disconnection. Change-Id: If85c66e3981b66d05ea201f72eefa3c3329bd813 Reviewed-by: Pekka Vuorela <[email protected]>
* Delete deprecated message count signals in IPCDamien Caliste2023-10-102-38/+0
| | | | | | | | | | | | | | | | | The newCountChanged signal is not used anymore in the message server. Remove the client code exposing it. Remove also client method acknowledgeNewMessages() since it's linked to newCountChanged signal to reset the counters. Remove the internal QMailMessageServerPrivate::initialize() since it's not called from anywhere and the server has no slot for this signal. Change-Id: Id5a67c22eae2c7190c3e02ed0681eab7037f1fcc Reviewed-by: Pekka Vuorela <[email protected]>
* Provide default values for QMailKeyArgument() and FileLoggerDamien Caliste2023-10-042-2/+4
| | | | | | | | | | Avoid uninitialized values with the default QMailKeyArgument constructor. Also set FileLogger::do_cntr in the class definition to avoid missing its initialization in constructors. Change-Id: If25e6a572c13aca0afb4d1017111e8ad769af01a Reviewed-by: Pekka Vuorela <[email protected]>
* Properly deserialize the array size in QMailKeyArgumentDamien Caliste2023-10-041-1/+1
| | | | | | | | The size of a QmfList may not be the same length in bytes than an int. Change-Id: If3c04944e22255b217502b1018b3aae898e333f7 Reviewed-by: Pekka Vuorela <[email protected]>
* Define a flag to mark encrypted emailsDamien Caliste2023-09-053-0/+26
| | | | | Change-Id: I5eef7a1e8b566e43af9e5dcb86d00b4aa0c891dd Reviewed-by: Pekka Vuorela <[email protected]>
* Treat non text parts without content disposition as attachmentsDamien Caliste2023-09-011-1/+5
| | | | | | | | | | | | | | | | Some mails don't provide the Content-Disposition: tag, providing just a Content-Type:. This commit modifies the findAttachment strategy to treat all such parts as attachments if they are not of text type, or known cryptographic parts. Example of such disposition: -------------02837317639187261987642987516514411 Content-Type: application/pdf; name=ebillet_1_2.pdf Content-Transfer-Encoding: base64 Change-Id: I4eecc04134dcf40d2e39b856c29a0e60531221e8 Reviewed-by: Pekka Vuorela <[email protected]>
* Use correct key count in MailKeyImpl::deserialize()Tomi Leppänen2021-09-101-1/+1
| | | | | | | | | Fix a typo in MailKeyImpl::deserialize(). This causes messageserver to eat all memory on some devices when searching mail. Change-Id: I499213f2ad14087c8f97d65584b666bcced91286 Reviewed-by: Pekka Vuorela <[email protected]> Reviewed-by: Christopher Adams <[email protected]>
* Support ~ as specifier for log file pathsTomi Leppänen2021-04-091-1/+5
| | | | | | | | With this ~ is expanded to QDir::homePath(). This allows to store logs inside home directory without knowing username. Change-Id: I17cbd4b3d837eae7b5588991f18db7f6e76be2a4 Reviewed-by: Christopher Adams <[email protected]>
* Use sentences in description of database actions instead of routine namesDamien Caliste2021-04-091-42/+42
| | | | | | | | | | | The previous situation could lead to undescriptive messages in the log like "unable to account" for the ::account() routine. Using longer sentences enable to obtain something like "unable to inquire account from id". Change-Id: I6044ad99bc657231e894f204152eace979b3705e Reviewed-by: Christopher Adams <[email protected]>
* Add missing slash character as protected in header parametersDamien Caliste2021-04-091-1/+2
| | | | | | | | | | | For some reason the '/' character that is defined as a protected character in RFC2045 for values of parameters in header Content-Type field, was missing. As a result the protocol parameter for multipart/signed emails was not escaped which is faulty and was confusing some email clients. Change-Id: Id9d43b883187317ec152eea56819822612bfe307 Reviewed-by: Christopher Adams <[email protected]>
* Finish a query before starting a transactionDamien Caliste2021-04-081-0/+1
| | | | | | Change-Id: I74ab80753eeca520ec074459602f299dc5a70b9f Reviewed-by: David Llewellyn-Jones <[email protected]> Reviewed-by: Christopher Adams <[email protected]>
* Properly deserialize qsizetype valuesDamien Caliste2021-04-082-7/+8
| | | | | | Change-Id: I6ae1fc17fa08c0b8fb14a37d5a1829175461a487 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Fix some warningsChris Adams2021-04-088-20/+43
| | | | | | Change-Id: Ifad72f55ca3988e84749d9f8868ec6d8d6c986ec Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Use QmfList where required to maintain stable referencesChris Adams2021-04-0840-179/+204
| | | | | | | | | | Any case where the address of an element is taken and stored or used, must be changed to use QmfList instead of QList, otherwise non-const operations will cause the reference to become invalid. Change-Id: Ic0017cb9eddcf27b93d26adb3ea9c71682c4421b Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Add QmfList for reference-stable list semanticsChris Adams2021-04-082-1/+114
| | | | | | | | | | QmfList provides some QList-esque syntax sugar around std::list, providing a container with reference-stability (i.e. references and iterators are not invalidated after non-const operations). Change-Id: I9ecc2a6f5b926a9ea98425d960d2f915c26975a9 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Bind QVariant() for null QDateTime and QString values in SQL queriesChris Adams2021-04-081-6/+9
| | | | | | | | | | | It seems like invalid/null QDateTime values are no longer treated properly as NULL SQL values when bound in SQL queries, in Qt6. This commit ensures that null QDateTime and QString values are bound specifically as null QVariant() values instead. Change-Id: Id87cebf42649bd0425c361042e4ef5f49c236a62 Reviewed-by: Christopher Adams <[email protected]>
* Include class definition for QSslError to create QList<>Damien Caliste2021-04-081-1/+3
| | | | | | Change-Id: I9822fb1b4fb8b46f1ea8aeb937206305e489af72 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Fix QChar from unicode value conversionsChris Adams2021-04-081-1/+4
| | | | | | Change-Id: I834645859e56a793f875892b038467c5d48291ef Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Use non deprecated QString::fromUtf16() APIDamien Caliste2021-04-081-3/+3
| | | | | | Change-Id: I4c15a1df37e0c440a7a731eeef8f42a1681f86e9 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Adjust to Qt6 QMetaType API changesDamien Caliste2021-04-083-17/+9
| | | | | | Change-Id: I154b232699932a5c721cb7cff4476f20ac196cad Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Add core5compat for in src/librariesDamien Caliste2021-04-082-2/+2
| | | | | | | | | This is used for QRegExp 'glob' matching and QTextCodec in qmailcodec.cpp. Change-Id: I6a222451bf6b124cbaab9d7687e40b39a30c2eb1 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Update to QTextStream handling only UTF-8 encodingDamien Caliste2021-04-086-62/+50
| | | | | | | Change-Id: I01f034b6099b414dce1bb59de79f6a50f61ad4de Reviewed-by: Damien Caliste <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]> Reviewed-by: Christopher Adams <[email protected]>
* Add explicit bracesDamien Caliste2021-04-081-1/+2
| | | | | | Change-Id: I9db04a4f251b9e987b0e994135ee6e7ab12210cd Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Replace deprecated QRegExp by QRegularExpression in src/librariesDamien Caliste2021-04-085-92/+114
| | | | | | Change-Id: I51d2a292275f100f1250ae46c223098b6fedfd11 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Avoid deprecated QFontMetrics::width() callDamien Caliste2021-04-081-1/+1
| | | | | | Change-Id: I394985aaf49f108cee9e7e9da8aae1d592b97c68 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Replace deprecated QString::SplitBehaviorDamien Caliste2021-04-082-7/+7
| | | | | | | | Change introduced in 5.14 Change-Id: I162b12c244d4d85781116e88b7e345bc66f59f5a Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Use default QFlags constructorDamien Caliste2021-04-081-3/+3
| | | | | | | | It was introduced in 5.15 Change-Id: Ic198cdef50287e60d06e9b0cfe2179c81a656994 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Use range constructors for lists and setsDamien Caliste2021-04-086-34/+52
| | | | | | Change-Id: Iccea2c86266b4c20777d939b291084cb709bf592 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Add explicit copy operator for MailSortKeyImpl templateDamien Caliste2021-04-081-0/+7
| | | | | | Change-Id: Ief9fe3083a0411be04ed8ff69263d7223368b877 Reviewed-by: David Llewellyn-Jones <[email protected]> Reviewed-by: Christopher Adams <[email protected]>
* Use QElapsedTimer instead of QTimeDamien Caliste2021-04-081-2/+3
| | | | | | Change-Id: I6a2ff47a44f549155a7724dc057c70ce363bb1c0 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Don't use deprecated qVariantFromValue()Damien Caliste2021-04-081-1/+1
| | | | | | Change-Id: Icf88dcc0beaa3d4d4a1eadec547cda7b48b40af7 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>
* Use QAtomicInteger::loadRelaxed instead of deprecated ::loadDamien Caliste2021-04-081-1/+1
| | | | | | | Change introduced in 5.14 Change-Id: I88c9ec2e714eb6287902e5595579917e9874ea2b Reviewed-by: Christopher Adams <[email protected]>
* Use asprintf instead of sprintf in QStringDamien Caliste2021-04-081-3/+3
| | | | | | Change-Id: I47ec90e476501749435a9cd2724ad42721789a62 Reviewed-by: Christopher Adams <[email protected]> Reviewed-by: David Llewellyn-Jones <[email protected]>