Update changelog

This commit is contained in:
David Bürgin 2021-04-29 18:32:13 +02:00
parent a2e9bb1acc
commit 8ac1c04079
2 changed files with 10 additions and 4 deletions

View file

@ -1,5 +1,11 @@
# SpamAssassin Milter changelog
## 0.1.6 (unreleased)
* Improve processing of incoming `X-Spam-Flag` headers. Previously, in rare
circumstances a message flagged as spam would not be rejected as requested.
Reported by Petar Bogdanovic.
## 0.1.5 (2021-03-16)
* Read output from `spamc` in a separate thread in order to avoid blocking

View file

@ -145,7 +145,7 @@ pub static REPORT_HEADERS: Lazy<HeaderSet<'static>> = Lazy::new(|| {
pub struct HeaderRewriter<'a> {
original: HeaderMap,
processed: HeaderSet<'a>,
spam: Option<bool>,
spam_flag: Option<bool>,
spam_assassin_mods: Vec<HeaderMod<'a>>,
rewrite_mods: Vec<HeaderMod<'a>>,
report_mods: Vec<HeaderMod<'a>>,
@ -157,7 +157,7 @@ impl<'a> HeaderRewriter<'a> {
Self {
original,
processed: HeaderSet::new(),
spam: None,
spam_flag: None,
spam_assassin_mods: vec![],
rewrite_mods: vec![],
report_mods: vec![],
@ -169,7 +169,7 @@ impl<'a> HeaderRewriter<'a> {
// Assumes that the value is normalised to using CRLF line breaks, and
// includes leading whitespace.
if name.eq_ignore_ascii_case("X-Spam-Flag") {
self.spam.get_or_insert_with(|| value.trim().eq_ignore_ascii_case("YES"));
self.spam_flag.get_or_insert_with(|| value.trim().eq_ignore_ascii_case("YES"));
}
if is_spam_assassin_header(name) {
if let Some(m) = self.convert_to_header_mod(name, value) {
@ -204,7 +204,7 @@ impl<'a> HeaderRewriter<'a> {
}
pub fn is_flagged_spam(&self) -> bool {
self.spam == Some(true)
self.spam_flag.unwrap_or(false)
}
pub fn rewrite_spam_assassin_headers(