fix(sender): check writes in iMIP body#1182
Conversation
…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.
floatpanebot
left a comment
There was a problem hiding this comment.
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.
floatpanebot
left a comment
There was a problem hiding this comment.
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.
Formatting issues have been resolved. Thank you!
|
@mvanhorn can you try to tackle some more complicated issues? We appreciate your contributions, but they seem unimpactful. |
|
/approve |
floatpanebot
left a comment
There was a problem hiding this comment.
Approved on behalf of @andrinoff via /approve command.
|
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. |
|
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. |
|
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. |
What?
SendCalendarReplyinsender/sender.gobuilt its multipart iMIP body via directWrite/Fprint/Closecalls whose errors were discarded. This PR wraps each of the eight unchecked calls in the iMIP body block in the standard Goif _, 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.