From 1bfefc256ac1cf2685ef6c01a05310ea735b5c09 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Wed, 5 Feb 2025 11:26:13 +0200 Subject: [PATCH] add debug --- imap_filter/imap_filter.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/imap_filter/imap_filter.py b/imap_filter/imap_filter.py index d5e43a3..3083d10 100644 --- a/imap_filter/imap_filter.py +++ b/imap_filter/imap_filter.py @@ -170,6 +170,11 @@ class ImapFilter: file_path = Path(self.config['sieve_scripts_path']) owner = file_path.owner() group = file_path.group() + self._log.debug( + "Detected owner '%s' and group '%s'", + owner, + group + ) with open(self.config['sieve_scripts_path'], 'r', encoding='UTF-8') as sieve_script: content = sieve_script.read() else: @@ -181,7 +186,7 @@ class ImapFilter: content += 'require ["fileinto"];' for mfilter in filters: self._log.debug( - 'Adding filter %s to sieve script', + 'Adding filter '%s' to sieve script', mfilter['name'] ) if 'field' in mfilter: @@ -213,6 +218,11 @@ class ImapFilter: search ) content += f"{replacement}\n" + self._log.debug( + "Writting sieve script '%s' with %s bytes", + self.config['sieve_scripts_path'], + len(content) + ) with open(self.config['sieve_scripts_path'], 'w', encoding='UTF-8') as sieve_script: sieve_script.write(content) if os.geteuid() == 0: