Index: README.md ================================================================== --- README.md +++ README.md @@ -31,10 +31,12 @@ [recipients] "admin@example.com" = 12345678 "alerts@example.com" = -10012345678 ``` + +All recipients are internally lowercased, so `UserName` equals `username`. --- ## Usage Index: src/mail.rs ================================================================== --- src/mail.rs +++ src/mail.rs @@ -78,11 +78,11 @@ for (name, value) in settings.get_table("recipients") .context("[smtp2tg.toml] missing table \"recipients\".\n")? { let value = value.into_int() .context("[smtp2tg.toml] \"recipient\" table values should be integers.\n")?; - recipients.insert(name.to_lowercase().replace('.', ""), value); + recipients.insert(name.to_lowercase(), value); } let tg = Arc::new(TelegramTransport::new(api_key, recipients, &settings)?); let fields = HashSet::::from_iter(settings.get_array("fields") .context("[smtp2tg.toml] \"fields\" should be an array")? Index: src/telegram.rs ================================================================== --- src/telegram.rs +++ src/telegram.rs @@ -93,11 +93,11 @@ /// * `Result<&ChatPeerId>` - Chat ID if found. /// /// # Errors /// Returns an error if `name` is not configured. pub fn get (&self, name: &str) -> Result<&ChatPeerId> { - self.recipients.get(&name.to_lowercase().replace('.', "")) + self.recipients.get(&name.to_lowercase()) .with_context(|| format!("Recipient \"{name}\" not found in configuration")) } /// Sends a text message to a specified chat. ///