add debug
This commit is contained in:
parent
6daa19c5e9
commit
1bfefc256a
1 changed files with 11 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue