Import upstream v0.16.24, stripped

Upstream commit: af37a234981722493b74623a983581691d2b70b6
Enterprise-only files removed or emptied: 63
Enterprise-only snippets removed: 118 in 50 files
Dangling module declarations removed: 5
Edits turning enterprise off: 25
Third-party code: 14 files, 0 not in THIRD-PARTY.md
Renamed identifiers: 62 in 18 files
Verification: clean

The same Enterprise footprint as v0.16.23. The build check fails only on
tests/src/directory/issuer.rs, unchanged since v0.16.23: it calls a helper
from upstream's Enterprise-only OIDC test, and tests issuer-based directory
routing, an Enterprise feature. main has never carried it.
This commit is contained in:
2026-09-28 06:29:38 -07:00
parent 3a272096c0
commit f59b084ce5
98 changed files with 2851 additions and 1068 deletions
+2
View File
@@ -618,6 +618,7 @@ pub enum DnsServerBootstrapType {
Vultr = 68,
WebSupport = 69,
YandexCloud = 70,
PowerDns = 71,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
@@ -694,6 +695,7 @@ pub enum DnsServerType {
Vultr = 67,
WebSupport = 68,
YandexCloud = 69,
PowerDns = 70,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
+12 -6
View File
@@ -3021,6 +3021,7 @@ impl EnumImpl for DnsServerBootstrapType {
b"Vultr" => DnsServerBootstrapType::Vultr,
b"WebSupport" => DnsServerBootstrapType::WebSupport,
b"YandexCloud" => DnsServerBootstrapType::YandexCloud,
b"PowerDns" => DnsServerBootstrapType::PowerDns,
}
.copied()
}
@@ -3098,6 +3099,7 @@ impl EnumImpl for DnsServerBootstrapType {
DnsServerBootstrapType::Vultr => "Vultr",
DnsServerBootstrapType::WebSupport => "WebSupport",
DnsServerBootstrapType::YandexCloud => "YandexCloud",
DnsServerBootstrapType::PowerDns => "PowerDns",
}
}
@@ -3178,11 +3180,12 @@ impl EnumImpl for DnsServerBootstrapType {
68 => Some(DnsServerBootstrapType::Vultr),
69 => Some(DnsServerBootstrapType::WebSupport),
70 => Some(DnsServerBootstrapType::YandexCloud),
71 => Some(DnsServerBootstrapType::PowerDns),
_ => None,
}
}
const COUNT: usize = 71;
const COUNT: usize = 72;
}
impl serde::Serialize for DnsServerBootstrapType {
@@ -3279,6 +3282,7 @@ impl EnumImpl for DnsServerType {
b"Vultr" => DnsServerType::Vultr,
b"WebSupport" => DnsServerType::WebSupport,
b"YandexCloud" => DnsServerType::YandexCloud,
b"PowerDns" => DnsServerType::PowerDns,
}
.copied()
}
@@ -3355,6 +3359,7 @@ impl EnumImpl for DnsServerType {
DnsServerType::Vultr => "Vultr",
DnsServerType::WebSupport => "WebSupport",
DnsServerType::YandexCloud => "YandexCloud",
DnsServerType::PowerDns => "PowerDns",
}
}
@@ -3434,11 +3439,12 @@ impl EnumImpl for DnsServerType {
67 => Some(DnsServerType::Vultr),
68 => Some(DnsServerType::WebSupport),
69 => Some(DnsServerType::YandexCloud),
70 => Some(DnsServerType::PowerDns),
_ => None,
}
}
const COUNT: usize = 70;
const COUNT: usize = 71;
}
impl serde::Serialize for DnsServerType {
@@ -10372,8 +10378,8 @@ impl EnumImpl for SieveCapability {
b"spamtest" => SieveCapability::Spamtest,
b"spamtestplus" => SieveCapability::Spamtestplus,
b"virustest" => SieveCapability::Virustest,
b"vnd.stalwart.while" => SieveCapability::VndStalwartWhile,
b"vnd.stalwart.expressions" => SieveCapability::VndStalwartExpressions,
b"vnd.inbuxa.while" => SieveCapability::VndStalwartWhile,
b"vnd.inbuxa.expressions" => SieveCapability::VndStalwartExpressions,
}
}
@@ -10426,8 +10432,8 @@ impl EnumImpl for SieveCapability {
SieveCapability::Spamtest => "spamtest",
SieveCapability::Spamtestplus => "spamtestplus",
SieveCapability::Virustest => "virustest",
SieveCapability::VndStalwartWhile => "vnd.stalwart.while",
SieveCapability::VndStalwartExpressions => "vnd.stalwart.expressions",
SieveCapability::VndStalwartWhile => "vnd.inbuxa.while",
SieveCapability::VndStalwartExpressions => "vnd.inbuxa.expressions",
}
}
+1
View File
@@ -1042,6 +1042,7 @@ pub enum Property {
SentinelUsername = 914,
Separator = 97,
ServerHostname = 121,
ServerId = 934,
Servers = 308,
ServiceAccountJson = 316,
ServiceName = 913,
@@ -1195,6 +1195,7 @@ impl EnumImpl for Property {
b"sentinelUsername" => Property::SentinelUsername,
b"separator" => Property::Separator,
b"serverHostname" => Property::ServerHostname,
b"serverId" => Property::ServerId,
b"servers" => Property::Servers,
b"serviceAccountJson" => Property::ServiceAccountJson,
b"serviceName" => Property::ServiceName,
@@ -2134,6 +2135,7 @@ impl EnumImpl for Property {
Property::SentinelUsername => "sentinelUsername",
Property::Separator => "separator",
Property::ServerHostname => "serverHostname",
Property::ServerId => "serverId",
Property::Servers => "servers",
Property::ServiceAccountJson => "serviceAccountJson",
Property::ServiceName => "serviceName",
@@ -3077,6 +3079,7 @@ impl EnumImpl for Property {
914 => Some(Property::SentinelUsername),
97 => Some(Property::Separator),
121 => Some(Property::ServerHostname),
934 => Some(Property::ServerId),
308 => Some(Property::Servers),
316 => Some(Property::ServiceAccountJson),
913 => Some(Property::ServiceName),
@@ -3227,7 +3230,7 @@ impl EnumImpl for Property {
}
}
const COUNT: usize = 934;
const COUNT: usize = 935;
}
impl serde::Serialize for Property {
@@ -4493,6 +4496,7 @@ impl ObjectInner {
ObjectInner::DnsServer(DnsServer::Vultr(obj)) => obj.member_tenant_id,
ObjectInner::DnsServer(DnsServer::WebSupport(obj)) => obj.member_tenant_id,
ObjectInner::DnsServer(DnsServer::YandexCloud(obj)) => obj.member_tenant_id,
ObjectInner::DnsServer(DnsServer::PowerDns(obj)) => obj.member_tenant_id,
ObjectInner::Domain(obj) => obj.member_tenant_id,
ObjectInner::MailingList(obj) => obj.member_tenant_id,
ObjectInner::OAuthClient(obj) => obj.member_tenant_id,
@@ -4595,6 +4599,7 @@ impl ObjectInner {
ObjectInner::DnsServer(DnsServer::Vultr(obj)) => obj.member_tenant_id = Some(id),
ObjectInner::DnsServer(DnsServer::WebSupport(obj)) => obj.member_tenant_id = Some(id),
ObjectInner::DnsServer(DnsServer::YandexCloud(obj)) => obj.member_tenant_id = Some(id),
ObjectInner::DnsServer(DnsServer::PowerDns(obj)) => obj.member_tenant_id = Some(id),
ObjectInner::Domain(obj) => obj.member_tenant_id = Some(id),
ObjectInner::MailingList(obj) => obj.member_tenant_id = Some(id),
ObjectInner::OAuthClient(obj) => obj.member_tenant_id = Some(id),
+27
View File
@@ -1457,6 +1457,7 @@ pub enum DnsServer {
Vultr(DnsServerCloud),
WebSupport(DnsServerWebSupport),
YandexCloud(DnsServerYandexCloud),
PowerDns(DnsServerPowerDns),
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@@ -1672,6 +1673,7 @@ pub enum DnsServerBootstrap {
Vultr(DnsServerCloud),
WebSupport(DnsServerWebSupport),
YandexCloud(DnsServerYandexCloud),
PowerDns(DnsServerPowerDns),
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@@ -2435,6 +2437,31 @@ pub struct DnsServerPorkbun {
pub propagation_delay: Option<Duration>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(default)]
pub struct DnsServerPowerDns {
#[serde(rename = "apiKey")]
pub api_key: SecretKey,
#[serde(rename = "endpoint")]
pub endpoint: Option<String>,
#[serde(rename = "serverId")]
pub server_id: Option<String>,
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "memberTenantId")]
pub member_tenant_id: Option<Id>,
#[serde(rename = "timeout")]
pub timeout: Duration,
#[serde(rename = "ttl")]
pub ttl: Duration,
#[serde(rename = "pollingInterval")]
pub polling_interval: Duration,
#[serde(rename = "propagationTimeout")]
pub propagation_timeout: Duration,
#[serde(rename = "propagationDelay")]
pub propagation_delay: Option<Duration>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(default)]
pub struct DnsServerRoute53 {
+192 -13
View File
@@ -10557,6 +10557,7 @@ impl ObjectImpl for DnsServer {
DnsServer::Vultr(inner) => inner.validate(errors),
DnsServer::WebSupport(inner) => inner.validate(errors),
DnsServer::YandexCloud(inner) => inner.validate(errors),
DnsServer::PowerDns(inner) => inner.validate(errors),
}
}
@@ -10770,6 +10771,9 @@ impl ObjectImpl for DnsServer {
DnsServer::YandexCloud(object) => {
object.index(i);
}
DnsServer::PowerDns(object) => {
object.index(i);
}
}
}
}
@@ -11062,6 +11066,10 @@ impl Pickle for DnsServer {
69u16.pickle(out);
inner.pickle(out);
}
DnsServer::PowerDns(inner) => {
70u16.pickle(out);
inner.pickle(out);
}
}
}
@@ -11137,6 +11145,7 @@ impl Pickle for DnsServer {
67 => Pickle::unpickle(stream).map(DnsServer::Vultr),
68 => Pickle::unpickle(stream).map(DnsServer::WebSupport),
69 => Pickle::unpickle(stream).map(DnsServer::YandexCloud),
70 => Pickle::unpickle(stream).map(DnsServer::PowerDns),
_ => None,
}
}
@@ -11633,6 +11642,13 @@ impl IntoValue for DnsServer {
.insert_unchecked(Property::Type, JmapValue::Str("YandexCloud".into()));
obj
}
DnsServer::PowerDns(obj) => {
let mut obj = obj.into_value();
obj.as_object_mut()
.unwrap()
.insert_unchecked(Property::Type, JmapValue::Str("PowerDns".into()));
obj
}
}
}
}
@@ -11717,6 +11733,7 @@ impl RegistryJsonPatch for DnsServer {
DnsServerType::Vultr => *self = DnsServer::Vultr(Default::default()),
DnsServerType::WebSupport => *self = DnsServer::WebSupport(Default::default()),
DnsServerType::YandexCloud => *self = DnsServer::YandexCloud(Default::default()),
DnsServerType::PowerDns => *self = DnsServer::PowerDns(Default::default()),
}
}
match self {
@@ -11790,6 +11807,7 @@ impl RegistryJsonPatch for DnsServer {
DnsServer::Vultr(inner) => inner.patch(pointer, value),
DnsServer::WebSupport(inner) => inner.patch(pointer, value),
DnsServer::YandexCloud(inner) => inner.patch(pointer, value),
DnsServer::PowerDns(inner) => inner.patch(pointer, value),
}
}
}
@@ -11867,6 +11885,7 @@ impl DnsServer {
DnsServer::Vultr(_) => DnsServerType::Vultr,
DnsServer::WebSupport(_) => DnsServerType::WebSupport,
DnsServer::YandexCloud(_) => DnsServerType::YandexCloud,
DnsServer::PowerDns(_) => DnsServerType::PowerDns,
}
}
}
@@ -12702,6 +12721,7 @@ impl DnsServerBootstrap {
DnsServerBootstrap::Vultr(inner) => inner.validate(errors),
DnsServerBootstrap::WebSupport(inner) => inner.validate(errors),
DnsServerBootstrap::YandexCloud(inner) => inner.validate(errors),
DnsServerBootstrap::PowerDns(inner) => inner.validate(errors),
}
}
}
@@ -12997,6 +13017,10 @@ impl Pickle for DnsServerBootstrap {
70u16.pickle(out);
inner.pickle(out);
}
DnsServerBootstrap::PowerDns(inner) => {
71u16.pickle(out);
inner.pickle(out);
}
}
}
@@ -13073,6 +13097,7 @@ impl Pickle for DnsServerBootstrap {
68 => Pickle::unpickle(stream).map(DnsServerBootstrap::Vultr),
69 => Pickle::unpickle(stream).map(DnsServerBootstrap::WebSupport),
70 => Pickle::unpickle(stream).map(DnsServerBootstrap::YandexCloud),
71 => Pickle::unpickle(stream).map(DnsServerBootstrap::PowerDns),
_ => None,
}
}
@@ -13574,6 +13599,13 @@ impl IntoValue for DnsServerBootstrap {
.insert_unchecked(Property::Type, JmapValue::Str("YandexCloud".into()));
obj
}
DnsServerBootstrap::PowerDns(obj) => {
let mut obj = obj.into_value();
obj.as_object_mut()
.unwrap()
.insert_unchecked(Property::Type, JmapValue::Str("PowerDns".into()));
obj
}
}
}
}
@@ -13791,6 +13823,9 @@ impl RegistryJsonPatch for DnsServerBootstrap {
DnsServerBootstrapType::YandexCloud => {
*self = DnsServerBootstrap::YandexCloud(Default::default())
}
DnsServerBootstrapType::PowerDns => {
*self = DnsServerBootstrap::PowerDns(Default::default())
}
}
}
match self {
@@ -13865,6 +13900,7 @@ impl RegistryJsonPatch for DnsServerBootstrap {
DnsServerBootstrap::Vultr(inner) => inner.patch(pointer, value),
DnsServerBootstrap::WebSupport(inner) => inner.patch(pointer, value),
DnsServerBootstrap::YandexCloud(inner) => inner.patch(pointer, value),
DnsServerBootstrap::PowerDns(inner) => inner.patch(pointer, value),
}
}
}
@@ -13943,6 +13979,7 @@ impl DnsServerBootstrap {
DnsServerBootstrap::Vultr(_) => DnsServerBootstrapType::Vultr,
DnsServerBootstrap::WebSupport(_) => DnsServerBootstrapType::WebSupport,
DnsServerBootstrap::YandexCloud(_) => DnsServerBootstrapType::YandexCloud,
DnsServerBootstrap::PowerDns(_) => DnsServerBootstrapType::PowerDns,
}
}
}
@@ -18226,6 +18263,148 @@ impl RegistryJsonPropertyPatch for DnsServerPorkbun {
}
}
impl DnsServerPowerDns {
fn validate(&self, errors: &mut Vec<ValidationError>) -> bool {
let neb = errors.len();
let value = &self.api_key;
value.validate(errors);
if let Some(value) = &self.endpoint {
if value.is_empty() {
errors.push(ValidationError::required(Property::Endpoint));
}
}
if let Some(value) = &self.server_id {
if value.is_empty() {
errors.push(ValidationError::required(Property::ServerId));
}
}
let value = &self.description;
if value.is_empty() {
errors.push(ValidationError::required(Property::Description));
}
if let Some(value) = &self.member_tenant_id {
if !value.is_valid() {
errors.push(ValidationError::required(Property::MemberTenantId));
}
}
errors.len() == neb
}
fn index<'x>(&'x self, i: &mut IndexBuilder<'x>) {
i.foreign_key(ObjectType::Tenant, self.member_tenant_id, None);
if let Some(value) = &self.member_tenant_id {
i.search(Property::MemberTenantId, value);
}
}
}
impl Pickle for DnsServerPowerDns {
fn pickle(&self, out: &mut Vec<u8>) {
self.api_key.pickle(out);
self.endpoint.pickle(out);
self.server_id.pickle(out);
self.description.pickle(out);
self.member_tenant_id.pickle(out);
self.timeout.pickle(out);
self.ttl.pickle(out);
self.polling_interval.pickle(out);
self.propagation_timeout.pickle(out);
self.propagation_delay.pickle(out);
}
fn unpickle(stream: &mut crate::pickle::PickledStream<'_>) -> Option<Self> {
let mut this = Self::default();
this.api_key = Pickle::unpickle(stream)?;
this.endpoint = Pickle::unpickle(stream)?;
this.server_id = Pickle::unpickle(stream)?;
this.description = Pickle::unpickle(stream)?;
this.member_tenant_id = Pickle::unpickle(stream)?;
this.timeout = Pickle::unpickle(stream)?;
this.ttl = Pickle::unpickle(stream)?;
this.polling_interval = Pickle::unpickle(stream)?;
this.propagation_timeout = Pickle::unpickle(stream)?;
this.propagation_delay = Pickle::unpickle(stream)?;
Some(this)
}
}
impl Default for DnsServerPowerDns {
fn default() -> Self {
Self {
api_key: Default::default(),
endpoint: Default::default(),
server_id: Default::default(),
description: Default::default(),
member_tenant_id: Default::default(),
timeout: Duration::from_millis(30000),
ttl: Duration::from_millis(300000),
polling_interval: Duration::from_millis(15000),
propagation_timeout: Duration::from_millis(60000),
propagation_delay: Default::default(),
}
}
}
impl IntoValue for DnsServerPowerDns {
fn into_value(self) -> JmapValue<'static> {
let mut map = jmap_tools::Map::with_capacity(12);
map.insert_unchecked(Property::ApiKey, self.api_key.into_value());
map.insert_unchecked(Property::Endpoint, self.endpoint.into_value());
map.insert_unchecked(Property::ServerId, self.server_id.into_value());
map.insert_unchecked(Property::Description, self.description.into_value());
map.insert_unchecked(Property::MemberTenantId, self.member_tenant_id.into_value());
map.insert_unchecked(Property::Timeout, self.timeout.into_value());
map.insert_unchecked(Property::Ttl, self.ttl.into_value());
map.insert_unchecked(
Property::PollingInterval,
self.polling_interval.into_value(),
);
map.insert_unchecked(
Property::PropagationTimeout,
self.propagation_timeout.into_value(),
);
map.insert_unchecked(
Property::PropagationDelay,
self.propagation_delay.into_value(),
);
JmapValue::Object(map)
}
}
impl RegistryJsonPropertyPatch for DnsServerPowerDns {
fn patch_property<'x>(
&mut self,
mut pointer: JsonPointerPatch<'_>,
value: JmapValue<'x>,
) -> PatchResult<'x> {
match pointer.next_property() {
Some(Property::ApiKey) => self.api_key.patch(pointer, value),
Some(Property::Endpoint) => self
.endpoint
.patch(pointer.with_validators(&[StringValidator::Trim]), value),
Some(Property::ServerId) => self
.server_id
.patch(pointer.with_validators(&[StringValidator::Trim]), value),
Some(Property::Description) => self
.description
.patch(pointer.with_validators(&[StringValidator::Trim]), value),
Some(Property::MemberTenantId) => self
.member_tenant_id
.patch(pointer.assert_can_set_tenant()?, value),
Some(Property::Timeout) => self.timeout.patch(pointer, value),
Some(Property::Ttl) => self.ttl.patch(pointer, value),
Some(Property::PollingInterval) => self.polling_interval.patch(pointer, value),
Some(Property::PropagationTimeout) => self.propagation_timeout.patch(pointer, value),
Some(Property::PropagationDelay) => self.propagation_delay.patch(pointer, value),
Some(Property::Type) => Ok(MaybeUnpatched::Unpatched {
property: Property::Type,
value,
}),
_ => Err(PatchError::new(pointer, "Invalid property")),
}
}
}
impl DnsServerRoute53 {
fn validate(&self, errors: &mut Vec<ValidationError>) -> bool {
let neb = errors.len();
@@ -29620,8 +29799,8 @@ impl Default for MySqlSettings {
Self {
host: Default::default(),
port: 3306u64,
database: "stalwart".to_string(),
auth_username: Some("stalwart".to_string()),
database: "inbuxa".to_string(),
auth_username: Some("inbuxa".to_string()),
auth_secret: Default::default(),
}
}
@@ -29778,8 +29957,8 @@ impl Default for MySqlStore {
read_replicas: Default::default(),
host: Default::default(),
port: 3306u64,
database: "stalwart".to_string(),
auth_username: Some("stalwart".to_string()),
database: "inbuxa".to_string(),
auth_username: Some("inbuxa".to_string()),
auth_secret: Default::default(),
}
}
@@ -29940,7 +30119,7 @@ impl Default for NatsCoordinator {
no_echo: true,
use_tls: false,
auth_secret: Default::default(),
auth_username: Some("stalwart".to_string()),
auth_username: Some("inbuxa".to_string()),
credentials: Default::default(),
}
}
@@ -31122,8 +31301,8 @@ impl Default for PostgreSqlSettings {
Self {
host: Default::default(),
port: 5432u64,
database: "stalwart".to_string(),
auth_username: Some("stalwart".to_string()),
database: "inbuxa".to_string(),
auth_username: Some("inbuxa".to_string()),
auth_secret: Default::default(),
options: Default::default(),
}
@@ -31267,8 +31446,8 @@ impl Default for PostgreSqlStore {
read_replicas: Default::default(),
host: Default::default(),
port: 5432u64,
database: "stalwart".to_string(),
auth_username: Some("stalwart".to_string()),
database: "inbuxa".to_string(),
auth_username: Some("inbuxa".to_string()),
auth_secret: Default::default(),
options: Default::default(),
}
@@ -32573,7 +32752,7 @@ impl Default for RedisClusterStore {
Self {
urls: Map::new(vec!["redis://127.0.0.1".to_string()]),
timeout: Duration::from_millis(10000),
auth_username: Some("stalwart".to_string()),
auth_username: Some("inbuxa".to_string()),
auth_secret: Default::default(),
max_retry_wait: Default::default(),
min_retry_wait: Default::default(),
@@ -32740,7 +32919,7 @@ impl Default for RedisSentinelStore {
urls: Map::new(vec!["redis://127.0.0.1:26379".to_string()]),
service_name: "mymaster".to_string(),
timeout: Duration::from_millis(10000),
auth_username: Some("stalwart".to_string()),
auth_username: Some("inbuxa".to_string()),
auth_secret: Default::default(),
sentinel_username: Default::default(),
sentinel_secret: Default::default(),
@@ -40212,7 +40391,7 @@ impl Default for SpamSettings {
score_reject: Float::new(0.0f64),
score_spam: Float::new(5.0f64),
trust_replies: true,
spam_filter_rules_url: Some("https://github.com/stalwartlabs/spam-filter/releases/latest/download/spam-filter-rules.json.gz".to_string()),
spam_filter_rules_url: None,
}
}
}
@@ -46305,7 +46484,7 @@ impl Default for TracerLog {
fn default() -> Self {
Self {
path: Default::default(),
prefix: "stalwart".to_string(),
prefix: "inbuxa".to_string(),
rotate: LogRotateFrequency::Daily,
ansi: true,
multiline: false,
+1
View File
@@ -14,6 +14,7 @@ pub mod dkim;
pub mod http;
pub mod report;
pub mod secret;
pub mod spam;
pub mod task;
impl Roles {
+59
View File
@@ -0,0 +1,59 @@
/*
* SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <[email protected]>
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
*/
use crate::schema::prelude::{SpamDnsblServer, SpamRule};
impl SpamRule {
pub fn enable(&self) -> bool {
match self {
SpamRule::Any(rule) => rule.enable,
SpamRule::Url(rule) => rule.enable,
SpamRule::Domain(rule) => rule.enable,
SpamRule::Email(rule) => rule.enable,
SpamRule::Ip(rule) => rule.enable,
SpamRule::Header(rule) => rule.enable,
SpamRule::Body(rule) => rule.enable,
}
}
pub fn set_enable(&mut self, enable: bool) {
match self {
SpamRule::Any(rule) => rule.enable = enable,
SpamRule::Url(rule) => rule.enable = enable,
SpamRule::Domain(rule) => rule.enable = enable,
SpamRule::Email(rule) => rule.enable = enable,
SpamRule::Ip(rule) => rule.enable = enable,
SpamRule::Header(rule) => rule.enable = enable,
SpamRule::Body(rule) => rule.enable = enable,
}
}
}
impl SpamDnsblServer {
pub fn enable(&self) -> bool {
match self {
SpamDnsblServer::Any(server) => server.enable,
SpamDnsblServer::Url(server) => server.enable,
SpamDnsblServer::Domain(server) => server.enable,
SpamDnsblServer::Email(server) => server.enable,
SpamDnsblServer::Ip(server) => server.enable,
SpamDnsblServer::Header(server) => server.enable,
SpamDnsblServer::Body(server) => server.enable,
}
}
pub fn set_enable(&mut self, enable: bool) {
match self {
SpamDnsblServer::Any(server) => server.enable = enable,
SpamDnsblServer::Url(server) => server.enable = enable,
SpamDnsblServer::Domain(server) => server.enable = enable,
SpamDnsblServer::Email(server) => server.enable = enable,
SpamDnsblServer::Ip(server) => server.enable = enable,
SpamDnsblServer::Header(server) => server.enable = enable,
SpamDnsblServer::Body(server) => server.enable = enable,
}
}
}