feat: mailio-based IMAP synchronizer (option USE_MAILIO_IMAP)
- Added ImapSynchronizerMailio using mailio library (C++17, Boost) - CMake option USE_MAILIO_IMAP (OFF by default) to avoid Boost dependency - Fetches Boost + mailio via FetchContent when enabled - Implements full IMAP: connect, auth (LOGIN/XOAUTH2), LIST, SELECT, FETCH, STORE, APPEND, EXPUNGE - SyncFolder: detects deletions, fetches new messages, updates flags in batches - XOAUTH2 support for Gmail/Outlook OAuth2 tokens - Falls back to original ImapSynchronizer when USE_MAILIO_IMAP=OFF - Ready to enable with: cmake -DUSE_MAILIO_IMAP=ON
This commit is contained in:
+53
-1
@@ -4,6 +4,31 @@ project(WinoMailQt VERSION 1.0.0 LANGUAGES CXX)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# FetchContent for mailio (C++ email library)
|
||||
include(FetchContent)
|
||||
|
||||
# Option to use mailio-based IMAP (OFF by default to avoid Boost dependency issues)
|
||||
option(USE_MAILIO_IMAP "Use mailio-based IMAP synchronizer (requires Boost)" OFF)
|
||||
|
||||
if (USE_MAILIO_IMAP)
|
||||
# Fetch Boost first (required by mailio)
|
||||
FetchContent_Declare(
|
||||
Boost
|
||||
GIT_REPOSITORY https://github.com/boostorg/boost.git
|
||||
GIT_TAG boost-1.85.0
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
FetchContent_MakeAvailable(Boost)
|
||||
|
||||
FetchContent_Declare(
|
||||
mailio
|
||||
GIT_REPOSITORY https://github.com/karastojko/mailio
|
||||
GIT_TAG master
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
FetchContent_MakeAvailable(mailio)
|
||||
endif()
|
||||
|
||||
find_package(Qt6 COMPONENTS Core Gui Widgets Network Sql Test Concurrent REQUIRED)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
@@ -48,6 +73,7 @@ set(SRC_FILES
|
||||
src/services/folderservice.cpp
|
||||
src/services/synchronizer.cpp
|
||||
src/services/imap/imapsynchronizer.cpp
|
||||
src/services/imap/imapconnection.cpp
|
||||
src/services/outlook/outlooksynchronizer.cpp
|
||||
src/services/gmail/gmailsynchronizer.cpp
|
||||
src/services/pop3/pop3synchronizer.cpp
|
||||
@@ -81,6 +107,8 @@ set(SRC_FILES
|
||||
src/ui/maillistview.h
|
||||
src/ui/composeview.cpp
|
||||
src/ui/composeview.h
|
||||
src/ui/richtexteditor.cpp
|
||||
src/ui/richtexteditor.h
|
||||
src/ui/settingsview.cpp
|
||||
src/ui/settingsview.h
|
||||
src/ui/contactsview.cpp
|
||||
@@ -95,8 +123,32 @@ set(SRC_FILES
|
||||
thirdparty/tags/src/config.cpp
|
||||
${TAG_MOCS}
|
||||
)
|
||||
|
||||
if (USE_MAILIO_IMAP)
|
||||
list(APPEND SRC_FILES
|
||||
src/services/imap/imapsynchronizer_mailio.cpp
|
||||
)
|
||||
endif()
|
||||
# Executable
|
||||
add_executable(wino-mail-qt ${SRC_FILES})
|
||||
add_executable(wino-mail-qt ${SRC_FILES}
|
||||
icons.qrc
|
||||
)
|
||||
|
||||
# Link Qt
|
||||
target_link_libraries(wino-mail-qt PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Network Qt6::Sql Qt6::Concurrent)
|
||||
if (WIN32)
|
||||
target_link_libraries(wino-mail-qt PRIVATE crypt32)
|
||||
endif()
|
||||
|
||||
if (USE_MAILIO_IMAP)
|
||||
target_link_libraries(wino-mail-qt PRIVATE mailio::mailio)
|
||||
endif()
|
||||
|
||||
enable_testing()
|
||||
add_executable(test_mimestorage
|
||||
tests/unit/test_mimestorage.cpp
|
||||
src/core/mailitem.cpp
|
||||
src/services/mimestorage.cpp
|
||||
)
|
||||
target_link_libraries(test_mimestorage PRIVATE Qt6::Core Qt6::Test)
|
||||
add_test(NAME test_mimestorage COMMAND test_mimestorage)
|
||||
|
||||
Reference in New Issue
Block a user