XOAUTH2 support (closes #1194 closes #1369)

This commit is contained in:
mdecimus
2025-05-16 17:17:13 +02:00
parent f667da0d4f
commit dcdf68b774
9 changed files with 18 additions and 59 deletions

View File

@@ -27,7 +27,7 @@ impl<T: SessionStream> Session<T> {
mut params: Vec<String>,
) -> trc::Result<()> {
match mechanism {
Mechanism::Plain | Mechanism::OAuthBearer => {
Mechanism::Plain | Mechanism::OAuthBearer | Mechanism::XOauth2 => {
if !params.is_empty() {
let credentials = base64_decode(params.pop().unwrap().as_bytes())
.and_then(|challenge| {

View File

@@ -19,9 +19,9 @@ pub mod list;
impl<T: SessionStream> Session<T> {
pub async fn handle_capa(&mut self) -> trc::Result<()> {
let mechanisms = if self.stream.is_tls() || self.server.core.imap.allow_plain_auth {
vec![Mechanism::Plain, Mechanism::OAuthBearer]
vec![Mechanism::Plain, Mechanism::OAuthBearer, Mechanism::XOauth2]
} else {
vec![Mechanism::OAuthBearer]
vec![Mechanism::OAuthBearer, Mechanism::XOauth2]
};
trc::event!(