Compare commits

..

1 Commits

Author SHA1 Message Date
752f0fb7b6 fix(deps): update all non-major dependencies
Some checks failed
Continuous integration / Check (push) Successful in 53s
Continuous integration / Test Suite (push) Failing after 1m11s
Continuous integration / Trunk (push) Successful in 43s
Continuous integration / Rustfmt (push) Failing after 38s
Continuous integration / build (push) Successful in 1m26s
Continuous integration / Disallow unused dependencies (push) Failing after 27m37s
2025-08-13 23:16:50 +00:00
10 changed files with 30 additions and 201 deletions

40
Cargo.lock generated
View File

@@ -981,9 +981,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.44"
version = "4.5.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c1f056bae57e3e54c3375c41ff79619ddd13460a17d7438712bd0d83fda4ff8"
checksum = "1fc0e74a703892159f5ae7d3aac52c8e6c392f5ae5f359c70b5881d60aaac318"
dependencies = [
"clap_builder",
"clap_derive",
@@ -1003,9 +1003,9 @@ dependencies = [
[[package]]
name = "clap_derive"
version = "4.5.41"
version = "4.5.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491"
checksum = "14cb31bb0a7d536caef2639baa7fad459e15c3144efefa6dbd1c84562c4739f6"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -3171,7 +3171,7 @@ dependencies = [
[[package]]
name = "letterbox-notmuch"
version = "0.17.34"
version = "0.17.32"
dependencies = [
"itertools",
"log",
@@ -3186,7 +3186,7 @@ dependencies = [
[[package]]
name = "letterbox-procmail2notmuch"
version = "0.17.34"
version = "0.17.32"
dependencies = [
"anyhow",
"clap",
@@ -3199,7 +3199,7 @@ dependencies = [
[[package]]
name = "letterbox-server"
version = "0.17.34"
version = "0.17.32"
dependencies = [
"ammonia",
"anyhow",
@@ -3219,8 +3219,8 @@ dependencies = [
"futures 0.3.31",
"headers",
"html-escape",
"letterbox-notmuch 0.17.34",
"letterbox-shared 0.17.34",
"letterbox-notmuch 0.17.32",
"letterbox-shared 0.17.32",
"linkify",
"lol_html",
"mailparse",
@@ -3261,10 +3261,10 @@ dependencies = [
[[package]]
name = "letterbox-shared"
version = "0.17.34"
version = "0.17.32"
dependencies = [
"build-info",
"letterbox-notmuch 0.17.34",
"letterbox-notmuch 0.17.32",
"regex",
"serde",
"sqlx",
@@ -3274,7 +3274,7 @@ dependencies = [
[[package]]
name = "letterbox-web"
version = "0.17.34"
version = "0.17.32"
dependencies = [
"build-info",
"build-info-build",
@@ -3286,7 +3286,7 @@ dependencies = [
"graphql_client",
"human_format",
"itertools",
"letterbox-shared 0.17.34",
"letterbox-shared 0.17.32",
"log",
"seed",
"seed_hooks",
@@ -4733,9 +4733,9 @@ dependencies = [
[[package]]
name = "rayon"
version = "1.10.0"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f"
dependencies = [
"either",
"rayon-core",
@@ -4743,9 +4743,9 @@ dependencies = [
[[package]]
name = "rayon-core"
version = "1.12.1"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
dependencies = [
"crossbeam-deque 0.8.6",
"crossbeam-utils 0.8.21",
@@ -4861,9 +4861,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "reqwest"
version = "0.12.22"
version = "0.12.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531"
checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb"
dependencies = [
"base64 0.22.1",
"bytes 1.10.1",
@@ -7390,7 +7390,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
"windows-sys 0.59.0",
"windows-sys 0.48.0",
]
[[package]]

View File

@@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
edition = "2021"
license = "UNLICENSED"
publish = ["xinu"]
version = "0.17.34"
version = "0.17.32"
repository = "https://git.z.xinu.tv/wathiede/letterbox"
[profile.dev]

View File

@@ -29,8 +29,8 @@ flate2 = "1.1.2"
futures = "0.3.31"
headers = "0.4.0"
html-escape = "0.2.13"
letterbox-notmuch = { path = "../notmuch", version = "0.17.34", registry = "xinu" }
letterbox-shared = { path = "../shared", version = "0.17.34", registry = "xinu" }
letterbox-notmuch = { path = "../notmuch", version = "0.17.32", registry = "xinu" }
letterbox-shared = { path = "../shared", version = "0.17.32", registry = "xinu" }
linkify = "0.10.0"
lol_html = "2.3.0"
mailparse = "0.16.1"

View File

@@ -362,7 +362,7 @@ pub fn extract_mixed(m: &ParsedMail, part_addr: &mut Vec<String>) -> Result<Body
.subparts
.iter()
.map(|sp| sp.ctype.mimetype.as_str())
.filter(|mt| !handled_types.contains(mt))
.filter(|mt| !handled_types.contains(&mt))
.collect();
unhandled_types.sort();
if !unhandled_types.is_empty() {
@@ -500,7 +500,7 @@ pub fn extract_related(m: &ParsedMail, part_addr: &mut Vec<String>) -> Result<Bo
.subparts
.iter()
.map(|sp| sp.ctype.mimetype.as_str())
.filter(|mt| !handled_types.contains(mt))
.filter(|mt| !handled_types.contains(&mt))
.collect();
unhandled_types.sort();
if !unhandled_types.is_empty() {
@@ -774,7 +774,6 @@ pub struct FormattedRecord {
pub source_ip: String,
pub count: String,
pub header_from: String,
pub envelope_to: String,
pub disposition: String,
pub dkim: String,
pub spf: String,
@@ -812,7 +811,6 @@ pub struct FormattedFeedback {
pub report_metadata: Option<FormattedReportMetadata>,
pub policy_published: Option<FormattedPolicyPublished>,
pub record: Option<Vec<FormattedRecord>>,
pub has_envelope_to: bool,
}
#[derive(Debug, serde::Deserialize)]
@@ -1001,7 +999,6 @@ pub struct FormattedTlsRptFailureDetails {
#[derive(Debug, serde::Deserialize)]
pub struct Identifiers {
pub header_from: Option<String>,
pub envelope_to: Option<String>,
}
#[derive(Debug, serde::Deserialize)]
pub struct AuthResults {
@@ -1112,11 +1109,6 @@ pub fn parse_dmarc_report(xml: &str) -> Result<String, ServerError> {
.as_ref()
.and_then(|i| i.header_from.clone())
.unwrap_or_else(|| "".to_string()),
envelope_to: rec
.identifiers
.as_ref()
.and_then(|i| i.envelope_to.clone())
.unwrap_or_else(|| "".to_string()),
disposition: rec
.row
.as_ref()
@@ -1174,17 +1166,10 @@ pub fn parse_dmarc_report(xml: &str) -> Result<String, ServerError> {
pct: pol.pct.unwrap_or_else(|| "".to_string()),
});
let has_envelope_to = formatted_record
.as_ref()
.map_or(false, |r: &Vec<FormattedRecord>| {
r.iter().any(|rec| !rec.envelope_to.is_empty())
});
let formatted_feedback = FormattedFeedback {
report_metadata: formatted_report_metadata,
policy_published: formatted_policy_published,
record: formatted_record,
has_envelope_to,
};
let template = DmarcReportTemplate {
@@ -1233,24 +1218,3 @@ pub fn pretty_print_xml_with_trimming(xml_input: &str) -> Result<String, ServerE
Ok(String::from_utf8(result)?)
}
#[cfg(test)]
mod tests {
use std::fs;
use super::*;
#[test]
fn test_parse_dmarc_report() {
let xml = fs::read_to_string("testdata/dmarc-example.xml").unwrap();
let html = parse_dmarc_report(&xml).unwrap();
assert!(html.contains("hotmail.com"));
assert!(html.contains("msn.com"));
}
#[test]
fn test_parse_dmarc_report_no_envelope_to() {
let xml = fs::read_to_string("testdata/dmarc-example-no-envelope-to.xml").unwrap();
let html = parse_dmarc_report(&xml).unwrap();
assert!(!html.contains("Envelope To"));
}
}

View File

@@ -721,9 +721,9 @@ mod tests {
"policy-type": "sts",
"policy-string": [
"version: STSv1",
"mode: testing",
"mx: mail.xinu.tv",
"max_age: 86400"
"mode": "testing",
"mx": "mail.xinu.tv",
"max_age": "86400"
],
"policy-domain": "xinu.tv"
},
@@ -736,8 +736,6 @@ mod tests {
}
"#;
// The following constants are kept for future test expansion, but are currently unused.
/*
const REPORT_V2: &str = r#"
{
"organization-name": "Google Inc.",
@@ -807,7 +805,6 @@ mod tests {
]
}
"#;
*/
#[test]
fn test_parse_tls_report_v1() {

View File

@@ -40,9 +40,6 @@
<th style="border:1px solid #bbb;padding:4px 8px;">Source IP</th>
<th style="border:1px solid #bbb;padding:4px 8px;">Count</th>
<th style="border:1px solid #bbb;padding:4px 8px;">Header From</th>
{% if report.has_envelope_to %}
<th style="border:1px solid #bbb;padding:4px 8px;">Envelope To</th>
{% endif %}
<th style="border:1px solid #bbb;padding:4px 8px;">Disposition</th>
<th style="border:1px solid #bbb;padding:4px 8px;">DKIM</th>
<th style="border:1px solid #bbb;padding:4px 8px;">SPF</th>
@@ -55,9 +52,6 @@
<td style="border:1px solid #bbb;padding:4px 8px;">{{ rec.source_ip }}</td>
<td style="border:1px solid #bbb;padding:4px 8px;">{{ rec.count }}</td>
<td style="border:1px solid #bbb;padding:4px 8px;">{{ rec.header_from }}</td>
{% if report.has_envelope_to %}
<td style="border:1px solid #bbb;padding:4px 8px;">{{ rec.envelope_to }}</td>
{% endif %}
<td style="border:1px solid #bbb;padding:4px 8px;">{{ rec.disposition }}</td>
<td style="border:1px solid #bbb;padding:4px 8px;">{{ rec.dkim }}</td>
<td style="border:1px solid #bbb;padding:4px 8px;">{{ rec.spf }}</td>

View File

@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<feedback>
<version>1.0</version>
<report_metadata>
<org_name>google.com</org_name>
<email>noreply-dmarc-support@google.com</email>
<extra_contact_info>https://support.google.com/a/answer/2466580</extra_contact_info>
<report_id>5142106658860834914</report_id>
<date_range>
<begin>1755302400</begin>
<end>1755388799</end>
</date_range>
</report_metadata>
<policy_published>
<domain>xinu.tv</domain>
<adkim>s</adkim>
<aspf>s</aspf>
<p>quarantine</p>
<sp>reject</sp>
<pct>100</pct>
<np>reject</np>
</policy_published>
<record>
<row>
<source_ip>74.207.253.222</source_ip>
<count>1</count>
<policy_evaluated>
<disposition>none</disposition>
<dkim>pass</dkim>
<spf>pass</spf>
</policy_evaluated>
</row>
<identifiers>
<header_from>xinu.tv</header_from>
</identifiers>
<auth_results>
<dkim>
<domain>xinu.tv</domain>
<result>pass</result>
<selector>mail</selector>
</dkim>
<spf>
<domain>xinu.tv</domain>
<result>pass</result>
</spf>
</auth_results>
</record>
</feedback>

View File

@@ -1,78 +0,0 @@
<?xml version="1.0"?>
<feedback xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<version>1.0</version>
<report_metadata>
<org_name>Outlook.com</org_name>
<email>dmarcreport@microsoft.com</email>
<report_id>e6c5a2ce6e074d7d8cd041a0d6f32a3d</report_id>
<date_range>
<begin>1755302400</begin>
<end>1755388800</end>
</date_range>
</report_metadata>
<policy_published>
<domain>xinu.tv</domain>
<adkim>s</adkim>
<aspf>s</aspf>
<p>quarantine</p>
<sp>reject</sp>
<pct>100</pct>
<fo>1</fo>
</policy_published>
<record>
<row>
<source_ip>74.207.253.222</source_ip>
<count>1</count>
<policy_evaluated>
<disposition>none</disposition>
<dkim>pass</dkim>
<spf>pass</spf>
</policy_evaluated>
</row>
<identifiers>
<envelope_to>msn.com</envelope_to>
<envelope_from>xinu.tv</envelope_from>
<header_from>xinu.tv</header_from>
</identifiers>
<auth_results>
<dkim>
<domain>xinu.tv</domain>
<selector>mail</selector>
<result>pass</result>
</dkim>
<spf>
<domain>xinu.tv</domain>
<scope>mfrom</scope>
<result>pass</result>
</spf>
</auth_results>
</record>
<record>
<row>
<source_ip>74.207.253.222</source_ip>
<count>1</count>
<policy_evaluated>
<disposition>none</disposition>
<dkim>pass</dkim>
<spf>pass</spf>
</policy_evaluated>
</row>
<identifiers>
<envelope_to>hotmail.com</envelope_to>
<envelope_from>xinu.tv</envelope_from>
<header_from>xinu.tv</header_from>
</identifiers>
<auth_results>
<dkim>
<domain>xinu.tv</domain>
<selector>mail</selector>
<result>pass</result>
</dkim>
<spf>
<domain>xinu.tv</domain>
<scope>mfrom</scope>
<result>pass</result>
</spf>
</auth_results>
</record>
</feedback>

View File

@@ -12,7 +12,7 @@ version.workspace = true
[dependencies]
build-info = "0.0.41"
letterbox-notmuch = { path = "../notmuch", version = "0.17.34", registry = "xinu" }
letterbox-notmuch = { path = "../notmuch", version = "0.17.32", registry = "xinu" }
regex = "1.11.1"
serde = { version = "1.0.219", features = ["derive"] }
sqlx = "0.8.5"

View File

@@ -33,7 +33,7 @@ wasm-bindgen = "=0.2.100"
uuid = { version = "1.16.0", features = [
"js",
] } # direct dep to set js feature, prevents Rng issues
letterbox-shared = { path = "../shared/", version = "0.17.34", registry = "xinu" }
letterbox-shared = { path = "../shared/", version = "0.17.32", registry = "xinu" }
seed_hooks = { version = "0.4.1", registry = "xinu" }
strum_macros = "0.27.1"
gloo-console = "0.3.0"