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

Forwarding #314

Closed
frasertweedale opened this issue Jul 30, 2019 · 10 comments
Closed

Forwarding #314

frasertweedale opened this issue Jul 30, 2019 · 10 comments
Assignees
Labels
Milestone

Comments

@frasertweedale
Copy link
Member

Is your feature request related to a problem? Please describe.
Need to be able to forward messages. Should go to compose view with forwarded message as attachment.

Describe the solution you'd like
Messages should be forwarded as-is, i.e. the content on disk, not serialising the parsed data.

Describe alternatives you've considered
It's a baseline feature.

@frasertweedale frasertweedale added this to the 1.0 milestone Jul 30, 2019
@frasertweedale
Copy link
Member Author

Note: bouncing is a similar category but bit different from user POV and may need some changes to mailer API (i.e. to explicitly specify SMTP recipient(s) instead of deriving them from the mail).

@romanofski
Copy link
Member

I think for bounce we need a separate card.

@frasertweedale
Copy link
Member Author

Bounce: #315.

@romanofski
Copy link
Member

I've played around with this a bit. It is actually a very simple patch, except perhaps the creation of the attachment from a MIMEMessage. At the moment purebred-email provides functions to create attachments from ByteStrings or a FilePath. Would it make sense to provide a function to create an attachment from a MIMEMessage too?

@frasertweedale
Copy link
Member Author

@romanofski it's a common enough use case that it makes sense to have a shortcut to "lift" a MIMEMessage into an attachment with the correct Content-Type etc. I'll put something into purebred-email.

frasertweedale added a commit to purebred-mua/purebred-email that referenced this issue Aug 7, 2019
Add the 'forward' function which encapsulates a message as the body
of a 'message/rfc822' messagse.  Add this scenario to round-trip
tests.

No special behaviour is available for parsing of such messages yet.
i.e. parsing succeeds, but the encapsulated message is not reflected
in the structure of the outer MIMEMessage.

Related: purebred-mua/purebred#314
@frasertweedale
Copy link
Member Author

frasertweedale commented Aug 7, 2019

@romanofski see purebred-mua/purebred-email@f98ea3e for construction.

I'm considering whether to change the structure of MIMEMessage to make encapsulation first class, and forcibly parse the inner message during parsing. There are advantages and disadvantages:

  • advantage: from user POV, nested structure is first class and can access the part(s) of the encapsulated message via the usual folds.

  • disadvantage: a unparsable encapsulated message results in whole message being unparseable.

What are your thoughts?

update see purebred-mua/purebred-email@60b45ae for what it looks like with dedicated constructor.

frasertweedale added a commit to purebred-mua/purebred-email that referenced this issue Aug 7, 2019
Add the 'Encapsulated :: MIMEMessage -> MIME' constructor for
first-class representation of the content of the message/rfc822
messages.  Update parser, printer and 'entities' optic accordingly.

Related: purebred-mua/purebred#314
@romanofski
Copy link
Member

Hm.. the disadvantage reads like a deal breaker. Would that mean that messages which are a little bit stuffed and up in purebred as not displayable? If that is the case I would vote for not doing it. Given the amount of bad emails, I think we do need a bit of leeway when it comes to errors in the format.

Having a look at your patch tho, it doesn't look as bad. Not sure if I got something wrong.

@frasertweedale
Copy link
Member Author

@romanofski I like the usability too much now that i coded it up. I reckon I can split the difference and fall back to 'Part' if parsing the encapsulated message fails, or maybe another constructor that indicates "Failed to parse encapsulated message".

I'm also going to remove the 'forward' terminology, the RFC talks about "encapsulation", with forwarding being an application of such.

@frasertweedale
Copy link
Member Author

Basically, we want to parse as much of the structure as we can, and indicate "dead branches" as such, instead of felling the whole tree :D

@romanofski
Copy link
Member

Ah that's a great idea!!

frasertweedale added a commit to purebred-mua/purebred-email that referenced this issue Aug 22, 2019
Add the 'Encapsulated :: MIMEMessage -> MIME' constructor for
first-class representation of the content of the message/rfc822
messages.  Update parser, printer and 'entities' optic accordingly.
Add encapsulation to the round-trip tests.

Related: purebred-mua/purebred#314
@romanofski romanofski self-assigned this Jan 23, 2020
romanofski added a commit that referenced this issue Jan 30, 2020
This patch implements forwarding of e-mails. Mails which are forwarded
are encapsulated as inline mails. The subject is set to a combination of
from address and subject of the encapsulated mail.

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

No branches or pull requests

2 participants