diff --git a/deltachat-ffi/Cargo.toml b/deltachat-ffi/Cargo.toml index f6aac51be..c4e0d8580 100644 --- a/deltachat-ffi/Cargo.toml +++ b/deltachat-ffi/Cargo.toml @@ -24,3 +24,4 @@ default = ["vendored", "nightly", "ringbuf"] vendored = ["deltachat/vendored"] nightly = ["deltachat/nightly"] ringbuf = ["deltachat/ringbuf"] + diff --git a/src/dc_configure.rs b/src/dc_configure.rs index 455a81734..33f8e17af 100644 --- a/src/dc_configure.rs +++ b/src/dc_configure.rs @@ -1039,7 +1039,14 @@ pub unsafe fn dc_job_do_DC_JOB_CONFIGURE_IMAP(context: &Context, _job: *mut dc_j } } } + if imap_connected_here { + context.inbox.read().unwrap().disconnect(context); + } + if smtp_connected_here { + context.smtp.clone().lock().unwrap().disconnect(); + } + /* if !success { // disconnect if configure did not succeed if imap_connected_here { @@ -1055,6 +1062,7 @@ pub unsafe fn dc_job_do_DC_JOB_CONFIGURE_IMAP(context: &Context, _job: *mut dc_j 0, "Keeping IMAP/SMTP connections open after successful configuration" ); } + */ if ongoing_allocated_here { dc_free_ongoing(context); } diff --git a/src/imap.rs b/src/imap.rs index 0dc30e99c..bdd2cd39e 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -719,6 +719,9 @@ impl Imap { } let entry = as_str(val1); + if entry.is_empty() { + return (0, 0); + } // the entry has the format `imap.mailbox.=:` let mut parts = entry.split(':'); ( diff --git a/src/sql.rs b/src/sql.rs index da37d53a3..6de9786f8 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -110,7 +110,6 @@ impl Sql { G: FnMut(rusqlite::MappedRows) -> Result, { self.with_conn(|conn| { - eprintln!("query_map {}", sql.as_ref()); let mut stmt = conn.prepare(sql.as_ref())?; let res = stmt.query_map(params, f)?; g(res) @@ -1126,7 +1125,6 @@ mod test { maybe_add_file(&mut files, "$BLOBDIR/world.txt"); maybe_add_file(&mut files, "world2.txt"); - println!("{:?}", files); assert!(unsafe { is_file_in_use( &mut files,