Internal directory implementation + Management REST API
This commit is contained in:
@@ -62,7 +62,7 @@ async fn auth() {
|
||||
let mut ctx = ConfigContext::new(&[]);
|
||||
ctx.directory = Config::new(DIRECTORY)
|
||||
.unwrap()
|
||||
.parse_directory(&Stores::default())
|
||||
.parse_directory(&Stores::default(), None)
|
||||
.unwrap();
|
||||
|
||||
let config = &mut core.session.config.auth;
|
||||
|
||||
@@ -80,7 +80,7 @@ async fn data() {
|
||||
let mut qr = core.init_test_queue("smtp_data_test");
|
||||
let directory = Config::new(DIRECTORY)
|
||||
.unwrap()
|
||||
.parse_directory(&Stores::default())
|
||||
.parse_directory(&Stores::default(), None)
|
||||
.unwrap();
|
||||
let config = &mut core.session.config.rcpt;
|
||||
config.directory = IfBlock::new(Some(MaybeDynValue::Static(
|
||||
|
||||
@@ -135,7 +135,7 @@ async fn dmarc() {
|
||||
let mut rr = core.init_test_report();
|
||||
let directory = Config::new(DIRECTORY)
|
||||
.unwrap()
|
||||
.parse_directory(&Stores::default())
|
||||
.parse_directory(&Stores::default(), None)
|
||||
.unwrap();
|
||||
let config = &mut core.session.config.rcpt;
|
||||
config.directory = IfBlock::new(Some(MaybeDynValue::Static(
|
||||
|
||||
@@ -74,7 +74,7 @@ async fn rcpt() {
|
||||
let config_ext = &mut core.session.config.extensions;
|
||||
let directory = Config::new(DIRECTORY)
|
||||
.unwrap()
|
||||
.parse_directory(&Stores::default())
|
||||
.parse_directory(&Stores::default(), None)
|
||||
.unwrap();
|
||||
let config = &mut core.session.config.rcpt;
|
||||
config.directory = IfBlock::new(Some(MaybeDynValue::Static(
|
||||
|
||||
@@ -104,7 +104,7 @@ async fn address_rewrite() {
|
||||
let mut core = SMTP::test();
|
||||
let mut ctx = ConfigContext::new(&[]).parse_signatures();
|
||||
let settings = Config::new(CONFIG).unwrap();
|
||||
ctx.directory = settings.parse_directory(&Stores::default()).unwrap();
|
||||
ctx.directory = settings.parse_directory(&Stores::default(), None).unwrap();
|
||||
core.sieve = settings.parse_sieve(&mut ctx).unwrap();
|
||||
let config = &mut core.session.config;
|
||||
config.mail.script = settings
|
||||
|
||||
@@ -135,7 +135,7 @@ async fn sieve_scripts() {
|
||||
)
|
||||
.unwrap();
|
||||
ctx.stores = config.parse_stores().await.unwrap();
|
||||
ctx.directory = config.parse_directory(&ctx.stores).unwrap();
|
||||
ctx.directory = config.parse_directory(&ctx.stores, None).unwrap();
|
||||
let pipes = config.parse_pipes(&ctx, &[EnvelopeKey::RemoteIp]).unwrap();
|
||||
core.sieve = config.parse_sieve(&mut ctx).unwrap();
|
||||
let config = &mut core.session.config;
|
||||
|
||||
@@ -154,7 +154,7 @@ async fn sign_and_seal() {
|
||||
|
||||
let directory = Config::new(DIRECTORY)
|
||||
.unwrap()
|
||||
.parse_directory(&Stores::default())
|
||||
.parse_directory(&Stores::default(), None)
|
||||
.unwrap();
|
||||
let config = &mut core.session.config.rcpt;
|
||||
config.directory = IfBlock::new(Some(MaybeDynValue::Static(
|
||||
|
||||
@@ -68,7 +68,7 @@ async fn vrfy_expn() {
|
||||
|
||||
let directory = Config::new(DIRECTORY)
|
||||
.unwrap()
|
||||
.parse_directory(&Stores::default())
|
||||
.parse_directory(&Stores::default(), None)
|
||||
.unwrap();
|
||||
let config = &mut core.session.config.rcpt;
|
||||
config.directory = IfBlock::new(Some(MaybeDynValue::Static(
|
||||
|
||||
@@ -87,7 +87,7 @@ async fn lookup_sql() {
|
||||
let mut ctx = ConfigContext::new(&[]);
|
||||
let config = Config::new(&config_file).unwrap();
|
||||
ctx.stores = config.parse_stores().await.unwrap();
|
||||
ctx.directory = config.parse_directory(&ctx.stores).unwrap();
|
||||
ctx.directory = config.parse_directory(&ctx.stores, None).unwrap();
|
||||
|
||||
// Obtain directory handle
|
||||
let handle = DirectoryStore {
|
||||
|
||||
@@ -98,7 +98,7 @@ async fn manage_queue() {
|
||||
// Start local management interface
|
||||
let directory = Config::new(DIRECTORY)
|
||||
.unwrap()
|
||||
.parse_directory(&Stores::default())
|
||||
.parse_directory(&Stores::default(), None)
|
||||
.unwrap();
|
||||
core.queue.config.management_lookup = directory.directories.get("local").unwrap().clone();
|
||||
core.session.config.rcpt.relay = IfBlock::new(true);
|
||||
|
||||
@@ -85,7 +85,7 @@ async fn manage_reports() {
|
||||
config.tls.max_size = IfBlock::new(1024);
|
||||
let directory = Config::new(DIRECTORY)
|
||||
.unwrap()
|
||||
.parse_directory(&Stores::default())
|
||||
.parse_directory(&Stores::default(), None)
|
||||
.unwrap();
|
||||
core.queue.config.management_lookup = directory.directories.get("local").unwrap().clone();
|
||||
let (report_tx, report_rx) = mpsc::channel(1024);
|
||||
|
||||
Reference in New Issue
Block a user