mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 21:06:31 +03:00
Merge pull request #1465 from deltachat/smtp-network-error
Better SMTP ErrorNetwork message
This commit is contained in:
@@ -269,7 +269,7 @@ impl Imap {
|
|||||||
let imap_port = config.imap_port;
|
let imap_port = config.imap_port;
|
||||||
context.stock_string_repl_str2(
|
context.stock_string_repl_str2(
|
||||||
StockMessage::ServerResponse,
|
StockMessage::ServerResponse,
|
||||||
format!("{}:{}", imap_server, imap_port),
|
format!("IMAP {}:{}", imap_server, imap_port),
|
||||||
err.to_string(),
|
err.to_string(),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ use crate::context::Context;
|
|||||||
use crate::events::Event;
|
use crate::events::Event;
|
||||||
use crate::login_param::{dc_build_tls, LoginParam};
|
use crate::login_param::{dc_build_tls, LoginParam};
|
||||||
use crate::oauth2::*;
|
use crate::oauth2::*;
|
||||||
|
use crate::stock::StockMessage;
|
||||||
|
|
||||||
/// SMTP write and read timeout in seconds.
|
/// SMTP write and read timeout in seconds.
|
||||||
const SMTP_TIMEOUT: u64 = 30;
|
const SMTP_TIMEOUT: u64 = 30;
|
||||||
@@ -171,7 +172,14 @@ impl Smtp {
|
|||||||
let mut trans = client.into_transport();
|
let mut trans = client.into_transport();
|
||||||
|
|
||||||
trans.connect().await.map_err(|err| {
|
trans.connect().await.map_err(|err| {
|
||||||
emit_event!(context, Event::ErrorNetwork(err.to_string()));
|
let message = {
|
||||||
|
context.stock_string_repl_str2(
|
||||||
|
StockMessage::ServerResponse,
|
||||||
|
format!("SMTP {}:{}", domain, port),
|
||||||
|
err.to_string(),
|
||||||
|
)
|
||||||
|
};
|
||||||
|
emit_event!(context, Event::ErrorNetwork(message));
|
||||||
Error::ConnectionFailure(err)
|
Error::ConnectionFailure(err)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user