- Build a simple C++ ActiveSync wrapper around libetpan's low-level ActiveSync API.
- Model the wrapper after the existing MailCore IMAP core and ObjC wrapper style.
- Keep ActiveSync-specific protocol fields where needed, but map mail-shaped data into existing abstract MailCore structures when possible.
- Expose an ObjC wrapper with matching class boundaries and typed enum surfaces.
- Keep the public ActiveSync surface focused on email. Protocol details that are needed only for parsing or libetpan interop should move behind private headers or implementation helpers.
- C++ ActiveSync public umbrella:
src/core/activesync/MCActiveSync.h - C++ ActiveSync enum definitions:
src/core/activesync/MCActiveSyncTypes.h - C++ declarations: one public header per class in
src/core/activesync - C++ implementations: one
.cppper class insrc/core/activesync - ObjC ActiveSync public umbrella:
src/objc/activesync/MCOActiveSync.h - ObjC enum definitions:
src/objc/activesync/MCOActiveSyncTypes.h - ObjC declarations: one public header per class in
src/objc/activesync - ObjC implementations: one
.mmper class insrc/objc/activesync
ActiveSyncMessageinherits fromAbstractMessage.- Message header fields from ActiveSync (
Subject,From,To,Cc,Reply-To,Date) are parsed intoMessageHeader. - Duplicate message header fields should stay removed from
ActiveSyncMessageandMCOActiveSyncMessage. - ItemOperations Fetch returns
ActiveSyncMessage/MCOActiveSyncMessage, not a separate item wrapper. - Fetched MIME data is imported into the inherited
MessageHeaderwhen available. ActiveSyncAttachmentinherits fromAbstractPart.- Attachment
display_nameshould map to inheritedfilename. - Attachment
file_referenceshould map to inheriteduniqueID. - Attachment
content_typeshould map to inheritedmimeType. - Attachment
content_id,content_location,is_inline, and attachment state should use inheritedAbstractPartfields. - ActiveSync attachment-specific fields are limited to
methodandestimatedDataSize. ActiveSyncBody.content_typeis exposed asmimeTypefor naming consistency.
- Keep protocol integer values intact.
- Expose typed C++ enums in
MCActiveSyncTypes.h. - Expose matching ObjC
NS_ENUMtypes inMCOActiveSyncTypes.h. - Keep public enum-backed fields for attachment method, body type, native body type, filter type, and result statuses.
- Move
ActiveSyncFolderTypeout ofMCActiveSyncTypes.hintoMCActiveSyncTypesPrivate.h. - Move
MCOActiveSyncFolderTypeout ofMCOActiveSyncTypes.hintoMCOActiveSyncTypesPrivate.hif ObjC still needs to bridge the native folder type internally. - Do not expose calendar/contact/task/note/journal folder categories in the public mail API. Use private folder-type helpers to classify ActiveSync folders as mail folders before returning them.
- Public APIs should prefer mail terms over ActiveSync protocol terms:
folderIDinstead ofcollectionID.messageIDinstead ofserverIDwhere the ID identifies an email message.messageDatainstead ofMIMEData.
- Keep protocol-level names in private helpers when they map directly to libetpan calls.
- Replace or supplement
sync(ActiveSyncSyncRequest *)/syncWithRequest:with a mail-shaped sync entry point that builds the underlying ActiveSync request internally:- C++:
syncMessages(String * folderID, String * syncKey, ActiveSyncMessageSyncOptions * options, ErrorCode * pError). - ObjC:
syncMessagesInFolderID:syncKey:options:error:.
- C++:
- The mail-shaped sync method should set
collectionClasstoEmailinternally. - Keep advanced
ActiveSyncSyncRequestavailable only if a lower-level protocol API is still desired. - Rename the fetch/send/reply/forward surface to align with MailCore mail APIs:
- C++
fetchMessage(String * folderID, String * messageID, ErrorCode * pError)wrapping ItemOperations Fetch. - ObjC
fetchMessageInFolderID:messageID:error:. - C++
sendMessage(Data * messageData, bool saveInSent, ErrorCode * pError). - ObjC
sendMessageWithData:saveInSent:error:. - C++
smartReply(String * folderID, String * messageID, Data * messageData, bool saveInSent, ErrorCode * pError). - ObjC
smartReplyInFolderID:messageID:messageData:saveInSent:error:. - C++
smartForward(String * folderID, String * messageID, Data * messageData, bool saveInSent, ErrorCode * pError). - ObjC
smartForwardInFolderID:messageID:messageData:saveInSent:error:.
- C++
messageDatais RFC 822 formatted message data, matching the SMTP/IMAP/POP/NNTP naming used elsewhere in MailCore.
- Callers should not have to set
deviceIDexplicitly for the common mail-only API. ActiveSyncSession/MCOActiveSyncSessionshould generate or provide a stable defaultdeviceIDwhen none is set before connecting.- The generated
deviceIDmust be stable for the account/device pair so server policy state and sync state do not churn between app launches. - Keep
deviceIDas the only public device identity override for callers that need deterministic migration, testing, or product-specific identifiers. - Do not expose
deviceType; pass a conservative internal device type ofMailCore. - The implementation should still pass the resolved device identity through
mailactivesync_set_device()beforeconnect.
- Moved
ActiveSyncFolderTypeandMCOActiveSyncFolderTypeinto private ActiveSync type headers. - Removed the public folder
typeproperty/accessors and filter FolderSync added/updated folders to mail folder types during native conversion. - Renamed ActiveSync RFC 822 payload APIs from
MIMEDatatomessageData. - Renamed fetch/send/reply/forward session APIs from item/collection/MIME terms to message/folder/messageData terms.
- Added
syncMessages/syncMessagesInFolderID:syncKey:error:as the mail-shaped sync entry point that sets the ActiveSync collection class toEmail. - Added default device identity resolution before connect: generated stable
deviceIDwhen unset and defaultdeviceTypeofMailCore. - Removed
deviceTypefrom the public C++ and ObjC APIs; the session now always passesMailCoreinternally. - Removed wrapper-level ActiveSync cache toggles and cache directory configuration; updated libetpan no longer requires them in
mailactivesync_new(). - Made
protocolVersion,policyKey, anduserAgentinternal-only session configuration instead of public ActiveSync session API. - Removed public device-information settings from the mail-focused session API.
- Removed duplicate
ActiveSyncAttachmentandMCOActiveSyncAttachmentaccessors for values already represented byAbstractPart/MCOAbstractPart:displayNamefileReferencecontentType
- Kept
ActiveSyncAttachment::methodandestimatedDataSize, becauseAbstractParthas no equivalent fields. - Added
ActiveSyncMessageoverrides for abstract part lookup:attachments()htmlInlineAttachments()partForContentID()partForUniqueID()
- Removed the separate
ActiveSyncItem/MCOActiveSyncItemwrapper and made fetch return message objects.
- Run focused C++ syntax checks over every
src/core/activesync/*.cpp. - Run whitespace checks over
src/core/activesync,src/objc/activesync, and touched CMake files. - Run ObjC++ syntax/build checks when a toolchain with
clang++is available.