[pmg-devel] [PATCH pmg-log-tracker 2/3] fix ToEntrys in FEntrys not being considered for 'to' filtering

Mira Limbeck m.limbeck at proxmox.com
Tue May 19 15:31:06 CEST 2020


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 at proxmox.com>
---
 src/main.rs | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/main.rs b/src/main.rs
index 394d8ac..8b497cd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -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;
             }
-- 
2.20.1




More information about the pmg-devel mailing list