summaryrefslogtreecommitdiff
path: root/crates/common/src/addresses.rs
diff options
context:
space:
mode:
authormdecimus <mauro@stalw.art>2024-09-26 14:49:46 +0200
committermdecimus <mauro@stalw.art>2024-09-26 14:49:46 +0200
commitce8182ae07d3f5d341f0e58d3286e3ee20295c12 (patch)
tree8a6865308f5985eb68a589d64a79bd85e665e7e2 /crates/common/src/addresses.rs
parent24967c1e86ab4333736c5e3d69ea4bb3af7f56f0 (diff)
Core refactoring
Diffstat (limited to 'crates/common/src/addresses.rs')
-rw-r--r--crates/common/src/addresses.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/crates/common/src/addresses.rs b/crates/common/src/addresses.rs
index 0303b7fc..d56385b1 100644
--- a/crates/common/src/addresses.rs
+++ b/crates/common/src/addresses.rs
@@ -14,10 +14,10 @@ use crate::{
expr::{
functions::ResolveVariable, if_block::IfBlock, tokenizer::TokenMap, Variable, V_RECIPIENT,
},
- Core,
+ Server,
};
-impl Core {
+impl Server {
pub async fn email_to_ids(
&self,
directory: &Directory,
@@ -25,6 +25,7 @@ impl Core {
session_id: u64,
) -> trc::Result<Vec<u32>> {
let mut address = self
+ .core
.smtp
.session
.rcpt
@@ -38,6 +39,7 @@ impl Core {
if !result.is_empty() {
return Ok(result);
} else if let Some(catch_all) = self
+ .core
.smtp
.session
.rcpt
@@ -62,6 +64,7 @@ impl Core {
) -> trc::Result<bool> {
// Expand subaddress
let mut address = self
+ .core
.smtp
.session
.rcpt
@@ -73,6 +76,7 @@ impl Core {
if directory.rcpt(address.as_ref()).await? {
return Ok(true);
} else if let Some(catch_all) = self
+ .core
.smtp
.session
.rcpt
@@ -97,7 +101,8 @@ impl Core {
) -> trc::Result<Vec<String>> {
directory
.vrfy(
- self.smtp
+ self.core
+ .smtp
.session
.rcpt
.subaddressing
@@ -116,7 +121,8 @@ impl Core {
) -> trc::Result<Vec<String>> {
directory
.expn(
- self.smtp
+ self.core
+ .smtp
.session
.rcpt
.subaddressing
@@ -170,7 +176,7 @@ impl ResolveVariable for Address<'_> {
impl AddressMapping {
pub async fn to_subaddress<'x, 'y: 'x>(
&'x self,
- core: &Core,
+ core: &Server,
address: &'y str,
session_id: u64,
) -> Cow<'x, str> {
@@ -198,7 +204,7 @@ impl AddressMapping {
pub async fn to_catch_all<'x, 'y: 'x>(
&'x self,
- core: &Core,
+ core: &Server,
address: &'y str,
session_id: u64,
) -> Option<Cow<'x, str>> {