]> git.proxmox.com Git - pmg-log-tracker.git/commitdiff
fix ToEntrys in FEntrys not being considered for 'to' filtering
authorMira Limbeck <m.limbeck@proxmox.com>
Tue, 19 May 2020 13:31:06 +0000 (15:31 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 19 May 2020 14:33:53 +0000 (16:33 +0200)
When a 'to' filter is specified and a mail has multiple 'to's with at
least one being accepted, the others blocked or quarantined and the
'to' for the accepted mail does not match, the entries in the filter
will be ignored even if one of them would match.
To fix it the filter ToEntrys are now considered in the 'to' check.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
src/main.rs

index 394d8ac9d8584d1725dc7bab79039a0d794d1ea6..8b497cd371ac8986be2d2628f7a1e968965a1248 100644 (file)
@@ -1345,6 +1345,16 @@ impl QEntry {
                     true
                 }
             });
+            if let Some(fe) = &self.filter {
+                fe.borrow_mut().to_entries.retain(|to| {
+                    if find_lowercase(&to.to, parser.options.to.as_bytes()).is_none() {
+                        false
+                    } else {
+                        found = true;
+                        true
+                    }
+                });
+            }
             if !found {
                 return false;
             }