dataset/seed/dovecot/funcs/dovecot.py

21 lines
585 B
Python
Raw Normal View History

2022-03-08 19:42:28 +01:00
from crypt import crypt as _crypt
from string import ascii_letters as _ascii_letters, digits as _digits
from secrets import choice as _choice
2022-03-29 16:30:38 +02:00
from risotto.utils import multi_function as _multi_function
2022-03-08 19:42:28 +01:00
def sha512_crypt(password):
salt = ''.join([_choice(_ascii_letters + _digits) for _ in range(8)])
prefix = '$6$'
return _crypt(password, prefix + salt)
2022-03-29 16:30:38 +02:00
@_multi_function
def calc_well_known(*args):
if None in args:
return
ret = []
for dom in args[1]:
ret.append(f'https://{args[0]}/mail/{dom}/autodiscover/autodiscover.xml')
return ret