Skip to content

[Bug]: Generated text/plain alternative contains no line breaks #421

Description

@weiss

Description

When composing in rich-text/HTML mode, the auto-generated text/plain part of the multipart/alternative email has all line breaks stripped. Block boundaries (<p>, <div>, <br>) are not converted to newlines, so the plain-text alternative collapses into a single run-on line. Clients preferring the text part show unreadable output.

Steps to Reproduce

  1. In rich-text mode, compose a body with multiple lines and/or a blank line:
   Line 1.
   Line 2.

   Paragraph 2.
  1. Send, then inspect the raw source of the received message.

Expected Behavior

The text/plain part preserves line structure (Line 1. / Line 2. / blank / Paragraph 2. on separate lines).

Actual Behavior

Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit

Line 1.Line 2.Paragraph 2.

No format=flowed present, so this is not an RFC 3676 reflow artifact—the newlines are genuinely absent from the generated part.

Disabling rich-text/HTML mode produces correct line breaks, so the bug seems to be about the HTML→text derivation.

Bulwark Version

1.7.3-31-g798a334 (main)

Stalwart Mail Server Version

0.16.8

Browser

No response

Operating System

None

Screenshots / Screen Recording

No response

Relevant Logs or Error Output

Additional Context

Node v24.16.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions