Skip to content

fix(sender): check writes in iMIP body#1182

Merged
andrinoff merged 1 commit intofloatpane:masterfrom
mvanhorn:osc/1128-capture-write-errors
Apr 28, 2026
Merged

fix(sender): check writes in iMIP body#1182
andrinoff merged 1 commit intofloatpane:masterfrom
mvanhorn:osc/1128-capture-write-errors

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

@mvanhorn mvanhorn commented Apr 28, 2026

What?

SendCalendarReply in sender/sender.go built its multipart iMIP body via direct Write / Fprint / Close calls whose errors were discarded. This PR wraps each of the eight unchecked calls in the iMIP body block in the standard Go if _, err := ...; err != nil { return nil, err } idiom.

The eight callsites covered:

  • fmt.Fprint(qp, plainBody)
  • qp.Close()
  • calPart.Write(...)
  • altWriter.Close()
  • altPart.Write(...)
  • attachPart.Write(...)
  • outerWriter.Close()
  • msg.Write(...)

Why?

A short write or buffer error in any of these calls produces a malformed iMIP reply. Google Calendar and Outlook silently reject malformed replies without recording the RSVP, so the user thinks they accepted the meeting but the organizer never sees it. Capturing the error and returning early makes the failure mode loud (caller gets an error) instead of silent (corrupt outbound mail).

No behavior change on the success path.

Closes #1128.

…atpane#1128)

The multipart body for an iMIP calendar reply was built with direct
Write / Fprint calls whose errors were discarded. A short write or
buffer error there produces a malformed reply that Google Calendar
and Outlook silently reject without recording the RSVP. Capture the
error from each of the eight writes/closes in the iMIP body block
and return early.

No behavior change on the success path.
@mvanhorn mvanhorn requested a review from a team as a code owner April 28, 2026 07:37
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Hi @mvanhorn! Please fix the following issues with your PR:

  • Title: Is too long (64 characters). The PR title must be strictly under 40 characters.
  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@github-actions github-actions Bot added bug Something isn't working ci labels Apr 28, 2026
@mvanhorn mvanhorn changed the title fix(sender): capture Write errors in SendCalendarReply iMIP body fix(sender): check Write errors in iMIP body Apr 28, 2026
@mvanhorn mvanhorn changed the title fix(sender): check Write errors in iMIP body fix(sender): check writes in iMIP body Apr 28, 2026
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Hi @mvanhorn! Please fix the following issues with your PR:

  • Title: Is too long (44 characters). The PR title must be strictly under 40 characters.

@floatpanebot floatpanebot dismissed stale reviews from themself April 28, 2026 07:39

Formatting issues have been resolved. Thank you!

@andrinoff andrinoff removed the ci label Apr 28, 2026
@andrinoff
Copy link
Copy Markdown
Member

@mvanhorn can you try to tackle some more complicated issues? We appreciate your contributions, but they seem unimpactful.

@andrinoff andrinoff self-requested a review April 28, 2026 13:44
Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

lgtm

@andrinoff
Copy link
Copy Markdown
Member

/approve

Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Approved on behalf of @andrinoff via /approve command.

@mvanhorn
Copy link
Copy Markdown
Contributor Author

Thanks for the approval and the candid feedback. Fair point that some of these have been small. If there's a specific issue or area where you'd value deeper work, happy to pick one up.

@andrinoff andrinoff merged commit bcbf045 into floatpane:master Apr 28, 2026
21 of 23 checks passed
@andrinoff
Copy link
Copy Markdown
Member

Thanks for the approval and the candid feedback. Fair point that some of these have been small. If there's a specific issue or area where you'd value deeper work, happy to pick one up.

@mvanhorn feel free to pick up any of the not good first issues. You can draft a PR and we will help you, if you will hit a roadblock.

We try to leave some of the good first issues for the non-experienced developers, and first-time contributors.

@mvanhorn
Copy link
Copy Markdown
Contributor Author

Really glad this one is in @andrinoff, thanks. Eight unchecked Write calls in the iMIP body is exactly the kind of silent path that only shows up when delivery breaks.

@mvanhorn
Copy link
Copy Markdown
Contributor Author

Thanks @andrinoff for the merge. Wrapping the eight unchecked iMIP body writes in the standard error-return idiom should make sender/sender.go a lot easier to debug when SMTP misbehaves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: SendCalendarReply ignores Write errors on alt/attach parts

3 participants