iMIP invitation is dropped for good when the internal RCPT TO gets a temporary 4xx (e.g. inbound rate limit)

Issue Description

When an organizer sends many messages to the same internal colleague, the default inbound throttle “Sender address to recipient throttle” (key senderDomain + rcpt, 25 per hour) starts answering 452 4.4.5 Rate limit exceeded, try again later. After that, CalendarEvent/set with sendSchedulingMessages: true still succeeds, but the invitation never arrives: no event and no message at the attendee, no DSN and no notification for the organizer, and it is never retried.

Expected Behavior

A temporary (4xx) failure is temporary (RFC 5321, section 4.2.1): the iMIP message should be retried later (task result “temporary”), or at least the organizer should learn that it was not delivered (for example a DSN, or a CalendarEventNotification). Silent loss of an invitation is the worst outcome for scheduling.

Actual Behavior

The iMIP task logs the Calendar(ItipMessageError) event (“Server rejected RCPT-TO: 452 4.4.5 …”) and returns success; the message is gone.

Reproduction Steps

  1. Default inbound throttles (fresh install creates “Sender address to recipient throttle”: 25 / 1h, key senderDomain + rcpt).
  2. As [email protected] send 25 or more messages to [email protected] within an hour (EmailSubmission/set, any content).
  3. As user1, create an event with user2 as attendee:
curl -s -u "[email protected]:$PASS1" -H 'Content-Type: application/json' https://mail.example.com/jmap/ -d '{
  "using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:calendars"],
  "methodCalls": [["CalendarEvent/set", {"accountId": "c", "sendSchedulingMessages": true, "create": {"ev": {
    "calendarIds": {"b": true}, "@type": "Event", "title": "Planning", "uid": "[email protected]",
    "start": "2026-11-03T10:00:00", "timeZone": "Etc/UTC", "duration": "PT1H",
    "organizerCalendarAddress": "mailto:[email protected]",
    "participants": {
      "o": {"calendarAddress": "mailto:[email protected]", "roles": {"owner": true, "attendee": true}},
      "a": {"calendarAddress": "mailto:[email protected]", "roles": {"attendee": true}, "expectReply": true}}}}}, "s"]]}'
  1. The response is a normal created. user2 gets neither the event (CalendarEvent/query with filter.uid) nor an iMIP message, also after waiting. The server log shows smtp.rate-limit-exceeded; per the source the iMIP task then emits Calendar(ItipMessageError).

We hit this on our test server (v0.16.27) while running automated tests that send a few dozen messages to one test user; invitations then disappeared without any error on the organizer side.

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

Internal

Additional Context

Same class as CalendarEvent/set silently drops the invitation when the account lacks calendar-scheduling-send (fixed in 0.16.21), but a different code path: here the permission is fine and the drop happens in the iMIP task.

Where it seems to come from:

crates/services/src/task_manager/imip.rs, send_imip(): after handle_rcpt_to(), if session.has_failed() the code emits ItipMessageError and returns from the closure; the task then returns TaskResult::Success. The same happens for a rejected MAIL FROM or DATA. A 4xx reply could map to TaskResult::temporary(..) so the task manager retries it, and a 5xx reply to a bounce or notification for the organizer.

Side question: should the default “Sender address to recipient throttle” apply to authenticated local senders and internal deliveries at all? 25 messages per hour from one colleague to another is easy to reach in a normal office.

Stalwart v0.16.27, Docker image stalwartlabs/stalwart:v0.16-alpine, default setup from the bootstrap wizard.

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

This matches what the code actually does, confirmed from source. In crates/services/src/task_manager/imip.rs::send_imip, when handle_rcpt_to() fails (any error, 4xx or 5xx), the code logs Calendar(ItipMessageError) and just returns from the spawned task — there is no check of the SMTP status code, no retry logic, and no DSN/notification is generated. The outer send_imip function always returns TaskResult::Success(vec![]) regardless of what happened inside, so the task manager considers the iMIP delivery complete and will not retry it. Your reading of the source is accurate: a 452 4.4.5 rate-limit rejection on RCPT TO is treated identically to a permanent failure, and the invitation is simply discarded with only a log line, no organizer-facing signal.

As for the default “Sender address to recipient throttle”: it is an inbound MTA throttle scoped by key: ["senderDomain", "rcpt"] and is not special-cased for authenticated/internal senders, so it does apply to messages (including internally generated iMIP mail injected through the SMTP session) between colleagues on the same domain. Until this is addressed, a workaround is to scope or loosen that specific throttle (e.g. add a match condition excluding authenticated connections, or raise the count/period) via Settings → MTA → Inbound limits, since there is currently no code path that exempts iMIP scheduling messages from inbound throttles or retries them on 4xx.

Reference: Rate limits | Stalwart (inbound limits section) and crates/services/src/task_manager/imip.rs in the server source.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

The iMIP task in 0.16 logs the rejection and reports success, so a 452 at RCPT TO loses the invitation and nothing retries. This is already fixed on the 1.0 branch, where temporary rejections at MAIL FROM, RCPT TO or DATA are put back for retry. 1.0 is due at the end of this month or early November. A permanent 5xx is still only logged there, without anything going back to the organizer; I agree that should produce a notice.

On the side question, the default throttle applies to authenticated senders by design. For your test server, give it a match of is_empty(authenticated_as) so it only applies to unauthenticated senders, or raise the rate.