astroidmail / astroid

A graphical threads-with-tags style, lightweight and fast, e-mail client for Notmuch
http://astroidmail.github.io
Other
613 stars 65 forks source link

Replying to messages without a text/plain portion #319

Closed jimcheetham closed 5 years ago

jimcheetham commented 7 years ago

Similar to #236, I get a lot of email (from users of the Outlook client, via Exchange) that arrives with no text/plain portion at all.

If I'm lucky they are MIME-delineated, but I've seen them arrive with only a Content-Type main header as well.

Not having them render HTML by default seems sensible, but they're therefore difficult to preview and reply to.

When using alot, I used to be able to generate my own text versions (I believe by asking mailcap(5), which would do something like run the file through lynx -dump); can we do something similar here?

otwieracz commented 5 years ago

Is this really closed? I am still not able to reply to HTML-only email, I end up quoting bunch of HTML nonsense.

gauteh commented 5 years ago

No, not really fixed.

otwieracz commented 5 years ago

Are there any plans how to deal with that issue? Is this somehow possible to reply to HTML-only email? Any known workaround? Turns out I receive quite a lot HTML-only emails and it become a showstopper…

agrudzinsky commented 5 years ago

Is it possible to create a "reply hook" that would pipe the original message to a filter before inserting it into the editor? Then this issue could be fixed by simply using "lynx -dump" or the like.

My company mail server also inserts "[EXTERNAL]" in the subject of emails received from outside the company and warnings inside the email body. Those get replicated in replies and create visual clutter. I can use this "reply hook" to remove them as well.

gauteh commented 5 years ago

Yes, it should be fairly easy to set up a plugin hooks in the same way as process is done now for reply messages as well. There were some recent issues on that, might find them if you search for process (which only applies to opening messages for viewing).

https://github.com/astroidmail/astroid/wiki/Plugins#astroidactivatable

gauteh commented 5 years ago

Something that is a possibility is to have HTML converted to markdown when quoting, then replying in markdown. This depends on how good the html->markdown converter is. Would that solve the issue for you?

otwieracz commented 5 years ago

Well, as you said it depends on the converter quality. I am not using it at all, so hard to tell. Front my experience however there is no such thing as “good html parser” :)

-- sg

On 6 Mar 2019, at 16:09, Gaute Hope notifications@github.com wrote:

Something that is a possibility is to have HTML converted to markdown when quoting, then replying in markdown. This depends on how good the html->markdown converter is. Would that solve the issue for you?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

gauteh commented 5 years ago

True..

On Wed, Mar 6, 2019 at 4:18 PM Slawomir Gonet notifications@github.com wrote:

Well, as you said it depends on the converter quality. I am not using it at all, so hard to tell. Front my experience however there is no such thing as “good html parser” :)

-- sg

On 6 Mar 2019, at 16:09, Gaute Hope notifications@github.com wrote:

Something that is a possibility is to have HTML converted to markdown when quoting, then replying in markdown. This depends on how good the html->markdown converter is. Would that solve the issue for you?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/astroidmail/astroid/issues/319#issuecomment-470146282, or mute the thread https://github.com/notifications/unsubscribe-auth/AADd-xtbT1HnwDoZa4iqpMZ4yPQeWnL1ks5vT9wngaJpZM4M8HfR .

agrudzinsky commented 5 years ago

Quoting Gaute Hope (2019-03-06 07:09:26)

Something that is a possibility is to have HTML converted to markdown when quoting, then replying in markdown. This depends on how good the html->markdown converter is. Would that solve the issue for you?

Replying in HTML is not important. I prefer to reply in text. But the original email needs to be quoted in a reasonable way. Currently, astroid quotes HTML in the text/plain reply without any conversion which makes astroid unusable for me.

I would let the user choose how they want to convert HTML into text (as it is done in mutt). w3m -dump or any other html to text or markdown converter would work. Just need the ability to pass HTML through a filter before inserting in the reply.

-- Arkady

gauteh commented 5 years ago

Yes, I think we could do that as a first iteration anyway. Then users could just choose a markdown convertor if so preferred (e.g. https://github.com/domchristie/turndown).

otwieracz commented 5 years ago

This issue is really killing me… Every single time I hit reply, shout nasty words, exit vim, Ctrl+W, confirm closing message, select rendered HTML, hit reply again and paste it into vim.

I desperately ask for any kind of solution, please. Is there anything I can do to help without C++ experience?

gauteh commented 5 years ago

Agreed, it is a major pain in the ... for me too. I am now receiving more and more html only outlook email.

On Mon, Mar 11, 2019 at 7:15 PM Slawomir Gonet notifications@github.com wrote:

This issue is really killing me… Every single time I hit reply, shout nasty words, exit vim, Ctrl+W, confirm closing message, select rendered HTML, hit reply again and paste it into vim.

I desperately ask for any kind of solution, please. Is there anything I can do to help without C++ experience?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/astroidmail/astroid/issues/319#issuecomment-471659277, or mute the thread https://github.com/notifications/unsubscribe-auth/AADd-1QvoBAONbhq7Uc6tWp_b1GyBus9ks5vVp1ZgaJpZM4M8HfR .

gauteh commented 5 years ago

Please test #626.

gauteh commented 5 years ago

Should be fixed with #626.

fakhir commented 4 years ago

A rough workaround for replying with cleaner HTML in emails, without intermediate translation, is as follows (warning: this doesn't generate completely valid HTML but most email readers still render this correctly):

In the config I've set the options as follows:

    "editor": {
        "markdown_processor": "pandoc -f markdown_github -t html",
        "markdown_on": "true"
    },
    "mail": {
        "reply": {
            "quote_processor": "cat",
        },
    },
    ...

The pandoc "markdown_github" format works well with html tags within markdown, so it handles the HTML tags correctly and puts the whole quoted email within a \

.