On écrit pas dans le .forward s'il existe déjà
This commit is contained in:
parent
588eba0515
commit
e2b8fd08f8
1 changed files with 10 additions and 2 deletions
|
@ -176,9 +176,17 @@ class home:
|
||||||
|
|
||||||
### Redirection
|
### Redirection
|
||||||
if mail_redirect:
|
if mail_redirect:
|
||||||
file(home + '/.forward', 'w').write(mail_redirect + '\n')
|
write_in_forward = True
|
||||||
|
|
||||||
|
# On vérifie s'il y a déjà un .forward
|
||||||
|
if os.path.exists(os.path.join(home, ".forward")):
|
||||||
|
write_in_forward = False
|
||||||
|
if write_in_forward:
|
||||||
|
with open(os.path.join(home + '.forward'), 'w') as forward_file:
|
||||||
|
forward_file.write(mail_redirect + '\n')
|
||||||
|
|
||||||
os.chown(home + '/.forward', int(uid), gid)
|
os.chown(home + '/.forward', int(uid), gid)
|
||||||
os.chmod(home + '/.forward', 0604)
|
os.chmod(home + '/.forward', 0600)
|
||||||
### Owncloud dans le home
|
### Owncloud dans le home
|
||||||
if not os.path.exists(home + '/OwnCloud'):
|
if not os.path.exists(home + '/OwnCloud'):
|
||||||
os.mkdir(home + '/OwnCloud')
|
os.mkdir(home + '/OwnCloud')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue