Fix missing vars
This commit is contained in:
parent
3245bd0e2f
commit
6daa19c5e9
1 changed files with 4 additions and 1 deletions
|
@ -159,6 +159,8 @@ class ImapFilter:
|
|||
return True
|
||||
|
||||
def _create_sieve_script(self, filters):
|
||||
owner = None
|
||||
group = None
|
||||
if os.path.exists(self.config['sieve_scripts_path']):
|
||||
self._log.debug(
|
||||
"Updating Sieve script in '%s'...",
|
||||
|
@ -214,7 +216,8 @@ class ImapFilter:
|
|||
with open(self.config['sieve_scripts_path'], 'w', encoding='UTF-8') as sieve_script:
|
||||
sieve_script.write(content)
|
||||
if os.geteuid() == 0:
|
||||
os.chown(self.config['sieve_scripts_path'], owner, group)
|
||||
if owner and group:
|
||||
os.chown(self.config['sieve_scripts_path'], owner, group)
|
||||
os.chmod(
|
||||
self.config['sieve_scripts_path'],
|
||||
0o777
|
||||
|
|
Loading…
Reference in a new issue