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
Better support for multipart/alternative? #587
Comments
I don't see any native support for this, unfortunately. As a workaround, I would tried setting
in .muttrc. I'm not at the keyboard now so I can't really test it. |
Thanks @gahr, I'll try that as soon as I'm back from a trip in about a week and get back to you. |
this is actually a project I've been working on for some time, and wrote a tool to convert my outgoing mail in HTML once I hit send. But that was wrong. Even though I did not try it, I think @gahr's suggestion won't work, because mutt is managing the multipart header for the attachments, and adding twice that header could lead to a |
I tried doing several huge macro hacks to generate an HTML attachment out of the full text one (using pandoc, because, yes, pandoc is And then converting the mail to multipart is still an issue I'm thinking about. The way I think would be a great UX would be to tag the parts we want to be the alternatives and mark them as such. (PS: sorry, had the cat walk over my hands and the trackpad and close the issue… I mean he really did it |
Indeed @guyzmo, @gahr's suggestion doesn't work, that just adds a second header to the message, leaving the original text/plain header intact. I honestly think this is a significant shortcoming of Mutt, and would love to see it addressed in some way. Since plain text email are no longer a sensible choice for many (our emails get read on a plethora of different devices), it would be great to have just a bit of added flexibility in this sense. If I were able to at least set the headers myself without Mutt messing with it afterwards, then I could write my own script to format the body properly and handle various scenarios ( Any feedback on this? |
actually, the Whether doing the alternative support as a script or as a patch will really depend on how much change and how complex that will be (basically, if to add multipart/alternative support, one shall only expose structs and functions, that'd be a good way to go, if actually patching is needed… then it's not). |
If Yes, I've sensed hostility to supporting At the end of the day it all boils down to this: In the current state, an email sent by Mutt has 100% chance to look like crap on a phone. Let that sink in. In 2017, if there's a new trick an old dog needs to be taught, that's proper support of current accessibility standards, or at least enough flexibility to let users compensate for the lack thereof. |
Sure, I share your frustration about this, and I'm saddened to see that HTML mail is everywhere, and that we get So, in the end, let's focus on how/where to solve this. I'm going to have a look at that when I'll have the time to, if you want as well, you're welcome to do so! You can also join the IRC channel #neomutt on freenode In terms of UX, what I've said is that we need to keep it simple, in the Then with a bit of macro magic (or scripting) you can automize the steps of select the body part, convert it as html into another part, select them both, make them alternatives, with the text/plain as default, and eventually send it. |
I apologize for the late reply, I've been busy after coming back home. I share your aversion to HTML email and its misuse, especially when plain text email would do just fine. But I have tried long and hard to get acceptable results using plain text emails (hell, I use plain text for everything) and things simply don't work as they should. The specifications are too old (hard line breaks instead of letting the receiving client deal with the wrapping), standards to work around their shortcomings ( What surprises me is the lack of reactions and discussion around the topic. Am I the only one with this issue? Do people actually use Mutt as their main MUA, knowing that their email might come horribly scrambled to the receiver? Are folks fine with that? I would never trust Mutt in its current state to send out a job application or any important email. I'd love to look into this, @guyzmo, but I'm not a C programmer nor an email expert, just a humble user trying to send some emails. I do thank you profusely for hearing me out in the first place, though! |
I use mutt as my main MUA, but I don't send that much mail and mostly keep it short. I'm not against writing markdown and using pandoc to convert it to html, but it's not an easy task to mangle the current mutt into doing this. |
I don't think talking mutt into producing html emails is a solution for this problem. It would just hide the issue for MUAs that do support html but do not handle the flowed format specs of MIME. Edit: inadvertently pushed Comment too early, continuing below: Doing so would just turn the problem the other way around: MUAs supporting HTML would display your email just fine, while text-only MUAs that do support Just thinking.. is this really a mutt issue? |
Well, currently my own work around is that when I send mails to people I know will read my mail on crappy UIs (phones, outlook…), I join ( When I'm talking with people that have a proper MUA, or should know how to configure (and chose) a decent MUA, then I do proper line breaks. And formatting. My goal is that I like to enforce presentation in my mails, doing some simple ASCII art or lines alignment, and people tend to read their mail with a variable width font. My personal take on using So is it a mutt issue? I don't think so, as it's been discarded as being an issue for a couple of decades. But it's definitely a feature request, which I hope we'll be able to implement with minimal changes to mutt. |
This is not really producing HTML email, the feature request is authoring |
If this boils down to having mutt respect and work with what I suggested earlier, namely |
Actually I managed to get this working with a fairly simple macro:
Problems arise only when turning this up a notch and trying to compose an email which has both
Again, producing HTML emails it's not the issue, that works just fine with the Pandoc macro.
That's exactly what As a side note, I had noticed that Mutt already has some awareness of
Not sure what to make of that, but it gave me hope when I was desperately trying to get this working. |
I'm not suggesting that this ability should be built into Mutt, far from it! Just that a user should be able to filter an attachment using his/her own scripts (already possible, it's a working feature) and set the desired content/type (which is a simple string of text). That's just interface scriptability, which is one of the main points of using Mutt. |
I am able to force the content type using the, surprise,
But so far I haven't been able to actually produce and send a multipart email. Might be a good start, though. |
Yep, that's exactly the issue. Filtering attachments through scripts works, setting a
Seems like this is very close to working, but something interferes while sending. |
Alright, I now understand the issue as a whole. Sorry if it took a few iterations ;) |
Ok, so this is how you send a multipart email with mutt:
Edit: not quite. This results in a |
to be clear, @gahr, the html thing not being part of mutt is what I'm advocating, and is one of the reasons I wanted Lua scripting (it's possible using macros, but my experiments made me endup doing a way too complex macro for that), and I've started doing it. We all agree that we don't want to see anything related to HTML within Mutt. Never. It shall happen in filters, scripts, anywhere else. About the multipart, what needs to happen is simply have the possibility to select (
you might also have a visual feedback to see when, and which attachments are part of an alternative, maybe alike the attachment view for multipart alternative:
I guess that's a long shot and maybe we should split the work in small increments toward proper compose support of the multipart/alternative. |
ok, so that's a start, we just need to make it not a huge absurd hack (editing parts from elsewhere, removing main attachments, changing the whole content-type etc.). |
I just found this. Has anybody seen / tried it? |
@guyzmo everything you said is correct. We might want to try to import that patch and see if it's sufficient. |
OMG |
@gahr We're definitely getting there, but, as you noted, using your method the email gets sent as I rejoice, however, in finding confirmation that a support for multipart messages is already present in Mutt! The automatic insertion of a |
Any luck with that patch @guyzmo? |
@libBletchley
That sounds really interesting and might be a better solution than |
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This work is based on commit 5b4f7a1 from @somini and was discussed at <neomutt#587>. As of now, one can tag entries in the compose menu and use <group-alternatives> to group those entries into one. If all the entries are tagged (including the fundamental part), then the email become a multipart/alternative one, otherwise it becomes a multipart/mixed one. There is some weird things to be noted, though: when postponning a multipart/alternative mail and then recall it, those entries get splitted up. This does not occurred for multipart/mixed mails.
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This work is based on commit 5b4f7a1 from @somini and was discussed at <#587>. As of now, one can tag entries in the compose menu and use <group-alternatives> to group those entries into one. If all the entries are tagged (including the fundamental part), then the email become a multipart/alternative one, otherwise it becomes a multipart/mixed one. There is some weird things to be noted, though: when postponing a multipart/alternative mail and then recall it, those entries get split up. This does not occurred for multipart/mixed mails.
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This work is based on commit 5b4f7a1 from @somini and was discussed at <#587>. As of now, one can tag entries in the compose menu and use <group-alternatives> to group those entries into one. If all the entries are tagged (including the fundamental part), then the email become a multipart/alternative one, otherwise it becomes a multipart/mixed one. There is some weird things to be noted, though: when postponing a multipart/alternative mail and then recall it, those entries get split up. This does not occurred for multipart/mixed mails.
This is still WIP, mutt segfaults right after sending the email. This is the work of @oblitium, based on this unattributed patch: https://github.com/altercation/arch-packages/blob/master/mutt-dgc-hg/dgc.groupalts References #587
This work is based on commit 5b4f7a1 from @somini and was discussed at <#587>. As of now, one can tag entries in the compose menu and use <group-alternatives> to group those entries into one. If all the entries are tagged (including the fundamental part), then the email become a multipart/alternative one, otherwise it becomes a multipart/mixed one. There is some weird things to be noted, though: when postponing a multipart/alternative mail and then recall it, those entries get split up. This does not occurred for multipart/mixed mails.
This work is based on commit 5b4f7a1 from @somini and was discussed at <#587>. As of now, one can tag entries in the compose menu and use <group-alternatives> to group those entries into one. If all the entries are tagged (including the fundamental part), then the email become a multipart/alternative one, otherwise it becomes a multipart/mixed one. There is some weird things to be noted, though: when postponing a multipart/alternative mail and then recall it, those entries get split up. This does not occurred for multipart/mixed mails.
This work is based on commit 5b4f7a1 from @somini and was discussed at <#587>. As of now, one can tag entries in the compose menu and use <group-alternatives> to group those entries into one. If all the entries are tagged (including the fundamental part), then the email become a multipart/alternative one, otherwise it becomes a multipart/mixed one. There is some weird things to be noted, though: when postponing a multipart/alternative mail and then recall it, those entries get split up. This does not occurred for multipart/mixed mails.
This work is based on commit 5b4f7a1 from @somini and was discussed at <#587>. As of now, one can tag entries in the compose menu and use <group-alternatives> to group those entries into one. If all the entries are tagged (including the fundamental part), then the email become a multipart/alternative one, otherwise it becomes a multipart/mixed one. There is some weird things to be noted, though: when postponing a multipart/alternative mail and then recall it, those entries get split up. This does not occurred for multipart/mixed mails.
Closed by 08f6862 |
It looks like a lot of work has been done on this issue, can someone point the discussion to the recommended way of using the new feature (e.g. to send a Gmail-style email with HTML attached?). Thank you. |
That request is now more than a year old, but for anyone who may find this issue in the future, here’s the documentation: https://neomutt.org/guide/mimesupport#5-%C2%A0mime-multipart-alternative It also contains an example macro to pipe a
|
Hm I still don't really understand how to read an |
Ok, I created a little own solution for opening text/html; cp %s /tmp/neomutt_alternative.html && sed -i "1s/^/<!DOCTYPE html> <html>/" /tmp/neomutt_alternative.html && echo "</html>" >> /tmp/neomutt_alternative.html && chromium /tmp/neomutt_alternative.html This will add the needed tags for a completed html file and it will open the modified file in chromium. |
I'm new to mutt and would like to use it for all my emails. I have spent the last couple of days trying to set up a sensible environment, but I'm hitting my head against (several) walls.
The struggle started when I realized that sending emails in plain text is not viable anymore nowadays, because hard line breaks render the text hardly readable on small screens, and I don't want my emails to be ugly and hardly readable. There's a couple of suggestions as to how to work around this with the unlucky standard
format=flowed
(set text_flowed
in mutt) and some ad-hoc setting in Vim (setlocal fo=aw
). I soon realized that this doesn't work in several major email clients. Text looking fine in Gmail web interface looked terrible in Outlook.format=flowed
is thus not a viable solution to this issue.It appears that the only way to get nicely wrapped, responsive text in emails is (horrors) marking it up with HTML. So I wrote a macro to convert the body of the message in the 'compose' window to HTML and change the
Content-Type
totext/html
just before sending — I use Pandoc, which has the nice side-effect of allowing me to use Markdown in my emails. So far so good, things are working and I'm happy. But what about email clients that are unable to display HTML? I don't want to give up plain text wholesale, I want my emails to be as accessible as possible.The standard solution to this is to use
Content-Type: multipart/alternative
and embed two versions of the same text in the body, one in plain text and one in HTML, delimiting the regions through a string namedboundary
:So I wrote a (rudimentary) shell script that takes the email body, converts it as needed, sets the various boundaries between regions, and outputs a new body readily formatted for
multipart/alternative
. I integrated the script into my mutt macro and did some testing.Well, nothing works as expected.
I write an email containing the following:
Then I close and drop into the 'Compose' window. I filter the body through my script with
F
and I get this back, as expected:Then I hit
^T
and changeContent-Type
tomultipart/alternative
. All looks good. I hit Enter to inspect the attachment. All looks good. I hitQ
to go back to 'Compose'. Mutt changed the content type back totext/plain
.I change the content type again. This time I send the message without inspecting the attachment. Mutt sends the email. I receive it in Gmail with the expected content type, an empty
noname
attachment and an empty body.I try again. This time I change content type before converting the body. Same behavior. Every time I inspect the attachment Mutt changes the content type back to
text/plain
. If I send the email, I get an empty body and an emptynoname
attachment.Is this a bug? Expected behavior? How can I send a
multipart/alternative
message using Mutt? Is support for this content type lacking? Can it be improved?The text was updated successfully, but these errors were encountered: