Do not panic when report hash = 0 (#60)

This commit is contained in:
mdecimus 2023-08-26 13:13:37 +02:00
parent 426c073b25
commit 79599f2f9c

View file

@ -205,16 +205,15 @@ impl SMTP {
.eval(&RecipientDomain::new(domain)) .eval(&RecipientDomain::new(domain))
.await .await
.clone(); .clone();
path.push( let hash = *self
(policy .report
% *self .config
.report .hash
.config .eval(&RecipientDomain::new(domain))
.hash .await;
.eval(&RecipientDomain::new(domain)) if hash > 0 {
.await) path.push((policy % hash).to_string());
.to_string(), }
);
let _ = fs::create_dir(&path).await; let _ = fs::create_dir(&path).await;
// Build filename // Build filename