Skip to content

fix(email-service): Attachment filetype guessing logic improvement#628

Merged
evanhutnik merged 3 commits intomainfrom
evan/attachment-types
Dec 15, 2025
Merged

fix(email-service): Attachment filetype guessing logic improvement#628
evanhutnik merged 3 commits intomainfrom
evan/attachment-types

Conversation

@evanhutnik
Copy link
Copy Markdown
Contributor

@evanhutnik evanhutnik commented Dec 15, 2025

Summary

If mime_guess can't determine the file type of the file, fallback to using everything after the last . in the filename.

application/ics isn't supported by mime_guess, so calendar invites with that mime type were failing to download. fallback to using the ics in invite.ics.

Also sometimes images have a .heic filename but a heif mime_type. heic is a subset of heif. In these cases, force the file type to be heic, so we don't upload the user's heic as an heif by guessing file type based on the mime_type.

Also store filename extensions as lowercase in the database. Will update existing ones later.

Screenshots, GIFs, and Videos

@evanhutnik evanhutnik merged commit 25745e3 into main Dec 15, 2025
35 checks passed
@evanhutnik evanhutnik deleted the evan/attachment-types branch December 15, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants