mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
fix: treat ID command as best-effort and ignore failures
This commit is contained in:
@@ -30,7 +30,7 @@ use crate::modules::imap::session::SessionStream;
|
|||||||
use crate::modules::oauth2::token::OAuth2AccessToken;
|
use crate::modules::oauth2::token::OAuth2AccessToken;
|
||||||
use crate::{bichon_version, decrypt, raise_error};
|
use crate::{bichon_version, decrypt, raise_error};
|
||||||
use async_imap::Session;
|
use async_imap::Session;
|
||||||
use tracing::error;
|
use tracing::{error, warn};
|
||||||
|
|
||||||
pub struct ImapConnectionManager;
|
pub struct ImapConnectionManager;
|
||||||
|
|
||||||
@@ -142,16 +142,16 @@ impl ImapConnectionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if capabilities.has_str("ID") || capabilities.has_str("id") {
|
if capabilities.has_str("ID") || capabilities.has_str("id") {
|
||||||
session
|
if let Err(e) = session
|
||||||
.id([
|
.id([
|
||||||
("name", Some("bichon")),
|
("name", Some("bichon")),
|
||||||
("version", Some(bichon_version!())),
|
("version", Some(bichon_version!())),
|
||||||
("vendor", Some("rustmailer")),
|
("vendor", Some("rustmailer")),
|
||||||
])
|
])
|
||||||
.await
|
.await
|
||||||
.map_err(|e| {
|
{
|
||||||
raise_error!(format!("{:#?}", e), ErrorCode::ImapCommandFailed)
|
warn!("IMAP ID command failed (ignored): {:#?}", e);
|
||||||
})?;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user