mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
@@ -639,6 +639,8 @@ async fn simple_imap_loop(
|
|||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const THIRTY_YEARS: u64 = 30 * 365 * 24 * 60 * 60;
|
||||||
|
|
||||||
async fn smtp_loop(
|
async fn smtp_loop(
|
||||||
ctx: Context,
|
ctx: Context,
|
||||||
started: oneshot::Sender<()>,
|
started: oneshot::Sender<()>,
|
||||||
@@ -665,7 +667,14 @@ async fn smtp_loop(
|
|||||||
loop {
|
loop {
|
||||||
if let Err(err) = send_smtp_messages(&ctx, &mut connection).await {
|
if let Err(err) = send_smtp_messages(&ctx, &mut connection).await {
|
||||||
warn!(ctx, "send_smtp_messages failed: {:#}", err);
|
warn!(ctx, "send_smtp_messages failed: {:#}", err);
|
||||||
timeout = Some(timeout.map_or(30, |timeout: u64| timeout.saturating_mul(3)))
|
timeout = Some(timeout.map_or(30, |timeout: u64| {
|
||||||
|
let new_timeout = timeout.saturating_mul(3);
|
||||||
|
if new_timeout >= THIRTY_YEARS {
|
||||||
|
THIRTY_YEARS
|
||||||
|
} else {
|
||||||
|
new_timeout
|
||||||
|
}
|
||||||
|
}))
|
||||||
} else {
|
} else {
|
||||||
let duration_until_can_send = ctx.ratelimit.read().await.until_can_send();
|
let duration_until_can_send = ctx.ratelimit.read().await.until_can_send();
|
||||||
if !duration_until_can_send.is_zero() {
|
if !duration_until_can_send.is_zero() {
|
||||||
|
|||||||
Reference in New Issue
Block a user