nextcloud / nextcloud/mail

Composing plain text introduces NBSP characters

Open
#10,912 0 comments 0 reactions 1 assignee View on GitHub

@kesselb is already working on this.

Since May 20, 2025.

0. to triage bug
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Steps to reproduce
  1. Start New message, leave it in plain-text (no formatting toolbar).
  2. Write email with some leading spaces (indented lines) or multiple spaces in the middle of the line.
  3. Send the mail to yourself.
  4. Open the mail when delivered and download the EML file (or use View source, but that one introduces empty lines when copy/paste is used) - the steps are: ... on the message, ... More actions, Download message
  5. Check the content, it is not intended plain text because it placed sneaky NBSP characters (see below).
Expected behavior

Plain text mail should preserve all the characters as-is, spaces as spaces, not introduce NBSP to "preserve" formatting even in HTML output. This solves the plaintext only from Nextcloud mail for Nextcloud mail viewer, but it does not preserve plaintext formatting for mails sent from elsewhere.

Actual behavior

The mail content produces something like this:

Content-Type: text/plain; charset=utf-8
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

one
=C2=A0two =C2=A0 here
=C2=A0 =C2=A0three

It is quoted-printable for no good reason, because some spaces were replaced with =C2=A0 during the message creation.

Mail app version

4.2.6

Nextcloud version

31.0.1

Mailserver or service

Zimbra 8.x

Operating system

Ubuntu 24.04.2 LTS

PHP engine version

PHP 8.3

Nextcloud memory caching

No response

Web server

Apache (supported)

Database

PostgreSQL

Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.