Skip to content

Conversation

@serjepatoff
Copy link
Contributor

Outlook.com IMAP server omits some parts and returns them as zero-length ones if there is vCalendar part in the message.

IMAP dump and message content is in the attachment.
Attachment.zip


if (text == NULL)
return MAILIMAP_ERROR_FETCH;
if (text == NULL) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you enable that behavior only if outlook server is detected?

@dinhvh
Copy link
Member

dinhvh commented Apr 24, 2017

Sorry for not getting back to you earlier. This pull request somehow went out of my focus.

@@ -1,4 +1,4 @@
## MailCore 2: Introduction ##
## MailCore 2: Introduction ##
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you revert that part?

bool wholePart, uint32_t offset, uint32_t length,
Encoding encoding, IMAPProgressCallback * progressCallback, ErrorCode * pError);
void storeLabels(String * folder, bool identifier_is_uid, IndexSet * identifiers, IMAPStoreFlagsRequestKind kind, Array * labels, ErrorCode * pError);
int fetch_rfc822(mailimap * session, bool identifier_is_uid, uint32_t identifier, char ** result, size_t * result_len);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are those part of the change?


#ifdef __cplusplus

typedef struct mailimap_fetch_type mailimap_fetch_type;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if that data type wasn't public.

bengotow pushed a commit to Foundry376/Mailspring-Sync that referenced this pull request Jan 1, 2026
Cherry-pick fix from upstream mailcore2 PR #1621.

Outlook.com IMAP server sometimes omits message parts and returns them
as zero-length when there is a vCalendar part in the message. Previously
this would cause a MAILIMAP_ERROR_FETCH error, failing the entire fetch.

This fix:
1. Adds mOutlookServer detection based on hostname
2. When fetching from Outlook and encountering a NULL/empty part,
   returns zero-length data instead of an error

This allows messages with vCalendar attachments to be fetched
successfully from Outlook.com accounts.

Upstream: MailCore/mailcore2#1621
bengotow added a commit to Foundry376/Mailspring-Sync that referenced this pull request Jan 1, 2026
Cherry-pick fix from upstream mailcore2 PR #1621.

Outlook.com IMAP server sometimes omits message parts and returns them
as zero-length when there is a vCalendar part in the message. Previously
this would cause a MAILIMAP_ERROR_FETCH error, failing the entire fetch.

This fix:
1. Adds mOutlookServer detection based on hostname
2. When fetching from Outlook and encountering a NULL/empty part,
   returns zero-length data instead of an error

This allows messages with vCalendar attachments to be fetched
successfully from Outlook.com accounts.

Upstream: MailCore/mailcore2#1621

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants