Stalwart calenders iTIP gets rejected

Issue Description

On a stalwart calender:

When sending calender invites from a stalwart calender using either thunderbird or bulwark i get an error mail that says “rejected command ‘DATA’ with code 500 (5.2.3) 'line too long”

If i use a local calendar in thunderbird and configure thunderbird to send mails directly using ahasend then it works fine.

All other mails work fine.

In stalwart routing im using send.ahasend.com as a relay host for all external domains.

Expected Behavior

Accepted

Actual Behavior

*Your message could not be delivered to the following recipients:

jesper@xxxx_com (host ‘send_ahasend_com’ rejected command ‘DATA’ with code 500 (5.2.3) ‘line too long’)*

(had to replace . with _ to get the post accepted)

Reproduction Steps

open stalwart calendar in thunderbird or bulwart
send an invite
get the mail back with error

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Meilisearch

Directory Backend

Internal

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

Maybe it’s:

Stalwart’s default inline logo in every generated iMIP message is emitted with bare LF line endings.

  • imip.rs:105-109 marks pre-encoded logo content as raw base64.
  • lib.rs:432+ defines that base64 string with Rust multiline-string \n, not SMTP-required \r\n.

Because .transfer_encoding("base64") bypasses mail-builder’s normal MIME encoding/line normalization, strict SMTP receivers can treat the entire embedded image as one giant SMTP line and reject DATA with 500 5.2.3 line too long.

Maybe fix:

before emitting the raw base64 logo, convert LF to CRLF—or preferably decode it and let mail-builder base64-encode/wrap it itself.