From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 843661FF13F for ; Thu, 09 Apr 2026 11:51:01 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C531B1D15B; Thu, 9 Apr 2026 11:51:44 +0200 (CEST) Content-Type: text/plain; charset=UTF-8 Date: Thu, 09 Apr 2026 11:51:39 +0200 Message-Id: Subject: Re: [PATCH proxmox v2 01/16] notify: smtp: Introduce xoauth2 module From: "Lukas Wagner" To: "Arthur Bied-Charreton" , Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20260325131444.366808-1-a.bied-charreton@proxmox.com> <20260325131444.366808-2-a.bied-charreton@proxmox.com> In-Reply-To: <20260325131444.366808-2-a.bied-charreton@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1775728231665 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.053 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [xoauth2.rs,smtp.rs] Message-ID-Hash: FS7HE5EGEFPYQ36QMEWOJ572FMPM7H4Y X-Message-ID-Hash: FS7HE5EGEFPYQ36QMEWOJ572FMPM7H4Y X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed Mar 25, 2026 at 2:14 PM CET, Arthur Bied-Charreton wrote: > Prepare proxmox-notify to use the oauth2 crate for SMTP XOAUTH2 support. > > The xoauth2 module handles some of the implementation details related to > supporting XOAUTH2 for SMTP notification targets. > > Add get_{google,microsoft}_token functions handling provider-specific > implementation details, and a ureq::Agent newtype wrapper implementing > the SyncHttpClient trait to allow using ureq as oauth2 backend, since > OAuth2 dropped the ureq feature. Debian seems to have patched it out > due to a ureq 2/3 version mismatch [1]. > > Signed-off-by: Arthur Bied-Charreton > --- > proxmox-notify/Cargo.toml | 5 +- > proxmox-notify/debian/control | 27 +-- > proxmox-notify/src/endpoints/smtp.rs | 2 + > proxmox-notify/src/endpoints/smtp/xoauth2.rs | 167 +++++++++++++++++++ > 4 files changed, 190 insertions(+), 11 deletions(-) > create mode 100644 proxmox-notify/src/endpoints/smtp/xoauth2.rs > > diff --git a/proxmox-notify/Cargo.toml b/proxmox-notify/Cargo.toml > index bc63e19d..421bb6c3 100644 > --- a/proxmox-notify/Cargo.toml > +++ b/proxmox-notify/Cargo.toml > @@ -19,6 +19,9 @@ http =3D { workspace =3D true, optional =3D true } > lettre =3D { workspace =3D true, optional =3D true } > tracing.workspace =3D true > mail-parser =3D { workspace =3D true, optional =3D true } > +oauth2 =3D { version =3D "5.0.0", default-features =3D false, optional = =3D true } > +ureq =3D { version =3D "3.0.11", features =3D ["platform-verifier"], opt= ional =3D true } Could you make these workspace deps? We also use ureq in proxmox-acme IIRC, so you should probably then also add a separate commit that switches that one over to use the version defined in the workspace as well. With this fixed in the next version: Reviewed-by: Lukas Wagner