Skip to content
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

Reply body is partial when the original message has multiple nodes with class="mail-body" #1641

Closed
SergeyMosin opened this issue Jun 21, 2024 · 3 comments
Labels
external Issue is outside our code workaround

Comments

@SergeyMosin
Copy link

Describe the bug
When replying to a HTML messages that has multiple nodes with class="mail-body" (see image below) only the first node is copied into the reply composer window.

Possibly related to this function

bodyAsHTML() {
if (this.body) {
let clone = this.body.cloneNode(true);
clone.querySelectorAll('.sm-bq-switcher').forEach(
node => node.replaceWith(node.lastElementChild)
);
return (clone.querySelector('.mail-body') || clone).innerHTML;
}
let result = msgHtml(this);
return result.html || plainToHtml(this.plain());
}


image

@the-djmaze
Copy link
Owner

I wonder which mail application makes such a mess of our viewer.
Because only one <body> element should be in the HTML, but you received a message with three <body> elements.

@the-djmaze the-djmaze added external Issue is outside our code workaround labels Jun 23, 2024
@SergeyMosin
Copy link
Author

I wonder which mail application makes such a mess of our viewer. Because only one <body> element should be in the HTML, but you received a message with three <body> elements.

I think the message was generated by some scheduling software and sent via gmail and the forwarded by apple mail. Here is redacted structure:

X-Amavis-Modified: Mail body modified (using disclaimer) ...
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_F582449E-7B66-4A5B-97E5-7A96613F1556"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\))
X-Mail-Calendar-Part: Yes
X-Mailer: Apple Mail (2.3731.200.110.1.12)


--Apple-Mail=_F582449E-7B66-4A5B-97E5-7A96613F1556
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

TEXT_REDACTED...

--Apple-Mail=_F582449E-7B66-4A5B-97E5-7A96613F1556
Content-Type: multipart/mixed;
	boundary="Apple-Mail=_7DE24DA3-B494-4157-AAD2-FD178227A3AE"


--Apple-Mail=_7DE24DA3-B494-4157-AAD2-FD178227A3AE
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: =
after-white-space;">...HTML_REDACTED...</body></html>=

--Apple-Mail=_7DE24DA3-B494-4157-AAD2-FD178227A3AE
Content-Disposition: attachment;
	filename=invite.ics
Content-Type: text/calendar;
	x-unix-mode=0644;
	name="invite.ics"
Content-Transfer-Encoding: quoted-printable

BEGIN:VCALENDAR=0D=0APRODID:-//Google=20Inc//Google=20Calendar=20=
70.9054//EN=0D=0A...DATA_REDACTED...END:VCALENDAR=0D=
=0A=

--Apple-Mail=_7DE24DA3-B494-4157-AAD2-FD178227A3AE
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><body style=3D"overflow-wrap: break-word; -webkit-nbsp-mode: =
space; line-break: after-white-space;"><head><meta =
http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dus-ascii"></head>...HTML_REDACTED...</body></html>=

--Apple-Mail=_7DE24DA3-B494-4157-AAD2-FD178227A3AE
Content-Disposition: inline;
	filename=logo-email-sig-color.png
Content-Type: image/png;
	name="logo--email-sig-color.png"
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAAUUAAAA9CAYAAAA6cntFAAAACXBIWXMAAAqWAAAKlgGvphT+A...
--Apple-Mail=_7DE24DA3-B494-4157-AAD2-FD178227A3AE
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: =
after-white-space;"><div><div><span></span>
</div>
<div><br><blockquote type=3D"cite">...HTML_REDACTED...</blockquote></div><br></div></body></html>=

--Apple-Mail=_7DE24DA3-B494-4157-AAD2-FD178227A3AE--

--Apple-Mail=_F582449E-7B66-4A5B-97E5-7A96613F1556--

@the-djmaze
Copy link
Owner

the-djmaze commented Jun 23, 2024

I see. Apple mail has 3 text/html parts.
SnappyMail merges all parts because they are not marked as being inline or attachment (as RainLoop has made the code).

Instead of the current workaround by merging them.
Maybe merge the last two as blockquote?

the-djmaze pushed a commit that referenced this issue Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Issue is outside our code workaround
Projects
None yet
Development

No branches or pull requests

2 participants