Riduidel / rrss2imap

A rust reimplementation of rss2email (the Rui Carmo branch)
21 stars 5 forks source link

Some messages appear as pure text, there must be some formatting problem #109

Closed Riduidel closed 1 year ago

Riduidel commented 1 year ago

Seems like I failed some parts. As an example, the following message

From: <TheDreadShips <thedreadships@www.twitter.com>>
To: <Nicolas Delsaux <nicolas.delsaux@gmx.fr>>
Subject: [TheDreadShips] Every time I post a picture of a ship in dazzle camouflage,
     somebody says they can't see it.

This is why I add alt text. https://t.co/pfYKdXXMOk
Date: Sun, 18 Jun 2023 12:53:29 +0000
Message-ID: <1769c5b1edf1ed3a.eba82ccddb70abf9.6c893376aa98d54c@raspberrypi>
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

        <html>
        <head>
            <meta http-equiv=3D"Content-Type" content=3D"text/html">
            <style>
                img {
    max-width: 100% !important;
    height: auto;
}

body,
#body {
    font-size: 12pt;
    word-wrap: break-word;
    -webkit-nbsp-mode: space;
    -webkit-line-break: after-white-space;
    font-family: Georgia, Times New Roman, Times, serif;
}

a:link {
    color: #0000cc
}

h1.header a {
    font-weight: normal;
    text-decoration: none;
    color: black;
}

.summary {
    font-size: 80%;
    font-style: italic;
}

            </style>
        </head>
   =20
        <body>
            <div id=3D"entry">
                <h1 class=3D"header"><a href=3D"https://twitter.com/TheDread=
Ships/statuses/1670414429060562944">[TheDreadShips] Every time I post a pict=
ure of a ship in dazzle camouflage, somebody says they can't see it.

This is why I add alt text. https://t.co/pfYKdXXMOk</a></h1>
                <div id=3D"body"><div style=3D'float:left;margin: 0 6px 6px =
0;'>
    <a href=3D'https://twitter.com/TheDreadShips/statuses/1670414429060562944' =
border=3D0 target=3D'blank'>
        <img src=3D"" border=3D=
0 />
    </a>
</div>
<strong>Dreadnought Holiday</strong> <a href=3D'https://twitter.com/TheDread=
Ships' target=3D'blank'>@TheDreadShips</a><br />
Every time I post a picture of a ship in dazzle camouflage, somebody says th=
ey can't see it.

This is why I add alt text. <a href=3D"https://t.co/pfYKdXXMOk" target=3D"bl=
ank">pic.twitter.com/pfYKdXXMOk</a><img src=3D"" border=3D0 />

</div>
                <p class=3D"footer">URL: <a href=3D"https://twitter.com/TheD=
readShips/statuses/1670414429060562944">https://twitter.com/TheDreadShips/st=
atuses/1670414429060562944</a></p>
            </div>
        </body>
    </html>
       =20

is rendered as raw text, instead of HTML.

Riduidel commented 1 year ago

Oh that's funny! In fact, mail-builder doesn't remove \n characters in title. As a consequence, tweets like

... but also the conditions down there.

It also experimented
     with different designs for nets and fishing techniques, and was one of the
     first vessels to be equipped with a computer. https://t.co/D4SDgtx0BK

appear to have a multi-line title which becomes a multiline header, what is obviously unsupported in the mail standard. Really, a funny bug : HARD to find, but solved in a few lines.