unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Forwarding inline html mails
@ 2021-12-04 13:50 inwit
  2021-12-04 15:42 ` David Bremner
  0 siblings, 1 reply; 12+ messages in thread
From: inwit @ 2021-12-04 13:50 UTC (permalink / raw)
  To: notmuch

I usually receive mails in html (sigh), and sometimes I need to forward them. However, when doing so with notmuch-emacs, the recipient of the forwarded message sees the html code instead of a readable message. I know I can forward the message as an attachment, but is there a way to forward it inline in a readable manner? Maybe stripping the html before sending, I guess, but I don't know how to do it. I've searched and I can't find anything in the list's archives. Has someone experienced this issue and maybe found a solution?

Thanks in advance!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-04 13:50 Forwarding inline html mails inwit
@ 2021-12-04 15:42 ` David Bremner
  2021-12-04 16:10   ` inwit
  2021-12-04 19:39   ` martin f krafft
  0 siblings, 2 replies; 12+ messages in thread
From: David Bremner @ 2021-12-04 15:42 UTC (permalink / raw)
  To: inwit, notmuch

"inwit" <inwit@sindominio.net> writes:

> I usually receive mails in html (sigh), and sometimes I need to forward them. However, when doing so with notmuch-emacs, the recipient of the forwarded message sees the html code instead of a readable message. I know I can forward the message as an attachment, but is there a way to forward it inline in a readable manner? Maybe stripping the html before sending, I guess, but I don't know how to do it. I've searched and I can't find anything in the list's archives. Has someone experienced this issue and maybe found a solution?

One option would be to use bounce (bound to b) instead of forward, if that works for
you. It will not change the 'From:' header , so that might confuse some recipients.

d

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-04 15:42 ` David Bremner
@ 2021-12-04 16:10   ` inwit
  2021-12-04 19:05     ` David Bremner
  2021-12-04 19:39   ` martin f krafft
  1 sibling, 1 reply; 12+ messages in thread
From: inwit @ 2021-12-04 16:10 UTC (permalink / raw)
  To: David Bremner, notmuch

On Sat Dec 4, 2021 at 4:42 PM CET, David Bremner wrote:

> One option would be to use bounce (bound to b) instead of forward, if that
> works for you. It will not change the 'From:' header , so that might confuse
> some recipients.
Thanks, David. Unfortunately, that won't do. 

There must be a way to render the html in plain text and then inserting it
inline in the forwarded message. Or maybe another approach that I don't see at
the moment. If there's no other alternative, I would be even willing to send that
single message in html (ugh), but I don't know if that would be possible with
notmuch.

Regards,


>
> d

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-04 16:10   ` inwit
@ 2021-12-04 19:05     ` David Bremner
  2021-12-07 22:24       ` inwit
  0 siblings, 1 reply; 12+ messages in thread
From: David Bremner @ 2021-12-04 19:05 UTC (permalink / raw)
  To: inwit, notmuch

"inwit" <inwit@sindominio.net> writes:

> On Sat Dec 4, 2021 at 4:42 PM CET, David Bremner wrote:
>
>> One option would be to use bounce (bound to b) instead of forward, if that
>> works for you. It will not change the 'From:' header , so that might confuse
>> some recipients.
> Thanks, David. Unfortunately, that won't do. 
>
> There must be a way to render the html in plain text and then inserting it
> inline in the forwarded message. Or maybe another approach that I don't see at
> the moment. If there's no other alternative, I would be even willing to send that
> single message in html (ugh), but I don't know if that would be possible with
> notmuch.
>
> Regards,

OK. I suspect the messages you are having trouble with are ill-formed
(or the recipients mail client is not good at MIME). I just tried
forwarding an HTML only message to myself and the HTML inside is
rendered fine (in notmuch-emacs). If you can find a sharable message
that is problematic for you, that might help understand the problem
better.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-04 15:42 ` David Bremner
  2021-12-04 16:10   ` inwit
@ 2021-12-04 19:39   ` martin f krafft
  2021-12-07 22:08     ` inwit
  1 sibling, 1 reply; 12+ messages in thread
From: martin f krafft @ 2021-12-04 19:39 UTC (permalink / raw)
  To: David Bremner; +Cc: inwit, notmuch


[-- Attachment #1.1: Type: text/plain, Size: 745 bytes --]

I use 
[htmldump](https://git.madduck.net/etc/mutt.git/blob/HEAD:/.config/mutt/htmldump) 
to render HTML mail to markdown, and then mutt's new 
multipart/alternative handling and [this 
script](https://git.madduck.net/etc/mutt.git/blob/HEAD:/.config/mutt/markdown2html) 
to turn markdown back into HTML on sending, and this will also take 
care of forwarded emails to a suitable degree.

-- 
@martinkrafft | https://matrix.to/#/#madduck:madduck.net
  
"when a woman marries again it is because she detested her first husband.
  when a man marries again it is because he adored his first wife.
  women try their luck; men risk theirs."
                                                       -- oscar wilde
  
spamtraps: madduck.bogus@madduck.net

[-- Attachment #1.2: Type: text/html, Size: 1494 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-04 19:39   ` martin f krafft
@ 2021-12-07 22:08     ` inwit
  2021-12-08  0:03       ` martin f krafft
  2021-12-08  0:51       ` David Bremner
  0 siblings, 2 replies; 12+ messages in thread
From: inwit @ 2021-12-07 22:08 UTC (permalink / raw)
  To: martin f krafft, David Bremner; +Cc: notmuch

On Sat Dec 4, 2021 at 8:39 PM CET, martin f krafft wrote:
> I use
> [htmldump](https://git.madduck.net/etc/mutt.git/blob/HEAD:/.config/mutt/htmldump)
> to render HTML mail to markdown, and then mutt's new multipart/alternative
> handling and [this
> script](https://git.madduck.net/etc/mutt.git/blob/HEAD:/.config/mutt/markdown2html)
> to turn markdown back into HTML on sending, and this will also take care of
> forwarded emails to a suitable degree.
Thanks! However, if I understood it correctly, this means sending mail in html,
and I was hoping to forward them in plain text, by stripping html and leaving a
legible txt form (such as the one displayed in notmuch-show).

Regards,

>
> --
> @martinkrafft | https://matrix.to/#/#madduck:madduck.net
>   
> "when a woman marries again it is because she detested her first
> husband.
> when a man marries again it is because he adored his first wife.
> women try their luck; men risk theirs."
> -- oscar wilde
>   
> spamtraps: madduck.bogus@madduck.net

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-04 19:05     ` David Bremner
@ 2021-12-07 22:24       ` inwit
  2021-12-08  0:30         ` David Bremner
  0 siblings, 1 reply; 12+ messages in thread
From: inwit @ 2021-12-07 22:24 UTC (permalink / raw)
  To: David Bremner, notmuch

On Sat Dec 4, 2021 at 8:05 PM CET, David Bremner wrote:
> OK. I suspect the messages you are having trouble with are ill-formed (or the
> recipients mail client is not good at MIME). I just tried forwarding an HTML
> only message to myself and the HTML inside is rendered fine (in
> notmuch-emacs).
I've done some more testing and now the situation is a bit clearer. At work I have to deal with an Office365 mail server. Then, if I fw an html-only message, the webmail interface of the receiver shows the fw'd mail as an attachment and my email like this:

```
(whatever comment I had added to the message)

-------------------- Start of forwarded message --------------------
From: (sender)
To: (me)
Subject: (whatever)
Date: Thu, 2 Dec 2021 18:36:14 +0100
```

This is of course confusing because the receiver sees an empty message and
might not expect an attachment.

I thought I could solve this by adding `disposition=inline` to the <#part ...>
line, but unfortunately this doesn't work either.

Any other ideas are more than welcome.

Regards,


> If you can find a sharable message
> that is problematic for you, that might help understand the problem
> better.
Any html-only message is displayed (fw'd?) as an attachment.

Regards,

>
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-07 22:08     ` inwit
@ 2021-12-08  0:03       ` martin f krafft
  2021-12-08  0:51       ` David Bremner
  1 sibling, 0 replies; 12+ messages in thread
From: martin f krafft @ 2021-12-08  0:03 UTC (permalink / raw)
  To: inwit; +Cc: notmuch


[-- Attachment #1.1: Type: text/plain, Size: 529 bytes --]

Regarding the following, written by "inwit" on 2021-12-07 at 23:08 Uhr +0100:
>Thanks! However, if I understood it correctly, this means sending 
>mail in html, and I was hoping to forward them in plain text, by 
>stripping html and leaving a legible txt form (such as the one 
>displayed in notmuch-show).

Just don't convert it to HTML on sending then…

-- 
@martinkrafft | https://matrix.to/#/#madduck:madduck.net
  
who's general failure, and why's he reading my disk?
  
spamtraps: madduck.bogus@madduck.net

[-- Attachment #1.2: Type: text/html, Size: 1584 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-07 22:24       ` inwit
@ 2021-12-08  0:30         ` David Bremner
  2021-12-08  0:42           ` David Bremner
  0 siblings, 1 reply; 12+ messages in thread
From: David Bremner @ 2021-12-08  0:30 UTC (permalink / raw)
  To: inwit, notmuch

"inwit" <inwit@sindominio.net> writes:
>
>
>> If you can find a sharable message
>> that is problematic for you, that might help understand the problem
>> better.
> Any html-only message is displayed (fw'd?) as an attachment.
>

In fact any message is forwarded as an attachment, whether html or not.

So I'm wondering if that's the underlying issue for you.

d

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-08  0:30         ` David Bremner
@ 2021-12-08  0:42           ` David Bremner
  0 siblings, 0 replies; 12+ messages in thread
From: David Bremner @ 2021-12-08  0:42 UTC (permalink / raw)
  To: inwit, notmuch

David Bremner <david@tethera.net> writes:

> "inwit" <inwit@sindominio.net> writes:
>>
>>
>>> If you can find a sharable message
>>> that is problematic for you, that might help understand the problem
>>> better.
>> Any html-only message is displayed (fw'd?) as an attachment.
>>
>
> In fact any message is forwarded as an attachment, whether html or not.
>
> So I'm wondering if that's the underlying issue for you.
>
> d

Apologies, I spoke too quickly, it rather depends on
message-forward-make-body, which in turn inspects the variable
message-forward-as-mime, so you may want to try setting that to nil
(perhaps in a wrapper function).

d

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-07 22:08     ` inwit
  2021-12-08  0:03       ` martin f krafft
@ 2021-12-08  0:51       ` David Bremner
  2021-12-08 17:03         ` inwit
  1 sibling, 1 reply; 12+ messages in thread
From: David Bremner @ 2021-12-08  0:51 UTC (permalink / raw)
  To: inwit; +Cc: notmuch

"inwit" <inwit@sindominio.net> writes:

> Thanks! However, if I understood it correctly, this means sending mail in html,
> and I was hoping to forward them in plain text, by stripping html and leaving a
> legible txt form (such as the one displayed in notmuch-show).

I guess we could quibble about whether that counts as forwarding the
message, but you probably don't care what the email purists think.

The good news is that reply already sort works like you want (rendering
html to text). At least for simple cases maybe start with the elisp code
for notmuch-show-reply (or notmuch-mua-new-reply) and either hack that
or hack the output using e.g. keyboard macros to make things like you
want.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Forwarding inline html mails
  2021-12-08  0:51       ` David Bremner
@ 2021-12-08 17:03         ` inwit
  0 siblings, 0 replies; 12+ messages in thread
From: inwit @ 2021-12-08 17:03 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch

On Wed Dec 8, 2021 at 1:51 AM CET, David Bremner wrote:
> I guess we could quibble about whether that counts as forwarding the
> message, but you probably don't care what the email purists think.
Absolutely right.

> The good news is that reply already sort works like you want (rendering html
> to text). At least for simple cases maybe start with the elisp code for
> notmuch-show-reply (or notmuch-mua-new-reply) and either hack that or hack the
> output using e.g. keyboard macros to make things like you want.
I'll have a look, although in a first quick browse I think for now I'll be using
reply instead of fw in such cases (it works ok). My knowledge of elisp is not
enough for anything else thus far.

Thanks!!

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-12-08 17:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-04 13:50 Forwarding inline html mails inwit
2021-12-04 15:42 ` David Bremner
2021-12-04 16:10   ` inwit
2021-12-04 19:05     ` David Bremner
2021-12-07 22:24       ` inwit
2021-12-08  0:30         ` David Bremner
2021-12-08  0:42           ` David Bremner
2021-12-04 19:39   ` martin f krafft
2021-12-07 22:08     ` inwit
2021-12-08  0:03       ` martin f krafft
2021-12-08  0:51       ` David Bremner
2021-12-08 17:03         ` inwit

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).