From 5ac1425b44a3452a669592c6172308b3efb644ac Mon Sep 17 00:00:00 2001 From: "Philip (a-0)" <@ph:a-0.me> Date: Fri, 2 Sep 2022 14:54:57 +0200 Subject: [PATCH] Removed term 'whitelist' --- 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..0facf89 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 receiver_allowlist 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..21b42b3 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 allowed receiving email addresses in the # - 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: +allowed_receivers: - "warning@mydomain.com" - "critical@mydomain.com" clients: diff --git a/src/config.rs b/src/config.rs index 329a276..f0ab73b 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 allowed_receivers: Option>, pub clients: Vec, pub mappings: Vec, } diff --git a/src/main.rs b/src/main.rs index 3992deb..1e2c2f6 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, + allowed_receivers: config.allowed_receivers, 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>, + allowed_receivers: 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.allowed_receivers { None => true, Some(list) => { let addr = format!("{}@{}", recipient.local, recipient.domain.0);