From dc4ea1865aa9a4d5d394f17ba42544a972a82f69 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Thu, 13 Nov 2025 19:36:35 +0100 Subject: [PATCH] fix: set `get_max_smtp_rcpt_to` for chatmail to the actual limit of 1000 instead of unlimited. (#7432) adb brought this up in an internal discussion. With the recent introduction of channels it becomes easier to hit the limit and it becomes impossible to send messages to a channel with more than 1000 members, this pr fixes that. --------- Co-authored-by: Hocuri --- src/constants.rs | 3 +++ src/context.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/constants.rs b/src/constants.rs index 7d377289d..01b847fb8 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -223,6 +223,9 @@ pub(crate) const DC_FOLDERS_CONFIGURED_VERSION: i32 = 5; // `max_smtp_rcpt_to` in the provider db. pub(crate) const DEFAULT_MAX_SMTP_RCPT_TO: usize = 50; +/// Same as `DEFAULT_MAX_SMTP_RCPT_TO`, but for chatmail relays. +pub(crate) const DEFAULT_CHATMAIL_MAX_SMTP_RCPT_TO: usize = 999; + /// How far the last quota check needs to be in the past to be checked by the background function (in seconds). pub(crate) const DC_BACKGROUND_FETCH_QUOTA_CHECK_RATELIMIT: u64 = 12 * 60 * 60; // 12 hours diff --git a/src/context.rs b/src/context.rs index 12eae9707..9287777c9 100644 --- a/src/context.rs +++ b/src/context.rs @@ -545,7 +545,7 @@ impl Context { .and_then(|provider| provider.opt.max_smtp_rcpt_to) .map_or_else( || match is_chatmail { - true => usize::MAX, + true => constants::DEFAULT_CHATMAIL_MAX_SMTP_RCPT_TO, false => constants::DEFAULT_MAX_SMTP_RCPT_TO, }, usize::from,