DNS resolution error: Malformed label (calendar.app + address book)

Issue Description

When using Calendar.app and picking invitees through Address book of apple - the address of recipient doesn’t seem to be correctly parsed by stalwart server

Expected Behavior

When creating a calendar even through standard Calendar.app on MacOS and picking an invitees through address book, stalwart server successfully parses the address and sends an invite

Actual Behavior

When picked from the address book, the recipient is filled in a form of “John Doe <[email protected]>”.
After doing it for a first time with Calendar.app, and sending the invite - after long enough time (like a day or maybe two) - I get the following in the inbox (name is changed but you get the gist)

There was a temporary problem delivering your message to the following recipients:

<john%20doe%20%[email protected]%3e> (failed to lookup 'gmail.com%3e': DNS resolution error: Malformed label: com%3e)

Reporting-MTA: dns;mail.mydomain.com
Arrival-Date: Tue, 11 Aug 2026 17:54:59 +0000

Final-Recipient: rfc822;john%20doe%20%[email protected]%3e
Action: delayed
Status: 4.0.0
Will-Retry-Until: Fri, 14 Aug 2026 17:54:59 +0000


From: "REDACTED"
Subject: Invitation: REDACTED
Date: 11 August 2026 at 19:54:59 GMT+2
To: <John%20Doe%20%[email protected]%3e>
Reply-To: 

... and so on ...
MIME-Version: 1.0
Content-Type: multipart/mixed;=20
	boundary=3D"18cad1d1712fd496_9f761ae259c395ee_2882d410b416a343"

Reproduction Steps

I didn’t dig to it deeply, but I reckon picking a contact from apple device that one has filled email under in an address book app - will do the trick

Relevant Log Output

The very first entry on the matter is already indicative of the problem:

2026-08-11T17:54:59Z INFO SMTP RCPT TO command (smtp.rcpt-to) to = "john%20doe%20%[email protected]%3e"

Stalwart Version

v0.16.x

Installation Method

Binary (Linux)

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

Internal

Additional Context

root@mail:~# stalwart --version
0.16.15

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

P.S. I don’t know what “no-ai” label means and whether I should’ve selected it, does it indicate that I am not an LLM? Or does it indicate that this issues shan’t be touched by LLM? Not self-evident

Please provide the iCalendar event that Apple created in Stalwart to see what the issue is.

Line breaks preserved, private info redacted or anonymized with “John Doe”.

BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
X-WR-CALNAME:JI 
METHOD:PUBLISH
PRODID:-//Apple Inc.//macOS 26.6.1//EN
X-CALENDARSERVER-ACCESS:PUBLIC
BEGIN:VEVENT
TRANSP:TRANSPARENT
DTEND;VALUE=DATE:20260819
X-APPLE-CREATOR-TEAM-IDENTITY:0000000000
ORGANIZER;CN="Ivan Kiselev";EMAIL="REDACTED":mailto:REDACTED
UID:EF22E161-04A7-418B-A37B-43C4F3166C69
DTSTAMP:20260813T093425Z
DESCRIPTION:REDACTED
X-APPLE-CREATOR-IDENTITY:com.apple.calendar
SEQUENCE:1
SUMMARY:JI 
DTSTART;VALUE=DATE:20260818
LAST-MODIFIED:20260813T093349Z
CREATED:20260813T093349Z
ATTENDEE;CN="John Doe";CUTYPE=INDIVIDUAL;EMAIL="John
 Doe <[email protected]>";PARTSTAT=NEEDS-ACTION:mailto:
 john%20doe20%[email protected]%3E
ATTENDEE;CN="Ivan Kiselev";CUTYPE=INDIVIDUAL;EMAIL="REDACTED";PA
 RTSTAT=ACCEPTED:mailto:REDACTED
ATTENDEE;CN="John Doe";CUTYPE=INDIVIDUAL;EMAIL="john.doe@gm
 ail.com":mailto:[email protected]
BEGIN:VALARM
TRIGGER;VALUE=DATE-TIME:19760401T005545Z
ACTION:NONE
END:VALARM
END:VEVENT
END:VCALENDAR

Re: “Line breaks preserved” - the original recipient name was much longer, so I guess calendar.app did line breaks for that reason? Idk why would they use line breaks anyways, that seems weird as hell, but what you got there is literal output of `bat invite.ics | pbcopy`.

I was surprised to discover all of these random line breaks, so had to double check with helix editor, and they truly are there.

The file is generated by clicking “email recipients” in calendar.app and copying the ics attachment generated, which I hope is exactly the event that apple calendar generates.

Fixed in v0.16.18 (yet to be released).

Hello!

Upgraded to 0.16.18 yesterday, and tried the same thing with the same recipient: Add a person from contact book into a calendar event through Calendar.app (obviously, stalwart-hosted calendar).

Now, there’s new behavior - nothing happens at all, seemingly. There’s no logs available for the matter when I add a person from Contact Book by typing their contact book name. In fact, when I add the person - there’s seemingly no activity at all (I tail -f logs without filtering and no new log lines are happening).

Shall I add the person by their email directly - it all works and there logs and they receive the invite and life is good.

Fixed in v0.16.19 (yet to be released).