use bitwise perms

This commit is contained in:
Antonio J. Delgado 2024-10-01 11:33:30 +03:00
parent 42f995f03b
commit d425ea6625

View file

@ -183,7 +183,10 @@ class ImapFilter:
sieve_script.write(content)
if os.geteuid() == 0:
os.chown(self.config['sieve_scripts_path'], owner, group)
os.chmod(self.config['sieve_scripts_path'], '0777')
os.chmod(
self.config['sieve_scripts_path'],
stat.S_IRUSR & stat.S_IWUSR & stat.S_IXUSR & stat.S_IRWXG & stat.S_IRGRP & stat.S_IWGRP & stat.S_IXGRP & stat.S_IRWXO & stat.S_IROTH & stat.S_IWOTH & stat.S_IXOTH
)
return True
def _process_message(self, message_id, data, mfilter):