mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
feat: improve SMTP logging
This commit is contained in:
@@ -552,7 +552,7 @@ pub(crate) async fn send_msg_to_smtp(
|
||||
}
|
||||
info!(
|
||||
context,
|
||||
"Try number {} to send message {} over SMTP", retries, msg_id
|
||||
"Try number {retries} to send message {msg_id} (entry {rowid}) over SMTP"
|
||||
);
|
||||
|
||||
let recipients_list = recipients
|
||||
@@ -576,7 +576,7 @@ pub(crate) async fn send_msg_to_smtp(
|
||||
{
|
||||
info!(
|
||||
context,
|
||||
"Sending of message {} was cancelled by the user.", msg_id
|
||||
"Sending of message {msg_id} (entry {rowid}) was cancelled by the user."
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
@@ -649,6 +649,8 @@ pub(crate) async fn send_smtp_messages(context: &Context, connection: &mut Smtp)
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
|
||||
info!(context, "Selected rows from SMTP queue: {rowids:?}.");
|
||||
for rowid in rowids {
|
||||
send_msg_to_smtp(context, connection, rowid)
|
||||
.await
|
||||
|
||||
@@ -64,9 +64,11 @@ impl Smtp {
|
||||
if let Some(ref mut transport) = self.transport {
|
||||
transport.send(mail).await.map_err(Error::SmtpSend)?;
|
||||
|
||||
context.emit_event(EventType::SmtpMessageSent(format!(
|
||||
"Message len={message_len_bytes} was smtp-sent to {recipients_display}"
|
||||
)));
|
||||
let info_msg = format!(
|
||||
"Message len={message_len_bytes} was SMTP-sent to {recipients_display}"
|
||||
);
|
||||
info!(context, "{info_msg}.");
|
||||
context.emit_event(EventType::SmtpMessageSent(info_msg));
|
||||
self.last_success = Some(std::time::SystemTime::now());
|
||||
} else {
|
||||
warn!(
|
||||
|
||||
Reference in New Issue
Block a user