Forwarding html email

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Forwarding html email

aalinovi
I receive an html email which when I read it looks fine.
However, when I try to forward it, it is forwarded as plain text with
all of the html coding visible:

<!DOCTYPE html>
      <html>
        <head>
      </head>
      <body>
      <div id="entry">
      <h1 class="header"><a
href="https://www.schneier.com/blog/archives/2020/01/poli
      ce_surveill.html">Police Surveillance Tools from Special
Services Group</a></h1
      >

My ~/.mh_profile contains the line:
forw: -mime -annotate -nodash -format -editor vi

Thank you for any help.

Reply | Threaded
Open this post in threaded view
|

Re: Forwarding html email

Ralph Corderoy
Hi aalinovi,

> I receive an html email which when I read it looks fine.
> However, when I try to forward it, it is forwarded as plain text with
> all of the html coding visible:

May we have the output of ‘mhlist -verbose ...’ run on both the original
email and the one that you forwarded to yourself that you think is
faulty.

--
Cheers, Ralph.

Reply | Threaded
Open this post in threaded view
|

Re: Forwarding html email

aalinovi
Original message:

aalinovi:~$ mhlist -verbose
 msg part  type/subtype              size description
   4       text/html                 2813
             charset="us-ascii"
aalinovi:~$

Forwarded message:

alinovi:~$ mhlist
 msg part  type/subtype              size description
 112       text/plain                3105
aalinovi:~$

Thank you, Arthur

In message <[hidden email]>, Ralph Corderoy writes:

>Hi aalinovi,
>
>> I receive an html email which when I read it looks fine.
>> However, when I try to forward it, it is forwarded as plain text with
>> all of the html coding visible:
>
>May we have the output of =E2=80=98mhlist -verbose ...=E2=80=99 run on bo=
>th the original
>email and the one that you forwarded to yourself that you think is
>faulty.
>
>--=20
>Cheers, Ralph.
>

Reply | Threaded
Open this post in threaded view
|

Re: Forwarding html email

Ken Hornstein-2
In reply to this post by aalinovi
>forw: -mime -annotate -nodash -format -editor vi

This is the problem.  You can't have "-mime" and "-format".  Well,
you CAN, but it doesn't do what you want.  They basically cancel each
other out (like all nmh argument processing, the last argument wins).

If you use -mime, when you forw(1) stuff it will end up with a mhbuild
directive in the draft you need to process with the "mime" command.
That will end up with the proper MIME encoding (well, it will be a
message/rfc822, but inside of that the message will be correct).

If you use -format, it gets processed with mhl, and the draft is treated
as plain text (unless you mark it with a different MIME type manually).

If you use dist(1) it might be closer to what you want.

--Ken

Reply | Threaded
Open this post in threaded view
|

Re: Forwarding html email

Ralph Corderoy
Hi Ken,

> If you use dist(1) it might be closer to what you want.

Arthur used to use dist IIRC, and moved to forw because of problems.
Shouldn't he drop the -format in this case?

--
Cheers, Ralph.

Reply | Threaded
Open this post in threaded view
|

Re: Forwarding html email

Ken Hornstein-2
>> If you use dist(1) it might be closer to what you want.
>
>Arthur used to use dist IIRC, and moved to forw because of problems.
>Shouldn't he drop the -format in this case?

Yeah, probably.  Although ... that's not wonderful either.  I'm open
to ideas of how we could we could do this better.

--Ken

Reply | Threaded
Open this post in threaded view
|

Re: Forwarding html email

Ralph Corderoy
Hi Ken,

> > Shouldn't he drop the -format in this case?
>
> Yeah, probably.  Although ... that's not wonderful either.  I'm open
> to ideas of how we could we could do this better.

Yes, I see what you mean.  That forwards the whole email as the body of
a new one.

What Arthur's really after is storing the part of the email that's
interesting, and then having it as the MIME attachment, possibly the
only one, of a new email to send.  With the Subject field being carried
across too.

We've noted before how 42 refers to email 42, but 42.2 doesn't mean
part 2, nor 42.text/html all its text/html parts.

    forw -mime 42.text/html

--
Cheers, Ralph.

Reply | Threaded
Open this post in threaded view
|

Re: Forwarding html email

aalinovi
In reply to this post by Ken Hornstein-2
In message <[hidden email]>, Ken Hornstein writes:

>>forw: -mime -annotate -nodash -format -editor vi
>
>This is the problem.  You can't have "-mime" and "-format".  Well,
>you CAN, but it doesn't do what you want.  They basically cancel each
>other out (like all nmh argument processing, the last argument wins).
>
>If you use -mime, when you forw(1) stuff it will end up with a mhbuild
>directive in the draft you need to process with the "mime" command.
>That will end up with the proper MIME encoding (well, it will be a
>message/rfc822, but inside of that the message will be correct).
>
>If you use -format, it gets processed with mhl, and the draft is treated
>as plain text (unless you mark it with a different MIME type manually).
>
>If you use dist(1) it might be closer to what you want.

If I understand you correctly, I need the mime switch in the forw line
in mh_profile and I specifically have to type mime at the whatnow?
prompt.

This gets me what I want and if that's the way it's done, so be it. My
only complaint is that I don't see the message I'm forwarding.

Thank you

Arthur

Reply | Threaded
Open this post in threaded view
|

Re: Forwarding html email

Ralph Corderoy
Hi Arthur,

> This gets me what I want and if that's the way it's done, so be it. My
> only complaint is that I don't see the message I'm forwarding.

This edited transcript of what I did may help you work out your
preferred method, and possibly script it.

    $ cd /tmp
    $ mhstore -type text/html
    storing message 42 as file 42.html
    $ forw -build
    $
    $ cd
    $ cd `mhparam path`
    $ sed -i '/^--*$/,$d' draft
    $ echo Attach: /tmp/42.html >>draft
    $ mhbuild draft
    $ comp -u -file draft

--
Cheers, Ralph.

Reply | Threaded
Open this post in threaded view
|

Re: Forwarding html email

Andy Bradford-2
In reply to this post by aalinovi
Thus said [hidden email] on Fri, 10 Jan 2020 16:15:37 -0500:

> This gets me what I want and if that's the way it's done, so be it. My
> only complaint is that I don't see the message I'm forwarding.

You can always  re-edit after you have run the  mime command with "edit"
if I'm not mistaken.

Thanks,

Andy
--
TAI64 timestamp: 400000005e1a762a



Reply | Threaded
Open this post in threaded view
|

Re: Forwarding html email

Ralph Corderoy
Hi Andy,

> You can always  re-edit after you have run the mime command with "edit"
> if I'm not mistaken.

If one's very careful to preserve the ‘MIME-ness’ that's been created,
e.g. instead of inserting ‘6*7=42’ into the body it would have to be
‘6*7=3D42’.  Or a base64 section might need to be put through base64(1)
either side of the edit.

--
Cheers, Ralph.