@@ -155,6 +155,7 @@ fn reconnect_control(client: &mut ImapClient, ctx: &ControlCtx) -> Result<(), Im
|
||||
&ctx.endpoint.host,
|
||||
ctx.endpoint.port,
|
||||
ctx.mode,
|
||||
ctx.logger,
|
||||
)?;
|
||||
*client = new_client;
|
||||
authenticate_client(client, &ctx.auth).map_err(|e| ImapError::AuthFailed(e.to_string()))?;
|
||||
@@ -224,7 +225,7 @@ pub fn run(common: CommonConfig, config: ImapImportConfig) -> Result<Summary, Er
|
||||
} else {
|
||||
ConnectMode::StartTls
|
||||
};
|
||||
let mut client = ImapClient::connect(&connector, &endpoint.host, endpoint.port, mode)
|
||||
let mut client = ImapClient::connect(&connector, &endpoint.host, endpoint.port, mode, logger)
|
||||
.map_err(|e| Error::Connection(e.to_string()))?;
|
||||
|
||||
let account_id = authenticate(&mut client, &config.auth)?;
|
||||
@@ -389,6 +390,7 @@ pub fn run(common: CommonConfig, config: ImapImportConfig) -> Result<Summary, Er
|
||||
compress: config.compress,
|
||||
policy,
|
||||
backoff: backoff.clone(),
|
||||
logger,
|
||||
},
|
||||
config.imap_connections.max(1),
|
||||
)
|
||||
|
||||
@@ -17,6 +17,7 @@ use crate::imap::name::encode_mailbox_name_with;
|
||||
use crate::imap::response::Untagged;
|
||||
use crate::imap::retry::{BackoffState, Disposition, RetryPolicy, classify};
|
||||
use crate::imap::transport::Connector;
|
||||
use crate::logging::Logger;
|
||||
|
||||
use super::coordinator::{Endpoint, ImapAuth, authenticate_client};
|
||||
use super::fetch::FetchAttrs;
|
||||
@@ -51,6 +52,7 @@ pub struct WorkerArgs {
|
||||
pub compress: bool,
|
||||
pub policy: RetryPolicy,
|
||||
pub backoff: BackoffState,
|
||||
pub logger: Logger,
|
||||
}
|
||||
|
||||
pub struct WorkerPool {
|
||||
@@ -208,6 +210,7 @@ fn connect_and_auth(args: &WorkerArgs) -> Result<ImapClient, ImapError> {
|
||||
&args.endpoint.host,
|
||||
args.endpoint.port,
|
||||
args.mode,
|
||||
args.logger,
|
||||
)?;
|
||||
authenticate_client(&mut client, &args.auth)
|
||||
.map_err(|e| ImapError::AuthFailed(e.to_string()))?;
|
||||
|
||||
@@ -65,6 +65,7 @@ fn reconnect(client: &mut SieveClient, ctx: &ControlCtx) -> Result<(), SieveErro
|
||||
ctx.port,
|
||||
ctx.mode,
|
||||
ctx.allow_cleartext,
|
||||
ctx.logger,
|
||||
)?;
|
||||
*client = new;
|
||||
match do_authenticate(client, &ctx.auth) {
|
||||
@@ -128,6 +129,7 @@ pub fn run(common: CommonConfig, config: ManageSieveImportConfig) -> Result<Summ
|
||||
endpoint.port,
|
||||
mode,
|
||||
config.allow_cleartext,
|
||||
logger,
|
||||
)
|
||||
.map_err(|e| Error::Connection(e.to_string()))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user