From 53ae50fb2bd2a30e1d1d5fda67fda4b456271dc1 Mon Sep 17 00:00:00 2001 From: "Philip (a-0)" <@ph:a-0.me> Date: Fri, 2 Sep 2022 14:50:18 +0200 Subject: [PATCH] Renamed 'whitelist' to 'allowlist' --- README.md | 2 +- advanced_sample_config.yaml | 4 ++-- src/config.rs | 2 +- src/main.rs | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c0acccb..fedd2fd 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Just invite the bot accounts to the rooms they should post in, and enter the roo **Hint:** Encryption works flawlessly when the bot account has logged in once before, there can be minor issues otherwise. You can just do a dry run of matrixmailer with the clients already specified in the configuration file to do that. ## How it works -matrixmailer spins up a minimalistic SMTP server which receives any email (except you use the whitelisting feature, see sample configs), +matrixmailer spins up a minimalistic SMTP server which receives any email (except you use the allowlisting feature, see sample configs), ## Contributing Feel free to join #matrixmailer:a-0.me to ask questions and discuss, or even to just leave feedback! diff --git a/advanced_sample_config.yaml b/advanced_sample_config.yaml index 8546387..99a90c9 100644 --- a/advanced_sample_config.yaml +++ b/advanced_sample_config.yaml @@ -1,6 +1,6 @@ # This config file will make matrixmailer # - Bind the SMTP server on 1.2.3.4:2525 -# - Reject receiving mail that is not sent to one of the email addresses in the whitelist +# - Reject receiving mail that is not sent to one of the email addresses in the allowlist # - Forward all received mails # - that were sent to warning@mydomain.com to the "warning" room using "@secondbot:example.com" # - that were sent to critical@mydomain.com to the "important" room using "@firstbot:example.com" @@ -9,7 +9,7 @@ --- bind_address: "1.2.3.4" bind_port: "2525" -receiver_whitelist: +receiver_allowlist: - "warning@mydomain.com" - "critical@mydomain.com" clients: diff --git a/src/config.rs b/src/config.rs index 329a276..80d9778 100644 --- a/src/config.rs +++ b/src/config.rs @@ -6,7 +6,7 @@ pub struct Config { pub bind_address: Option, pub bind_port: Option, pub client_storage_path: Option, - pub receiver_whitelist: Option>, + pub receiver_allowlist: Option>, pub clients: Vec, pub mappings: Vec, } diff --git a/src/main.rs b/src/main.rs index 3992deb..cd08573 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,7 @@ async fn main() { let service = SmtpService::create(format!("{}:{}", config.bind_address.unwrap(), config.bind_port.unwrap()).parse().unwrap(), "matrixmailer".into(), Arc::new(ToMatrixConverter { - receiver_whitelist: config.receiver_whitelist, + receiver_allowlist: config.receiver_allowlist, matrix_clients: clients, mappings: config.mappings, })); @@ -32,7 +32,7 @@ struct ToMatrixConverter { // If None, any incoming mail will be accepted. // If Some(x), any mail with a mail address in x in its recipients will be accepted. // "Not accepted" means the sender will get a "RCPT failed" reply - receiver_whitelist: Option>, + receiver_allowlist: Option>, matrix_clients: Vec, mappings: Vec, } @@ -41,7 +41,7 @@ struct ToMatrixConverter { impl Handler for ToMatrixConverter { // Checks whether receipient is local (and the mail should thus be handled by this service) async fn recipient_local(&self, recipient: &Mailbox) -> bool { - match &self.receiver_whitelist { + match &self.receiver_allowlist { None => true, Some(list) => { let addr = format!("{}@{}", recipient.local, recipient.domain.0);