From e08af81f77a80d71715fd6355868abb5005697fb Mon Sep 17 00:00:00 2001 From: Gonne Date: Sun, 30 Mar 2025 09:35:09 +0200 Subject: [PATCH] Disallow apostrophies in mail addresses that we push to HRZ --- packages/alias-to-sieve/src/lib.rs | 18 ++++++++++++++++-- .../alias-to-sieve/testdata/apostrophe.aliases | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 packages/alias-to-sieve/testdata/apostrophe.aliases diff --git a/packages/alias-to-sieve/src/lib.rs b/packages/alias-to-sieve/src/lib.rs index 35ebea2..6622a8a 100644 --- a/packages/alias-to-sieve/src/lib.rs +++ b/packages/alias-to-sieve/src/lib.rs @@ -12,7 +12,7 @@ pub struct AliasFile { pub default_domain: FQDN, } -#[derive(PartialEq, Eq, Clone)] +#[derive(PartialEq, Eq, Clone, Debug)] pub struct OrdEmailAddress(EmailAddress); impl PartialOrd for OrdEmailAddress { @@ -48,6 +48,11 @@ pub fn parse_alias_to_map(alias_files: Vec) -> Result = line .split_at(line.find(char::is_whitespace).unwrap_or(0)) .1 @@ -95,7 +100,7 @@ pub fn parse_alias_to_map(alias_files: Vec) -> Result