summaryrefslogtreecommitdiffstats
path: root/src/plugins/messageservices
Commit message (Collapse)AuthorAgeFilesLines
* Clean up service plugin signal connections - minor API changesPekka Vuorela6 days17-264/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | The states and signals were painful to follow due to bad naming and excessive overloading. Here: - Renamed some API to avoid overloading, help readability and allow new connect() syntax without resolving the overloads. - updateStatus() signals and slots renamed a bit to make it clearer what is a signal and what is a slot. And avoiding overloading QMailMessageService::updateStatus() to simplify signal connection. - Cleaned up QMailTranport API. It's not doing urls but hostnames and the signals were especially hard to follow - Use the new connect() syntax in messageserver side - Avoiding some protected: / virtual methods when there's nothing even able to inherit the class. - At least print SSL errors instead of signal that's not connected anywhere. - Some minor simplifications and code style adjustments. The SSL error handling is still funny but at least a bit easier to track. Change-Id: If168e15ef068fedee46b9401d695ed5dae7962ba Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Rename QMailMessageMetadata::content as contentCategoryPekka Vuorela6 days3-3/+3
| | | | | | | | | | | | | | | | | | | | The related functionality was confusing when setContent() didn't actually set any content but rather the type of it. Also there are other setContent() methods around that actually set the content. Then again calling this contentType() would have collided further in the inheritance tree by method returning a QMailMessageContentType which is referring to header fields. Thus switched this to a third distinct name. Old setter and getter names provided for backwards compatibility which should work at least for the very basic cases of setting and comparing type. Change-Id: I4c54548f3c2c85096fde64b3221e233dd3feefa3 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Replace remaining 'Qt Extended' references with 'Qt Messaging Framework'Pekka Vuorela6 days3-3/+3
| | | | | | | Change-Id: I04d2c685c76dc3e72b16a6fb7eb82f2ab0e510c1 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Adjust again some smaller code detailsPekka Vuorela12 days5-11/+14
| | | | | | | | | | | | | | | - Wrap some overly long lines - Honor coding conventions better here and there - Use nullptr more instead of '0' - Switch remaining cases of Q_DECL_OVERRIDE and Q_NULLPTR to standard keywords. - Removed some unnecessary #includes - etc. Change-Id: Ia9a01807da88298a6c1c1bbb22c854743ed19429 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Use zlib with cmake build if availablePekka Vuorela13 days1-0/+4
| | | | | | Change-Id: I3297515d08a316d236061f0a3cfe85501f36617a Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Repurpose .pro files for qt5 support - almost worksPekka Vuorela2025-11-262-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | There's still need for having qt5 support out there and the .pro files don't anyway compile with qt6 by now. Adjusting those and the code to build on qt5 didn't even require much adjustments. The hack to get _p.h includes work without private prefix, that used to be there for qmake build, is horrible but at least it's relatively small and affecting only .pro files. The examples had some existing issues building there, missing includes and not entirely disabled protocol editor support. The "almost works" part: builds fine but the metatype side is slightly lacking, resulting also a unit test failure. On qt5 qmailipc.h would need qRegisterMetaTypeStreamOperators() call after qRegisterMetaType() but I'm not eager to add qt version ifdeffing inside a macro, at least now. Hoping to clean up the whole metatype registration first. Change-Id: I6e620175383690ce4e6eb4c841e314ccf031026f Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Wrap some ridiculously long lines in sql and messageserver sidePekka Vuorela2025-11-131-64/+292
| | | | | | | | | Some minor changes too like broken indentation. Change-Id: I2c72f64d4472ca669f339904ff953f2a39118baf Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Remove qwidgets support from qmfmessageserverPekka Vuorela2025-11-1223-2910/+3
| | | | | | | | | | | | | | | | | | | | | | This has little real life value. Any environment and apps starting to use the framework will or should have their own UI style. Predefined forms for some protocol configuration editing unlikely fits the rest. Moreover the support has been opt-out instead of opt-in, QMF_NO_MESSAGE_SERVICE_EDITOR which the _app_ has needed defined according to how the library has been built. Should have been some config.h provided by the framework according to how it's compiled. QMailMessageServiceConfigurator class without the editor makes little sense so removed altogether. There's qtmail example that was using this. For now just left some TODO comments to reimplement the account configuration. Unknown how the example works these days in general. Change-Id: I4122e2524a61797753999e67ecec36cb46213a7b Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Use more standard paths for user data, remove QMail::tempPath()Pekka Vuorela2025-11-124-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid data root directly in home directory, rather use QStandardPaths. For backwards compatibility the old path is still used if it's there and the new one doesn't exist. QMail::tempPath() got removed. Evidently it's not much needed and shouldn't really exist. The qmfclient doesn't use it al all and generally apps should store their temporary things in their own places. It's rarely wanted that there would be a common place to store such. On the contrary, apps should play mostly in their own sandboxes. TempPath was used on the server side but mostly either wrong or unnecessary: - requests file is messageserver app specific, shouldn't be visible to others. - QMailMessageSource was using it wrong. New messages are added to database, not temp path. - LongStream with public cleanupTempFiles() could be dangerous if it was called by multiple processes and having a common directory. (Another story whether such an api should even exist though) - SMTP, IMAP and LongStream can live with more generic locations. The generic locations for the last ones are borderline whether it should be TempLocation or CacheLocation. For side: interestingly the usage is mostly storing content in files to save memory while Linux world with /tmp as tmpfs has moved to storing files in memory to make them faster. For now made smtp use temp location as that's a quite simple usage, while imap and longstream in cache dir as they do have some more complicated detaches and append usages, and they were earlier out of the actual /tmp. Did some simplifications to LongStream and a proper error case handling to smtp client out of space error while at it. Change-Id: If52de231082085d804939002371f5a407cd0fecd Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Adjust installation pathsPekka Vuorela2025-11-116-6/+6
| | | | | | | | | | | | | | | | Install headers and plugins to qt6 directory as it should have been long time already. Didn't touch .pro files as those don't work with current qt6 and are used more with qt5 build. Use common common 'messagingframework' container dir for plugins. The plugin type directly under qt plugins dir was confusing, and possibly even colliding with other qt plugins. Crypto at least seems used by qt itself. Change-Id: I2c674ba184a53d602dc2a1fc24f83a955268a166 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Avoid some more compiler warningsPekka Vuorela2025-11-064-29/+21
| | | | | | | | | | | | | | | | | | | | | | - Missed earlier one QMessageBox deprecation from separate file - LongStream now doing consistent open() check in all code paths. Also removed unused member variable 'c' and moved internal constants to .cpp. - imapstrategy.h / ImapMessageListStrategy::selectedSectionsAppend() was dead code due to derived class ImapFetchSelectedMessagesStrategy having similar named method with extra parameter and default value. - ImapService was triggering a couple of -Woverloaded-virtual warnings due to having extra methods with same name as base class. These were really used internally so simpler as different named private. - ImapProtocol / QString::lastIndexOf() was complaining about unused return value. Using that should be even simpler than accessing regexp match. - Some small random warnings on unused parameters, missed switch case etc. Change-Id: I243c09ab2d551fe2f8be18f1b3a4df2e3d84b55c Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Fix nullptr warning on QObject::connect()Pekka Vuorela2025-11-061-1/+2
| | | | | | | | | And added couple 'static's to local functions etc while at it. Change-Id: I7b95c08199515f53ab0300117cdd3f1d19761b3b Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Remove obsolete translations and adjust the setupPekka Vuorela2025-11-0139-5758/+0
| | | | | | | | | | | | | | | | | | | | | | Practically not touched since initial commit. There is no QTranslator used in the whole repository so they shouldn't be much of help either. Library's .ts file contain lot of content coming from examples or deleted files. Translation are more or less empty except for some (mostly obsolete) German translations and a couple arabic words. Using strange names for translation files. The problems here are endless. Just removed the majority of the .ts files as crap. Kept -de and en_US as some basis for later adding these back, hoping that the -de as best translated earlier would have kept something but even that was basically nothing. Executed "lupdate -no-obsolete *.pro" to at least update the .ts files to match the current sources. Change-Id: I11e5fe8c84d1e17ab8e4fcf158594815261acfe0 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Adjust messageserver naming versionsPekka Vuorela2025-11-013-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | On Qt6 it's strange to have messageserver5. Could have bumped the binary there to '6' but maybe we don't really need to highlight the qt version that much. The '5's were added to allow parallel installability but that really matters more on libraries etc rather than the server. We don't want parallel installed daemons fighting who gets autostarted first. Also on credential side it shouldn't matter which was the Qt version. Switching to newer version should still be about the same service. In practice don't think the names matter too much, and auth success is ignored so think it should be ok just changing the naming. Removed the '5's from examples too. No need there. Left the .pro file binary as it was as that side now mostly serves the Qt5 builds where we wouldn't benefit much from changing the binary name. Change-Id: Ie4a843c944caa73b080e3610baee4842500f029b Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Avoid qFatal in imap clientPekka Vuorela2025-11-011-5/+3
| | | | | | | | | | | Nicer if plugins don't try to make the whole messagingserver to exit. Removed also a couple qtopia references, an if() check that's guaranteed to succeed and did some more simplifications on servicehandler. Change-Id: Ibf98d57d86cd4f183f40d71b712ca1539f17b755 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Use understandable types and names for transfer statesPekka Vuorela2025-10-296-52/+67
| | | | | | | | | | | | | | Pair of pair of etc is hard to follow. Use actual type for containing Imap/pop transfer states. Smtp was better with simpler data but even there the naming was confusingly singular. The m_ naming is maybe inconsistent within classes but let's just gradually move consistently that way. Change-Id: Iaeb156d894ebadabe7f89a143c51aff9750098a1 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi>
* Polish QMailMessage classes, and something small elsewherePekka Vuorela2025-10-273-5/+4
| | | | | | | | | | | | | | | | | | | | - Made setBody() virtual and avoid dynamic_cast to check which type of instance was used - Cleaned up some cosmetic details, fixed typos etc - Restricted some variable scopes - Renamed some global constants with UpperCase name - Commented out some dead code - Use nullptr instead of NULL or 0 - Renamed vague "void QMailMessagePart::defaultContentType()" - Made attachment methods in QMailMessagePartContainer virtual. The implementation does some dynamic_casts to check the type of the instance, which would rather be better as overridden implementation. Didn't do that yet, but the virtuals should avoid a later ABI break if/when such is done. Change-Id: Ia7dc212a1b609d0b02c2cc269082a0e39667c157 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Remove deprecated synchronizeAll requestPekka Vuorela2025-10-271-29/+0
| | | | | | | | | | | | | | | | | | | | | Small leftovers: pop service uses its synchronize() implementation also internally. ImapClient has a strategy for that which is set as ImapClient ctor. To be considered should the IPC / message source API be brought back for QMailRetrievalAction::synchronize(). Currently it ends up doing different sub-actions even if the original rationale was allowing the behavior to do thing in parallel. See commit 3e40ef86ac810. Also to worth note that this didn't possibly even work as the servicehandler code was doing exportUpdates() instead of synchronize(), maybe copy/paste error in commit 9c73f5415ace31 from the above request handler. Change-Id: I044732d63a11524a9b4d3a038123315c477d96e5 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Use pointer for out-parameters in QMailMessageClassifierPekka Vuorela2025-10-202-4/+2
| | | | | | | | | Easier to follow side-effects in caller side. Change-Id: Ife9d9d159bf4aaa3bbeffc858797381839bf03bf Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Remove deprecated retrieveAll requestPekka Vuorela2025-10-154-60/+8
| | | | | | | Change-Id: I3d973ca81b5dcf532233aa97c1065f93c6bb840e Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Remove network status leftover class from SmtpServicePekka Vuorela2025-10-151-11/+2
| | | | | | | | | | | Commit 1ff7dd4c878 removed the usage and made SmtpService attempt fetching the capabilities for 5 minutes before giving up. Kept a TODO item in different form. Change-Id: If09e0f78fed7497f6100bc2c8a465cd9c8c9655f Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi>
* Minor API break: remove QMailMessage CR/LFPekka Vuorela2025-10-142-10/+12
| | | | | | | | | | | | These don't really belong here, and QChar::CarriageReturn and QChar::LineFeed have existed since Qt 5.0. Not even bothering deprecating, the switch to QChar is trivial enough. Change-Id: Ic4d48fcb27436c55f26c9e735b8d1a96d1a5fa9e Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Clean up ImapClientPekka Vuorela2025-10-143-141/+102
| | | | | | | | | | | | | | | | - Some switches were mixing return; and break; without any actual difference between them. - retrieveMessages() accountCheck parameter was named wrong in declaration vs implementation - Some slot parameters were declared const but implementation not having such. - Simplified error handling in a method to consistently handle error first instead of nesting deeper into ifs. Change-Id: I99b2528b20db9bbdf801bc7dbe361cc7b361b9f8 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Remove more unnecessary usage of core5compatPekka Vuorela2025-10-147-47/+47
| | | | | | | | | | | | | | Besides QTextCodec in a couple places, the remaining use was just - Couple simple QRegExps in protocol plugins. - QLinkedList in messageserver. QList should be good enough for that. Also spotted one ancient symbian test file and cleaned up some minor details. Change-Id: I348fd8d54ca3a6a6fcba1a757f33c7b490661706 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Use common if/else brace and operator stylePekka Vuorela2025-10-066-59/+57
| | | | | | | | | And couple small simplifications too. Change-Id: Id5fe0a3e991961b9b39c92ab1b9b165c6f450289 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Adjust some cosmetic details, againPekka Vuorela2025-10-013-6/+8
| | | | | | | Change-Id: I061ae75d0196ee08380cf3763b1b12d55b631795 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Fix slightly off indent, adjust enum style and minor detailsPekka Vuorela2025-10-013-16/+8
| | | | | | | Change-Id: I4ad9396f40535fdf4b010af76e121f1339698e50 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Avoid (explicit) QmfList outside the libraryPekka Vuorela2025-09-292-8/+5
| | | | | | | | | | | | | | | | | Paving the way to get rid of the QmfList which was added sort of stopgap on Qt6 migration because of the QList changes. - Imap plugin using for() loop which should work for any container type returned by the methods. - tst_qmailstore unit test just getting the list of addresses after we are sure those won't change. A few more lines but avoids the custom type. - On previous changed also indexing fully 0 based to keep it more robust. "Hi 0" type of subjects shouldn't really matter on tests. Change-Id: I7a74dbe7654d5f3dd80435d5bf9af110b875b03a Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Avoid failing on expected unit test failures, and some cleanupsPekka Vuorela2025-09-292-4/+2
| | | | | | | | | | | | | | | | - Imap test is marked insignicant in .pro but that allows success also, cmake's WILL_FAIL doesn't. Comment out latter to avoid unexpected failure. - Instead of failing, skip tst_qmailstorageaction if there's no messageserver running as such is not there with simple 'make test'. - Removed some qtopia style file references, adjusted cosmetic details, added/removed #includes depending on whether needed or not. Avoiding some pointless trinary operators. Change-Id: Ia7f2fd8e7c7318a138e1cb043f1da436902943c0 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Clean up Smtp client not to use fragile iterators and qmflistPekka Vuorela2025-09-292-90/+74
| | | | | | | | | | | | | | | | | Having an iterator member variable for currently sending email and another iterator for handling its rcpt list was fragily and unconventional. Just storing now the needed data separately and getting rid of the email from the list of to be send after it's done. The rcpt iterator was also badly having a generic name 'it' etc. Bunch of other cleanups while at it and avoiding QmfList when there doesn't seem to be any need. Change-Id: I98b7829ddea36ec30e50ab72cf3f2599e6e60362 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Deprecate Fwd classes in favor of just introducing enums in real classesPekka Vuorela2025-09-262-3/+3
| | | | | | | | | | | | | | | | | | | | | | | The Fwd classes were inherited by the actual classes, allowing to #include only the fwd and not the bigger real class header. Such a compilation time micro optimization shouldn't really be worth complicating the API. Thus just moved the enum content to actual classes. For some backwards compatibility made the Fwd classes typedeffed to the real ones. Crypto side didn't even have a proper class, only the Fwd and suppose all the usage of the code just did include anyway for the whole crypto api. The QMailFolderFwd::PredefinedFolderId was having a cyclic dependency when moved to QMailFolder: QMailFolderId ctor variant was depending on it and QMailFolder was depending on the Id. Moved the predefined id to the Id class which feels like a better home anyway. Change-Id: I9a9aa9c407ae90cc11b37179fe417e3a002ce94b Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: <matti.viljanen@kapsi.fi>
* Use qDeleteAll() more and some more cosmetic cleanupsPekka Vuorela2025-09-261-6/+3
| | | | | | | | | | For interesting detail ServiceActionQueue::clear() seemed badly done and likely leaking memory. Change-Id: Ibeb429bd46957dc1bac9e56f2bc8889a2e64b191 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Clean up some cosmetic detailsPekka Vuorela2025-09-1928-363/+205
| | | | | | | | | | | | | | | | | | | Mostly coding conventions here. - Method opening braces to their own lines - Adjusted some inconsistent init list styles - Removed some redundant static declarations inside anon namespace - Replaced one delete loop with qDeleteAll() - Remove some trailing extra new lines - Added some missing spaces after commas - for (), if (), switch as common qt style - Removed some unnecessary scopes within switch cases Etc. Change-Id: Ide9ad7fea6f5fce3b854af2bf05874623c474028 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Remove support for QT_NO_SSLPekka Vuorela2025-09-1817-155/+3
| | | | | | | | | | In the world of today there shouldn't be much sense in doing email stuff without encryption support. Simplify code a bit by removing the ifdeffing. Change-Id: I90d90cd1ef11eed2ebd625dafee2f78b7d039233 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr>
* Simply notify on authentication errorDamien Caliste2025-09-175-17/+14
| | | | | | | | | | | | | | | | Let the credential implementations decide what to do on authentication error: either invalidate or retry. Adjust the API accordingly. Apply this change when caching credential data in the SingleSignOn plug-in: Don't make SSO calls on each service connection, use cached values instead. Only reset the cached values when the authentication fails with wrong credentials. Change-Id: I14fbe416567d552e7729ad8579fd9a763a3f6749 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Handle API TODO item from ImapTransportPekka Vuorela2025-09-033-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a note for making some methods virtual in the base class so the 'imap' prefix could be avoided. Did that first but then reviewing the situation it felt better to keep the prefix on imap side and on QMailTransport exposing socket and stream means that overriden methods can be too easily side-stepped. Originally the TODO was referring to a) imapReadLine() but base has an optional parameter which would have needed to be implemented, even if not needed, b) imapCanReadLine() where matching base is const while this one needs non-const access to consume compressed data, and c) imapWrite() which doesn't have a matching parent method. Later added bytesAvailable() / imapBytesAvailable() and readAll() / imapReadAll() could have been made virtual but it would have been also confusing if some reads were having special methods and some not. For suspicious earlier behavior, ImapProtocol was having one place where it was calling bytesAvailable() and readAll() instead of the imap variants, avoiding the potential decompression. Coming from commit 37164dc1b which did even introduce the new methods in ImapTransport but no usage for them. Change-Id: I3eec5034b8393b26f288bf0a158c8c1b1d520445 Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Add a specific logging category for IMAP stateDamien Caliste2025-07-113-7/+9
| | | | | | | | | | | | | Previously to 8e1451a8, the change of state in IMAP protocol was log with MessagingState category which was disabled. Create here a specific new category to avoid having the state changes printed out with the normal IMAP logging by default. It's now possible to get the state logging by using QT_LOGGING_RULES environment variable without recompiling. Change-Id: I7bfee95bd8dd483b2716e60b2866e778861c61ef Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Enforce that transport exists when credentials changeDamien Caliste2025-07-092-2/+2
| | | | | | | | | | It's a follow-up of dd679b32 since the state is not resetted in newConnection() before the credentials are initialised again and their status changes. Change-Id: Id1d94a12b5b2dfd214918347f6f05adb51ef79a9 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Warn on credentials failing to initialize in POPDamien Caliste2025-07-081-2/+2
| | | | | Change-Id: Ie73d59cc11dca6dab1550717b08dfca9feec7b15 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Add more debug messages for POP serviceDamien Caliste2025-07-041-2/+6
| | | | | | | | | | Also prefix the send and receive messages with the account number. It helps when several accounts are reporting at the same time to follow the actions of each account. Change-Id: Ie48bea49219cf451a62a2780f2ba122afb67f5d4 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Don't report credentials error after a connection being closedDamien Caliste2025-07-043-13/+15
| | | | | | | | | If the connection already breaks while waiting for the credentials to be fetched, it should not report error or proceed to login. Change-Id: I68a6f95232bdde03cc6cd52a2e0bf3cdfc989772 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Rewrite logging with QLoggingCategoryDamien Caliste2025-06-1323-359/+534
| | | | | | | | | Replace the custom logging mechanism with QLoggingCategory. Also declare the warnings with the proper category. Change-Id: If87d53d27ea0c65abd434af9f99fe49ce634d6dd Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Add missing spaces after for/if/while/switchPekka Vuorela2025-05-098-103/+103
| | | | | | | Change-Id: I57c6ed78099b3359a16ce807da95325e755f0197 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi>
* Remove trailing whitespace with sed scriptPekka Vuorela2025-05-0918-336/+336
| | | | | | | Change-Id: Iebfffe7a6d5b2db40f0508ecd7c8ccddfa6665a6 Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Declare tests in the build systemDamien Caliste2025-04-023-0/+18
| | | | | | | | | | | | | | | | | | Tests can be run with `ctest`. The `--verbose` option makes the output of each test visible. Fix also minor failures: - make qlogsystem test locale independent, - make qmailstore test properly listening to the messagePropertyUpdated() signal. IMAP, POP and SMTP tests are declared as always failing for the moment, since they try to connect to a mail server (but they are still useful for debug purposes). Change-Id: I7ae548110a8eeb37bd07b031a8433d38ea53529e Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Continue login when there is no valid push foldersDamien Caliste2025-03-262-3/+6
| | | | | | | | | | | | | | | | | Currently, login is deferred until all configured push folders have been established (or failed), when push email is enabled. This does not work for a newly created account where there is no folder registered. This patch ensures that the code continues to the login when push email is enabled but when there is no valid configured folders. Change-Id: I397d4d2616c3c6cebc9a3f4dcc03f4b5e3564ebe Reviewed-by: Guido Berhoerster <guido+qt@berhoerster.name> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Fix crash on imap search without supported keysPekka Vuorela2025-03-031-0/+6
| | | | | | | | | | | | | Just passing QMailMessageKey() ended up with empty search query and then crashing on QStringList::takeFirst(). Added similar error handling as CreateState::transmit() and RenameState::transmit() have. Change-Id: I6fdaa8ac11507dd880676d1f020c53d4964c85aa Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Don't continue on log-in after idle renewalDamien Caliste2025-02-281-3/+5
| | | | | | | | | Fix a regression introduced in 679b6a2d. The setIdlingForFolder() is also called on idle renewal, when the main session is in logout state. There is no need to ask for a login then. Change-Id: Iec6649a529a2d2b5b9b9d817f0ea2df5ff03f383 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Make ImapService the only place to delay push mail restartDamien Caliste2025-02-283-65/+32
| | | | | | | | | | | | | | | | | | | | | | | The IdleProtocol was delaying its signal emission of openRequest in case of an error. Then the client emitted restartPushEmail and the service was immediately calling initiatePushEmail(). This is the case when the error happened in the idle protocol. But the service is already having a delayed machinery to restart the idle session in case an error happens in the main client session. This patch is removing the delay timer in IdleProtocol so any error happening there is immediately reported to the service, which decides to delay the call to initiatePushEmail(). This requires some safe guards to be added in the service to ensure that the delay is applied only once even when there are several push folders emitting errors. Change-Id: I2b49c0445640d58bb391088b602f152cfe45eb49 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
* Synchronize idle renewal timersDamien Caliste2025-02-282-10/+20
| | | | | | | | | | | Use a common QTimer in ImapClient for every IdleProtocol, so the network accesses to renew the idling connections are all done in a close- by period of time, allowing the radio to sleep for a longer time between wakes-up. Change-Id: I7c9378a0af74015a34fd6cc98fa9517433d28392 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>