@@ -27,6 +27,7 @@ use crate::smtp::{Smtp, send_smtp_messages};
2727use crate :: sql;
2828use crate :: stats:: maybe_send_stats;
2929use crate :: tools:: { self , duration_to_str, maybe_add_time_based_warnings, time, time_elapsed} ;
30+ use crate :: transport:: ConfiguredLoginParam ;
3031use crate :: { constants, stats} ;
3132
3233pub ( crate ) mod connectivity;
@@ -862,7 +863,11 @@ impl Scheduler {
862863 let mut oboxes = Vec :: new ( ) ;
863864 let mut start_recvs = Vec :: new ( ) ;
864865
865- let ( conn_state, inbox_handlers) = ImapConnectionState :: new ( ctx) . await ?;
866+ let ( transport_id, configured_login_param) = ConfiguredLoginParam :: load ( ctx)
867+ . await ?
868+ . context ( "Not configured" ) ?;
869+ let ( conn_state, inbox_handlers) =
870+ ImapConnectionState :: new ( ctx, transport_id, configured_login_param. clone ( ) ) . await ?;
866871 let ( inbox_start_send, inbox_start_recv) = oneshot:: channel ( ) ;
867872 let handle = {
868873 let ctx = ctx. clone ( ) ;
@@ -876,7 +881,7 @@ impl Scheduler {
876881 start_recvs. push ( inbox_start_recv) ;
877882
878883 if ctx. should_watch_mvbox ( ) . await ? {
879- let ( conn_state, handlers) = ImapConnectionState :: new ( ctx) . await ?;
884+ let ( conn_state, handlers) = ImapConnectionState :: new ( ctx, transport_id , configured_login_param ) . await ?;
880885 let ( start_send, start_recv) = oneshot:: channel ( ) ;
881886 let ctx = ctx. clone ( ) ;
882887 let meaning = FolderMeaning :: Mvbox ;
@@ -1097,12 +1102,17 @@ pub(crate) struct ImapConnectionState {
10971102
10981103impl ImapConnectionState {
10991104 /// Construct a new connection.
1100- async fn new ( context : & Context ) -> Result < ( Self , ImapConnectionHandlers ) > {
1105+ async fn new (
1106+ context : & Context ,
1107+ transport_id : u32 ,
1108+ login_param : ConfiguredLoginParam ,
1109+ ) -> Result < ( Self , ImapConnectionHandlers ) > {
11011110 let stop_token = CancellationToken :: new ( ) ;
11021111 let ( idle_interrupt_sender, idle_interrupt_receiver) = channel:: bounded ( 1 ) ;
11031112
11041113 let handlers = ImapConnectionHandlers {
1105- connection : Imap :: new_configured ( context, idle_interrupt_receiver) . await ?,
1114+ connection : Imap :: new ( context, transport_id, login_param, idle_interrupt_receiver)
1115+ . await ?,
11061116 stop_token : stop_token. clone ( ) ,
11071117 } ;
11081118
0 commit comments