mirror of
1
Fork 0
forgejo/services/mailer
christopher-besch 3de904c963 feat: parse inline attachments for incoming mail (#7136)
- Some email clients send inline attachments using the `multipart/related` Mime-Type and enmime collects these in the `Envelope.OtherParts` list; until now only Envelope.Attachments and Envelope.Inline were considered while parsing incoming mail.
- As some email clients send attachments without filename, especially in the multipart/related case, this PR implements `constructFilename`, which guesses the filename based on the ContentType.

How the issue was disovered:
I implemented an otherwise unrelated application written in go that parses emails with enmime just like Forgejo does.
I noticed that in a few occasions that system would fail to detect all attachments.
Investigating this issue led me to realize the above described issue.
After implementing a fix for that application, I looked through the Forgejo email parsing code and discovered the same problem.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7136
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: christopher-besch <mail@chris-besch.com>
Co-committed-by: christopher-besch <mail@chris-besch.com>
2025-03-07 17:54:26 +00:00
..
incoming feat: parse inline attachments for incoming mail (#7136) 2025-03-07 17:54:26 +00:00
token Improve usage of HMAC output for mailer tokens 2024-11-15 10:59:36 +01:00
mail.go fix: extend `forgejo_auth_token` table 2024-11-15 10:59:36 +01:00
mail_admin_new_user.go Enable `unparam` linter (#31277) 2024-06-16 13:42:58 +02:00
mail_admin_new_user_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.64.6 (forgejo) (#7118) 2025-03-04 21:38:35 +00:00
mail_auth_test.go [MAIL] Use correct function in mail footer 2024-07-26 15:16:54 +02:00
mail_comment.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
mail_issue.go mail issue: Display issue type in email header 2024-10-19 21:25:54 +02:00
mail_release.go Add option to change mail from user display name (#31528) 2024-07-22 15:44:13 +02:00
mail_repo.go Add option to change mail from user display name (#31528) 2024-07-22 15:44:13 +02:00
mail_team_invite.go Refactor locale&string&template related code (#29165) 2024-02-16 15:20:52 +01:00
mail_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.64.6 (forgejo) (#7118) 2025-03-04 21:38:35 +00:00
mailer.go Add option for mailer to override mail headers (#27860) 2024-06-09 11:13:39 +02:00
mailer_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
main_test.go [SECURITY] Notify users about account security changes 2024-07-23 18:31:47 +02:00
notify.go [GITEA] notifies admins on new user registration 2024-02-05 16:09:28 +01:00