-
Notifications
You must be signed in to change notification settings - Fork 936
Handle edge case when inline image attachment part is missing a filename #1350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Fixes mikel#1329 First attempt at a fix: mikel#1332 In this second attempt, I tried to scope down the issue to where the issue appears most probable: inline images. We do not add a default filename for the nameless attachment, rather just ensure that the message part is considered an attachment if it is an inline image.
79c3c8d
to
401b4e5
Compare
I'd love to see this merged in soon to fix an issue we’re seeing. @jeremy, anything you're waiting on before accepting this patch? |
@@ -2135,6 +2135,14 @@ def find_attachment | |||
filename | |||
end | |||
|
|||
def inline_image? | |||
image? && inline? | |||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline?
is a method on the Mail::Part subclass, so this'll break for a Mail::Message itself.
Could move this into Mail::Part and override the attachment?
method, perhaps?
# class Part < Message
def attachment?
super || inline_image?
end
# …
def inline_image?
# …
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback - I'll try to get this in next by next week!
(Moved to 2.8.0 release as this technically breaks compatibility with current stable 2.7.x.) |
@lao9 Please update this to latest master. Moved to 2.9 as it breaks compatibility with 2.7 and 2.8. |
Fixes #1329
First attempt at a fix: #1332
In this second attempt, I tried to scope down the issue to where the issue appears most probable: inline images.
We do not add a default filename for the nameless attachment, rather just ensure that the message part is considered an attachment if it is an inline image.