From 12bc877b860f7763fe597af0ecbb0033f3dde1bb Mon Sep 17 00:00:00 2001 From: DorianCoding <108593662+DorianCoding@users.noreply.github.com> Date: Fri, 21 Feb 2025 22:23:18 +0100 Subject: [PATCH] Update src/mail.rs --- src/mail.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mail.rs b/src/mail.rs index 51ef9f73..76af5460 100644 --- a/src/mail.rs +++ b/src/mail.rs @@ -650,7 +650,10 @@ async fn send_email(address: &str, subject: &str, body_html: String, body_text: Some(true) => DkimSigningAlgorithm::Rsa, _ => DkimSigningAlgorithm::Ed25519, }; - let mut key = String::with_capacity(4096); + let (algo, mut key) = match CONFIG.dkim_algo() { + Some(true) => (DkimSigningAlgorithm::Rsa,String::with_capacity(4096)), + _ => (DkimSigningAlgorithm::Ed25519,String::with_capacity(64)), + }; let sig = match std::fs::File::open(sig) { Ok(mut f) => { if let Err(e) = f.read_to_string(&mut key) {