From 33bdff42fbab7b983146f12f59003705f416a202 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Sun, 18 Apr 2021 15:10:27 +0200 Subject: [PATCH] filter: ignore mails marked for deletion --- src/bin/filter.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bin/filter.rs b/src/bin/filter.rs index e408172..83e6409 100644 --- a/src/bin/filter.rs +++ b/src/bin/filter.rs @@ -31,6 +31,9 @@ fn do_filtering(mailbox: &str, config: &str) -> Result<()> { imap_session.select(mailbox)?; for mail in mails { + if mail.has_flag2(TRASHED) || mail.has_flag2(DELETE) { + continue; // ignore mails marked for deletion + } if let Some(action) = mailproc::handle(&mail, &[], &config) { // TODO: provide raw bytes println!("{:?}", action.0); println!(" matched {}", mail.subject);