use relay's maxsmtprecipients metadata for smtp chunking, to remove another is_chatmail use#8426
Conversation
i fixed the comment. Also tried removing the deletion logic but that makes test_mark_message_as_delivered_only_after_sent_out_fully and test_resend_after_ndn fail, so at least the tests exercise it. In reality, smtp-lost-ok case should be rare and sending twice is deduplicated at receiver sides. Cleartext usage (where receivers may not deduplicate) does not really matter for this edge case. |
| /// <https://github.com/deltachat/deltachat-desktop/issues/5447>. | ||
| pub async fn ice_servers(context: &Context) -> Result<String> { | ||
| if let Some(ref metadata) = *context.metadata.read().await { | ||
| if let Some(metadata) = context.metadata.read().await.values().next() { |
There was a problem hiding this comment.
TODO for the future: this may collect all ICE servers, maybe using multiple TURN servers at once makes the calls more reliable.
link2xt
left a comment
There was a problem hiding this comment.
The whole METADATA and making the limit configurable seems to be an overkill (also because it's an yet another setting relay operators can tweak arbitrarily), but as far as i understand the real reason is that XCHATMAIL cannot be removed from the outer banner just with the Dovecot configuration. Otherwise a better place for this would be SMTP server banner, Exim even supports some standard way to advertise the recipient limit in its banner IIRC.
| // Fallback for the maximum number of recipients in SMTP's `RCPT TO:`; | ||
| // recipient lists exceeding the limit are sent in chunks. | ||
| // Relays advertise their limit via IMAP METADATA | ||
| // and in very rare cases the provider db sets `max_smtp_rcpt_to`. |
There was a problem hiding this comment.
There will be no provider database with #8437, in practice the only provider is nauta.cu setting this to 20. I'd simply remove the last line of the comment, it's enough to know that this is the default and relays can overwrite it.
Remove is_chatmail flag, and rely on IMAP metadata advertising the recipients limit (usually 1000), falling back to 50 (or fewer in some exceptional cases) just as before when is_chatmail was false. Also, server metadata is now keyed per transport, which in the future eases collecting ICE servers from all relays (instead of just any first relay).
a7a168d to
be4470c
Compare
Making metadata per-transport has at least the win that we can collect all ICE servers later (as you noted), and is also conceptually the right thing to do. |
Relays since chatmail/relay#960 and released mid may with relay-1.11 set maxsmtprcipients imap metadata to 1000. I manually verified that nine.testrun.org, mailchat.pl and a few others have it set already.
this PR also moves recipient chunking to smtp loop where it belongs because it's transport specific.