Skip to content
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

Issue #25: mixed + alternative not supported #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

simongreen-net
Copy link

No description provided.

@simongreen-net
Copy link
Author

simongreen-net commented Jun 25, 2017

Fixes the issues with pull request #40, along with some more tests.

@pali
Copy link
Contributor

pali commented Jun 25, 2017

Does not look like a good change as it completely remove method parts. This breaks backward API compatibility.

@pali
Copy link
Contributor

pali commented Jun 25, 2017

E.g. you can fix it by adding re-implementing method parts:

sub parts {
  my $self = shift;
  return ($self->text_parts(@_), $self->attach_parts(@_));
}

@simongreen-net
Copy link
Author

Thanks @pali for your comment. I have uploaded a new PR that re-adds the parts subroutine.

@pali
Copy link
Contributor

pali commented Jul 24, 2017

I was thinking about this change and there is small terminology problem... In email is every part either attachment or inline. In Email::Stuffer documentation there is text body, html body and attachment.

In your patch you use text part for Email::Stuffer text body and html body and attach part for Email::Stuffer attachment.

Moreover, if somebody want to create email inline part, then it is possible via Email::Stuffer attachment attribute disposition => "inline".

Also email attachment can be plain text, but in your patch it would not be in text part.

Therefore I would suggest to not use text part in your patch, but rather invent better name (also for method text_part. Maybe body part as those covers only text_body and html_body?

@simongreen-net
Copy link
Author

If an attachment (specifically something in attach_part) is of text/* and it's disposition is inline, then most e-mail clients (at least Thunderbird) will show the attachment inline. This is the correct behaviour because since the first text part might be a multipart/alternate, i.e. both text and html, where only one should be shown, while the text attachment is a text/plain or text/html.

Therefore I would suggest to not use text part in your patch, but rather invent better name (also for method text_part. Maybe body part as those covers only text_body and html_body?

I don't support this, since I think my patch already handles the situation where an attachment is of the type text/* as it should.

@pali
Copy link
Contributor

pali commented Jul 25, 2017

If an attachment (specifically something in attach_part) is of text/* and it's disposition is inline, then most e-mail clients (at least Thunderbird) will show the attachment inline. This is the correct behaviour because since the first text part might be a multipart/alternate, i.e. both text and html, where only one should be shown, while the text attachment is a text/plain or text/html.

Yes it is correct behavior and does not contradict what I wrote.

Therefore I would suggest to not use text part in your patch, but rather invent better name (also for method text_part. Maybe body part as those covers only text_body and html_body?

I don't support this, since I think my patch already handles the situation where an attachment is of the type text/* as it should.

Note, your patch does not handle it. In sub attach you unconditionally do:
push @{$self->{attach_parts}}, Email::MIME->create(...)
even when passed part is marked as inline via disposition => "inline" user attribute.

But as I wrote Email::Stuffer already treat everything but text_body/html_body as attachment independently of disposition, even it is inline. Because of this fact and current Email::Stuffer terminology I suggested to use name body_parts instead of text_parts without changing code. As opposite of Email::Stuffer's attach is Email::Stuffer's body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants